Publishing to PyPI
This guide explains how to build and publish the Curriculum Curator package to PyPI.
Prerequisites
- Create accounts on PyPI and TestPyPI
- Generate API tokens for both PyPI and TestPyPI
- Have the following packages installed:
Setup PyPI Credentials
-
Copy the template file to your home directory:
-
Edit the file with your tokens:
-
Replace the token placeholders with your actual tokens
Building the Package
From the project root directory, run:
This will create:
- A source distribution (.tar.gz
file) in the dist/
directory
- A wheel (.whl
file) in the dist/
directory
Uploading to TestPyPI
Before uploading to the main PyPI repository, you should test the package on TestPyPI:
Installing from TestPyPI
To verify the package works when installed from TestPyPI:
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ curriculum-curator
Note: The --extra-index-url
option is needed because TestPyPI doesn't have all the dependencies.
Uploading to PyPI
Once you've verified the package works properly from TestPyPI, you can upload it to the main PyPI repository:
Version Management
- Update the version number in
pyproject.toml
before each release - Follow semantic versioning: MAJOR.MINOR.PATCH
- Update the CHANGELOG.md file with the changes in the new release
- Create a git tag for each release:
Publishing Version 0.2.0
To publish version 0.2.0 with the new workflow builder:
-
Clean previous builds:
-
Build the package:
-
Upload to TestPyPI:
-
Test the installation from TestPyPI:
-
Verify the workflow builder works:
-
If everything works correctly, upload to PyPI: