Introduction
Over the past few weeks, I worked on share-my-repo, a CLI tool designed to package Git repositories into a format suitable for analysis by Large Language Models (LLMs). The goal was to create a user-friendly, configurable tool that could extract repository metadata, and generate structured file outputs.
Once the tool was ready, the next step was to release it so that others could easily install and use it via a package registry. This post walks through my entire release process, the challenges I faced, lessons learned, and the results of user testing.
Choosing a Release Tool and Package Registry
I decided to use Python’s standard packaging tools along with PyPI as the package registry. Specifically:
-
Build & Packaging:
setuptools+wheel+setuptools_scm -
Distribution/Upload:
twine - Registry: PyPI (Python Package Index)
These tools are standard in the Python ecosystem and widely used for publishing Python packages.
Creating a Release
The release process involved several steps:
Updating Version
I updated the pyproject.toml to bump the version from 1.0.0 to 1.2.0.
Building the Package
I created a source distribution and a wheel using:
python -m build
This Produced:
dist/share_my_repo-1.2.0.tar.gz
dist/share_my_repo-1.2.0-py3-none-any.whl
Uploading to PyPI
I uploaded the distributions using twine:
python -m twine upload dist/*
Tagging the Release in GitHub
After pushing my code, I created a Git tag for the release:
git tag v1.2.0
git push origin main --tags
This made the release visible on GitHub under Releases.
Lessons Learned
pyproject.tomlis powerful: Switching fromsetup.pytopyproject.tomlmade the build process cleaner and more modern.User testing highlights documentation gaps: Even small missing instructions in
README.mdcaused confusion for first-time users.One "aha!" moment was realizing that
setuptools_scmcan auto-generate version numbers from Git tags, which makes managing releases much easier in the long run.
Changes Required for Package Format
To release share-my-repo successfully, I had to:
- Move from a
setup.pyfile to apyproject.tomlconfiguration. - Organize source code under a
srcfolder to comply with best practices. - Add
[project.scripts]entries inpyproject.tomlfor CLI functionality. - Ensure dependencies were correctly listed under
[project.dependencies]and[project.optional-dependencies].
These changes were mostly structural and did not require altering the core functionality of the tool.
User Testing
I conducted a user testing session with a fellow classmate. Key observations:
- They were able to install the package from PyPI without any issues.
- Confusion arose when using optional flags like
--previewand--use-gitignorebecause the README did not clearly explain the default behavior. - After observing them, I updated the README to include examples with common flag combinations.
This session was invaluable because it allowed me to fix documentation issues before sharing the package widely.
Installation & Usage
After release, users can install the package directly from PyPI release:
Install via PyPI
pip install share-my-repo
Install from Github
If you want to install the package directly from GitHub:
- Clone the repository:
For End Users
Clone and install the package:
# clone the repository
git clone https://github.com/yourusername/share-my-repo.git
cd share-my-repo
# install dependencies
pip install .
For Development / Contributors
Install in editable mode to make code changes without reinstalling:
# clone the repository
git clone https://github.com/yourusername/share-my-repo.git
cd share-my-repo
# install dependencies
pip install -e .
Usage
share-my-repo [OPTIONS] [PATHS...]
Some Examples
Process the current directory and print Markdown to console:
share-my-repo .
Process a repository and save output to a file:
share-my-repo . --output repo_context.md
Include only Python and JavaScript files:
share-my-repo . --include "*.py,*.js"
Output as JSON:
share-my-repo . --format json --output repo.json
Conclusion
Releasing share-my-repo taught me key lessons:
- Versioning is crucial: Always increment versions to avoid PyPI upload errors.
-
Modern packaging works:
pyproject.tomlmakes builds cleaner and easier to manage. - Clear documentation matters: User testing revealed gaps and helped improve the README.
-
Automation helps:
setuptools_scmsimplifies version management. - User perspective is important: Observing real users showed how to make CLI options more intuitive.
Overall, this experience improved my understanding of Python packaging, release workflows, and creating user-friendly documentation.
Top comments (0)