DEV Community

DenisC
DenisC

Posted on

Packaging my Open Source Project - Release 1.0.0

This week, I finally published my project to PyPI. I relied heavily on the official Python packaging tutorial, using hatchling as the build backend and publishing through PyPI. Following the recommended modern workflow, I generated the distribution archives using python3 -m build and uploaded them with twine, after creating a PyPI account and configuring an API token.

Before any of that could happen, I needed to restructure my project to match the standard packaging format. This meant placing the actual source code inside a src/ directory and creating another package folder inside it, renamed as src/repo_context_packager. I also ensured the project root contained essential files such as LICENSE and README.md, and I created a pyproject.toml file to define the build system and project metadata. With these pieces in place, I was able to build the wheel and source distribution and prepare them for upload.

The most frustrating part of the process came from re-organizing the file structure. Moving the package from src/ directly into src/repo_context_packager meant that several parts of the project had to be updated. All internal imports needed to reference the new path, test files that depended on relative imports had to be adjusted, and usage instructions in the README required rewrites as well. Even GitHub workflow files were affected because they referenced specific paths for testing and packaging. Although the changes were not complicated, together they required careful attention to ensure nothing broke.

After the initial release, I also received useful feedback from early users. Someone pointed out that I had misspelled requirements.txt as requirement.txt in my installation command, which I quickly corrected. Another issue was that I had forgotten to update a path in the usage instructions after moving my files. The README originally told users to copy a template TOML file into src/, but the correct destination after restructuring was src/repo_context_packager/. I updated the documentation to reflect this so new users would not run into errors.

If you want to try the package, there are several easy ways to access it. It can be downloaded directly from PyPI page, installed via the command pip install repo-context-packager==1.0.0, or obtained by cloning the GitHub repository. Once the package is installed or downloaded, you can follow the instructions in the README to get started. Feel free to file an issue if you find any bugs or have any suggestion!

Top comments (0)