This is the recommended way - fully automated!
-
Get your account-scoped token from PyPI:
- You need the one that shows "Scope: entire account"
- If you don't have it, create one at: https://pypi.org/manage/account/token/
-
Add to GitHub:
- Go to: https://github.com/oluwafemidiakhoa/adaptive-sparse-training/settings/secrets/actions
- Click "New repository secret"
- Name:
PYPI_API_TOKEN - Value: Paste your account-scoped PyPI token
- Click "Add secret"
Option A: Via GitHub Web Interface
- Go to: https://github.com/oluwafemidiakhoa/adaptive-sparse-training/releases/new
- Fill in:
- Tag version:
v1.0.0(create new tag) - Release title:
Release 1.0.0 - Initial PyPI Release - Description:
🎉 First release of Adaptive Sparse Training on PyPI! Install: pip install adaptive-sparse-training Features: - 3-line integration for energy-efficient training - 60%+ energy savings with zero accuracy loss - Validated on ImageNet-100 (92.12% accuracy) - Mixed precision training support - PI-controlled adaptive sample selection
- Tag version:
- Click "Publish release"
Option B: Via Command Line
git tag v1.0.0
git push origin v1.0.0
# Then create release on GitHub web interface- Go to: https://github.com/oluwafemidiakhoa/adaptive-sparse-training/actions
- You'll see "Publish to PyPI" workflow running
- Wait ~2 minutes for it to complete
- Check https://pypi.org/project/adaptive-sparse-training/ - Your package is live!
If you prefer manual control or GitHub Actions isn't working:
-
Account-scoped PyPI token that shows "Scope: entire account"
- If you only have project-scoped, go create a new one:
- https://pypi.org/manage/account/token/
- Select "Scope to entire account" radio button
-
Run upload command:
twine upload dist/*When prompted:
- Username:
__token__ - Password: [paste your account-scoped token]
Once live on PyPI (via either method), anyone can install with:
pip install adaptive-sparse-trainingI'll then update the README to show the pip install command!
Use GitHub Actions (Option 1) if:
- ✅ You want automated publishing
- ✅ You want a professional release workflow
- ✅ You plan to publish updates in the future
- ✅ You want version tagging and release notes
Use Manual Upload (Option 2) if:
- ✅ You want immediate control
- ✅ You're having issues with GitHub Actions
- ✅ You're only publishing once
For first upload, the token MUST say:
Scope: entire account
NOT:
Scope: Project: adaptive-sparse-training
The project-scoped token will NOT work until after the first upload.
Problem: Token is project-scoped instead of account-scoped
Fix:
- Go to: https://pypi.org/manage/account/token/
- Delete existing tokens
- Create NEW token
- When creating, select radio button "Scope to entire account"
- Copy the new token
Problem: Wrong secret name or token
Fix:
- Verify secret is named exactly
PYPI_API_TOKEN - Verify token in secret is account-scoped
- Re-run workflow
Let me know which option you choose and when it's published!