Follow these steps to build and publish a new version of the package:
-
Update Version Number
- Open the file
sapat/__version__.py - Increment the version number according to semantic versioning (e.g., from '0.1.0' to '0.1.1')
- Open the file
-
Update CHANGELOG.md
- Add a new entry for the new version
- List all notable changes, additions, and fixes
-
Commit Changes
- Stage the changed files:
git add sapat/__version__.py CHANGELOG.md - Commit the changes:
git commit -m "Bump version to X.Y.Z and update CHANGELOG"
- Stage the changed files:
-
Create a Git Tag
- Create a new tag with the version number:
git tag vX.Y.Z - Push the tag to the remote repository:
git push origin vX.Y.Z
- Create a new tag with the version number:
-
Build the Package
- Ensure you have the latest build tools:
pip install --upgrade setuptools wheel twine - Build the distribution packages:
python setup.py sdist bdist_wheel
- Ensure you have the latest build tools:
-
Check the Distribution
- Use twine to check the distribution:
twine check dist/*
- Use twine to check the distribution:
-
Upload to TestPyPI (Optional)
- Upload the distribution to TestPyPI:
twine upload --repository-url https://test.pypi.org/legacy/ dist/* - Test the installation from TestPyPI:
pip install --index-url https://test.pypi.org/simple/ --no-deps sapat
- Upload the distribution to TestPyPI:
-
Upload to PyPI
- Upload the distribution to PyPI:
twine upload dist/*
- Upload the distribution to PyPI:
-
Verify Installation
- In a new virtual environment, install the package from PyPI:
pip install sapat - Run a quick test to ensure the package is working correctly
- In a new virtual environment, install the package from PyPI:
-
Update Documentation
- Update any version-specific documentation on your project's website or README
-
Create a GitHub Release
- Go to your GitHub repository
- Create a new release, using the tag you created earlier
- Include the CHANGELOG entries for this version in the release notes
-
Announce the Release
- Inform your users about the new release through your preferred channels (e.g., mailing list, social media, blog post)
Remember to replace 'X.Y.Z' with your actual version number throughout this process.