Skip to content

Developer Doc: Creating a New Release

Lorenz edited this page Jan 31, 2023 · 12 revisions

setup.py Changes

Comment out use_scm_version=True and add version="x.y.z", just below it.

init.py Changes

Change the version number in the __init__.py file in the root cadquery directory: __version__ = "x.y-dev" becomes __version__ = "x.y.z"

Update changes.md

All of the changes since the last release need to be documented.

Create a PR

Create a PR for the release changes to give other devs and the broader community the opportunity to comment.

Merge PR

Just what the section title says.

Publish to PyPI reference

Change to the root of your local copy of the CadQuery repo.

  1. Make sure pip is the latest version.
pip install --upgrade pip
  1. Install the latest build package from PyPA.
pip install --upgrade build
  1. Perform the build.
python -m build
  1. Make sure that a dist directory was created with a .tar.gz file in it and a .whl file.
ls dist

Example listing for CadQuery version 2.2.0:

dist_dir_listing 5. Install the latest version of the twine package.

pip install --upgrade twine
  1. Upload the dist to testpypi first to make sure the upload works correctly.
python -m twine upload --repository testpypi dist/*

You will be asked for a username and password. For the username use __token__ and for the password use the token you have generated at testpy under your user account settings. 7. Create a virtual environment and do a test install of the newly created release.

pip install --index-url https://test.pypi.org/simple/ --no-deps cadquery

You have to use --no-deps because the dependency packages are not available on TestPyPI. If everything worked without errors, you can now upload to the real PyPI. 8. Upload to the real PyPI

python -m twine upload dist/*

Test this final release in a virtual environment, and if there are no errors, you are done.

Tag the release

temporary placeholder for this step - please check and complete for 2.2

Tagging the release will automatically build the conda packages.

Change init.py version back to dev

Example: __version__ = "2.2.0" would be become __version__ = "2.3-dev" to start next release cycle.

Change setup.py back to use SCM version

Uncomment use_scm_version=True and comment out the version="x.y.z", entry that is just below it.

Clone this wiki locally