This guide covers how to publish quickforge to PyPI so it can be installed with pip install quickforge.
-
PyPI Account: Create accounts on:
-
API Tokens: Generate API tokens for authentication:
cd /Volumes/NO\ NAME/01_ACTIVE/Pypi/quickforge
# Using uv (if available)
uv pip install build twine
# Or using pip
pip install build twineCreate or edit ~/.pypirc:
[distutils]
index-servers =
pypi
testpypi
[pypi]
username = __token__
password = pypi-YOUR_PYPI_API_TOKEN_HERE
[testpypi]
repository = https://test.pypi.org/legacy/
username = __token__
password = pypi-YOUR_TESTPYPI_API_TOKEN_HERESecurity Note: Set proper permissions: chmod 600 ~/.pypirc
rm -rf dist/ build/ *.egg-info src/*.egg-infopython -m buildThis creates:
dist/quickforge-0.1.0.tar.gz(source distribution)dist/quickforge-0.1.0-py3-none-any.whl(wheel)
# Check the contents
tar -tzf dist/quickforge-0.1.0.tar.gz | head -20
unzip -l dist/quickforge-0.1.0-py3-none-any.whl | head -20
# Validate with twine
twine check dist/*-
Upload to TestPyPI:
twine upload --repository testpypi dist/* -
Test Installation:
# Create a fresh virtual environment python -m venv test_env source test_env/bin/activate # or test_env\Scripts\activate on Windows # Install from TestPyPI pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ quickforge # Test it works quickforge --version quickforge --help
-
Upload to Production PyPI:
twine upload dist/*
twine upload dist/*After publishing:
# Install from PyPI
pip install quickforge
# Verify installation
quickforge --version
quickforge new test-project --type library --yesBefore each release, update the version in:
pyproject.toml:version = "X.Y.Z"src/quickforge/__init__.py:__version__ = "X.Y.Z"
Follow Semantic Versioning:
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
After publishing to PyPI, create a GitHub release:
-
Tag the release:
git tag -a v0.1.0 -m "Release v0.1.0" git push origin v0.1.0 -
Create release on GitHub with release notes
Add this workflow to .github/workflows/publish.yml:
name: Publish to PyPI
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write # Required for trusted publishing
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install build tools
run: pip install build
- name: Build package
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# Uses trusted publishing - no token needed!To enable trusted publishing:
- Go to PyPI → Your Projects → quickforge → Settings → Publishing
- Add GitHub as a trusted publisher:
- Owner:
Technical-1 - Repository:
quickforge - Workflow:
publish.yml
- Owner:
The version already exists on PyPI. Bump the version number.
Regenerate your API token and update ~/.pypirc.
Check that .gitignore excludes test files, .venv, etc.
If quickforge is already taken on PyPI, you'll need to choose a different name like py-init or quickforge-cli.
# Full release workflow
cd /Volumes/NO\ NAME/01_ACTIVE/Pypi/quickforge
rm -rf dist/ build/
python -m build
twine check dist/*
twine upload --repository testpypi dist/* # Test first
twine upload dist/* # Production