This section is for developers.
Before a release make sure to:
- change version number in
pyproject.toml
in thedev
branch. - Merge the
dev
branch into themain
branch. Note: thedev
branch should only be merged intomain
when it is ready for a new release.
In the GitHub repository, click on Releases, click on Draft new release.
- Title the release with the version number preceded by a
v
, e.g.,v1.0.0
. Nothing else should go in the title. - Tag the release using the same name as the Title.
- Click on Generate release notes. This adds the PR messages and contributors. Ideally nothing more is needed, but might require minor editing/formatting.
- Select the Create a discussion checkmark and mark as Announcement.
This will trigger the PyPI, Conda, and GH-Pages build and deploy.
For pre-releases make sure to use correct semantic versioning for the version number in pyproject.toml
.
In the Github release, for the title and tag name append the pre-release version after the version name, e.g., v1.2.0-alpha
or v1.2.1-beta.3
, and select the pre-release checkmark. Do not select the Create a discussion checkmark.
For details see the Python packaging user guide and in particular the packaging tutorial.
The PyPI package is created and uploaded automatically to TestPyPI and PyPI on every GitHub release.
This is done sequentially, so that if TestPyPi fails the package is not pushed to PyPi
.
See the GitHub release workflow.
NOTE: While GitHub lets you delete a release and then create a new one with the same name, PyPI does not. You can delete releases but you cannot upload a package with the same version as a previous one (even a deleted one).
When a new release is available on PyPI, Conda-forge has a bot that will automatically find this and create a pull request in wecopttool-feedstock, the GitHub repository that houses the Conda recipe for WecOptTool. Conda-forge does not currently have full integration with pyproject.toml
files, so we have to manually update the meta.yaml
file in the WecOptTool Conda recipe with any new or removed dependencies if changes were made in pyproject.toml
. The version number, SHA256, and build number should be automatically updated by the bot, but these should also be checked just in case.
Follow the instructions on the Conda-forge maintainer documentation to push any required changes to the bot-generated pull request. Merge and close the pull request once these updates are pushed and the Conda-forge CI passes. The Conda build will now install the new release for users.