PyPI Setup Guide for HPFRACC๏
Overview๏
This guide explains how to set up PyPI authentication for uploading the hpfracc package.
Prerequisites๏
PyPI account with API token access
twinepackage installed (pip install twine)
Setup Steps๏
1. Create PyPI API Token๏
Go to PyPI Account Settings
Navigate to โAPI tokensโ
Create a new token with scope:
hpfraccCopy the token (it starts with
pypi-)
2. Configure Authentication๏
Create a .pypirc file in your home directory (~/.pypirc):
[distutils]
index-servers =
pypi
testpypi
[pypi]
username = __token__
password = YOUR_PYPI_API_TOKEN_HERE
repository = https://upload.pypi.org/legacy/
[testpypi]
username = __token__
password = YOUR_TESTPYPI_API_TOKEN_HERE
repository = https://test.pypi.org/legacy/
Important: Replace YOUR_PYPI_API_TOKEN_HERE with your actual token.
3. Build and Upload๏
# Build the package
python -m build
# Upload to PyPI
twine upload dist/*
# Upload to TestPyPI (optional)
twine upload --repository testpypi dist/*
Security Notes๏
Never commit
.pypircto git - it contains sensitive API tokensThe
.pypircfile is already in.gitignoreUse
.pypirc.templateas a reference for the file structure
Troubleshooting๏
If you get authentication errors, verify your API token is correct
Ensure the token has the correct scope for the
hpfraccprojectCheck that
.pypircis in your home directory (~/.pypirc)
Current Status๏
โ Package successfully uploaded to PyPI as
hpfracc-1.3.1โ Authentication working with project-scoped API token
โ Automated uploads via
twine upload dist/*