This guide walks you through publishing pythonprojectmanager (ppm) to PyPI.
- PyPI Account - Create one at https://pypi.org/account/register/
- GitHub Account - The repository needs to be on GitHub
- PyPI API Token - Generate at https://pypi.org/manage/account/tokens/
- Go to https://github.com/new
- Create a new repository named
PythonProjectManager - Choose public/private as desired
- Do not initialize with README (we already have one)
- Click "Create repository"
From your local repository directory:
cd "C:\Users\kurok\Desktop\pythonFiles\PythonProjectManager"
# If not already initialized
git init
git config user.email "your.email@gmail.com"
git config user.name "Your Name"
# Add all files
git add .
# Create initial commit
git commit -m "Initial commit: Python virtual environment manager CLI"
# Add remote (replace YOUR_USERNAME with your GitHub username)
git remote add origin https://github.com/YOUR_USERNAME/PythonProjectManager.git
git branch -M main
# Push to GitHub
git push -u origin main- Go to your repository on GitHub
- Click Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
PYPI_API_TOKEN - Value: Paste your PyPI API token (from https://pypi.org/manage/account/tokens/)
- Click Add secret
Edit setup.cfg to add your GitHub username and email:
[metadata]
url = https://github.com/YOUR_USERNAME/PythonProjectManager
author = Your Name
author_email = your.email@gmail.comThe GitHub Actions workflow is already configured to publish whenever you push a tag starting with v.
cd "C:\Users\kurok\Desktop\pythonFiles\PythonProjectManager"
# Create a git tag
git tag v0.1.0
# Push the tag to GitHub
git push origin v0.1.0This will trigger the .github/workflows/publish-pypi.yml workflow which:
- Builds the wheel package
- Publishes to PyPI
- Go to your GitHub repository
- Click Actions tab
- Watch the "Publish Python package" workflow run
- Once complete, your package is available on PyPI!
For each new version:
-
Update version in
setup.cfg:[metadata] version = 0.2.0
-
Commit and tag:
git add setup.cfg git commit -m "Bump version to 0.2.0" git tag v0.2.0 git push origin main git push origin v0.2.0
Once published, users can install with:
pip install pythonprojectmanager
ppm --helpThe .github/workflows/publish-pypi.yml file:
- Triggers on any tag matching
v*(e.g., v0.1.0, v1.0.0) - Builds a wheel distribution
- Uploads to PyPI using the
PYPI_API_TOKENsecret - Automatically creates a GitHub Release
If pythonprojectmanager is taken, modify in setup.cfg:
name = python-project-manager # or similarMake sure you:
- Created the token correctly on PyPI (it starts with
pypi-) - Pasted it correctly in GitHub Secrets
- The secret name matches exactly:
PYPI_API_TOKEN
Build locally:
python -m pip install build
python -m build --wheel
# Creates dist/pythonprojectmanager-0.1.0-py3-none-any.whl
# Test install
pip install dist/pythonprojectmanager-0.1.0-py3-none-any.whl
ppm --help- PyPI: https://pypi.org/project/pythonprojectmanager/
- GitHub Releases: https://github.com/YOUR_USERNAME/PythonProjectManager/releases
- PyPI API Tokens: https://pypi.org/manage/account/tokens/