Releases are normally cut by the Build and Upload Python Package GitHub action,
which is triggered manually and takes the new version number as its input. It
bumps the version, formats the repository, creates the tag and release, and
uploads to PyPI and the cnapy Anaconda channel. The steps below are the manual
equivalent, for the case where the action cannot be used.
The conda-forge package (straindesign-cobra, feedstock
https://github.com/conda-forge/straindesign-cobra-feedstock) is not uploaded by
us. conda-forge's bot watches PyPI and, a few hours after a release lands
there, opens a version-bump pull request on the feedstock. A feedstock
maintainer reviews the dependency list against pyproject.toml, waits for
the feedstock CI and merges; the package appears on conda-forge shortly after.
Only dependency or Python-version changes need a manual edit of the
feedstock's recipe/recipe.yaml in that pull request.
- Update the version number in
pyproject.toml,conda-recipe/meta.yamlanddocs/source/conf.py.python .github/update_version.py <file> <version>does this per file and fails if the file declares no version, so a silent miss is not possible. Update dependencies/versions and the description inpyproject.tomlandrequirements.txtif necessary. - Create a new tag/release on GitHub with a matching version number (e.g.
v0.1)
- Install the newest version of pip (
python -m pip install --upgrade piporconda update pip) - Install the build frontend and twine (
pip install --upgrade build twine)
- Clean the dist folder (remove old version builds)
- Navigate to the package folder and build with
python -m build, which produces both the source distribution and the wheel - Verify the metadata renders on PyPI with
twine check dist/* - Upload the source distribution and wheel via
twine upload dist/*(use PyPI credentials)
- Create a conda environment to build the package (e.g.
conda create -n straindesign-build) - Activate the environment (
conda activate straindesign-build) - Install the requirements (
conda install anaconda-client conda-build)
- Navigate to the package folder and build with
conda-build conda-recipe/. -c conda-forge --croot conda-bld - Clean up the conda-bld folder (remove old version builds)
anaconda loginanaconda upload -u cnapy conda-bld/noarch/straindesign*- Clean up with conda