This document outlines the steps to publish the MindForge package to PyPI.
Ensure you have the following installed:
buildtwine
You can install them via pip:
pip install build twine-
Update Version: Ensure the version number in
pyproject.tomlis correct and updated for the new release. -
Build the Package: Run the following command from the root of the repository to build the source distribution and wheel:
python -m build
This will create a
dist/directory containing the.tar.gzand.whlfiles. -
Check the Package: Use
twineto check the build artifacts for any issues:twine check dist/* -
Upload to TestPyPI (Optional but Recommended): uploading to TestPyPI first allows you to verify that everything looks correct without affecting the production index.
twine upload --repository testpypi dist/*You will need an account on TestPyPI.
-
Upload to PyPI: Once verified, upload the package to the real PyPI:
twine upload dist/*You will need an account on PyPI.
It is recommended to automate this process using GitHub Actions or a similar CI/CD tool. A typical workflow would:
- Trigger on a new tag (e.g.,
v1.0.0). - Run tests.
- Build the package.
- Publish to PyPI using a repository secret (API token).