Changelogs » Cirq

PyUp Safety actively tracks 373,221 Python packages for vulnerabilities and notifies you when to upgrade.



NEXT_VER=NEXT_VERSION   e.g. "0.8.0" (skip for PATCH releases)
  Create release branch
  Create a release branch called "v${VERSION}-dev":
  git checkout -b "v${VER}-dev"
  If you are doing a PATCH update, also cherrypick the commits for the fixes
  you want to include in your update and resolve all potential merge conflicts
  git cherry-pick <commit>
  Bump the version on the release branch:
  python dev_tools/ replace_version --old ${VER}.dev --new ${VER}
  git add .
  git commit -m "Removing ${VER}.dev -> ${VER}"
  git push origin "v${VER}-dev"
  Bump the master version
  WARNING: Only bump the master version for minor and major releases, for PATCH
  updates, leave it as it is.
  git checkout master -b "version_bump_${NEXT_VER}"
  python dev_tools/ replace_version --old ${VER}.dev --new ${NEXT_VER}.dev
  git add .
  git commit -m "Bump cirq version to ${NEXT_VER}"
  git push origin "version_bump_${NEXT_VER}"
  Master branch should never see a non-dev version specifier.
  Create distribution wheel
  From release branch, create a binary distribution wheel. This is the package
  that will go to pypi.
  git checkout "v${VER}-dev"
  ./dev_tools/packaging/ dist
  ls dist   should only contain one file, for each modules
  Push to test pypi
  The package server pypi has a test server where packages can be uploaded to
  check that they work correctly before pushing the real version.  This section
  illustrates how to upload the package to test pypi and verify that it works.
  First, upload the package in the dist/ directory.  (Ensure that this is the only
  package in this directory, or modify the commands to upload only this
  twine upload --repository-url= -u="$TEST_TWINE_USERNAME" -p="$TEST_TWINE_PASSWORD" "dist/*"
  Next, run automated verification.
  Note: sometimes the first verification from test pypi will fail.
  NOTE: FIRST RUN WILL LIKELY FAIL - pypi might not have yet indexed the version
  ./dev_tools/packaging/ "${VER}" --test
  Once this runs, you can create a virtual environment to perform
  manual verification as a sanity check and to check version number and
  any high-risk features that have changed this release.
  mkvirtualenv "verify_test_${VER}" --python=/usr/bin/python3
  pip install -r dev_tools/requirements/dev.env.txt
  pip install --index-url= cirq=="${VER}"
  python -c "import cirq; print(cirq.__version__)"
  python   just do some stuff checking that latest features are present
  Draft release notes and email
  Put together a release notes document that can be used as part of a
  release and for an announcement email.
  You can model the release notes on the previous release from the
  [Release page](
  1. Fill out the new version in "Tag Version" and choose your release
  branch to create the tag from.
  2. Attach the generated whl file to the release
  Retrieve all commits since the last release with:
  git log "--pretty=%h %s".
  You can get the changes to the top-level objects and protocols by
  checking the history of the init files. `git diff <previous version>..HEAD cirq-core/cirq/`
  You can get the contributing authors for the release by running:
  `git log <previous version>..HEAD --pretty="%an" | sort | uniq | sed ':a;N;$!ba;s/\n/, /g'`
  Release to prod pypi
  Upload to prod pypi using the following command:
  twine upload --username="$PROD_TWINE_USERNAME" --password="$PROD_TWINE_PASSWORD" "dist/*"
  Perform automated verification tests:
  NOTE: FIRST RUN WILL LIKELY FAIL - pypi might not have yet indexed the version
  ./dev_tools/packaging/ "${VER}" --prod
  Next, create a virtual environment to perform manual verification of the
  mkvirtualenv "verify_${VER}" --python=/usr/bin/python3
  pip install cirq
  python -c "import cirq; print(cirq.__version__)"
  Create the release
  Using the information above, create the release on the
  [Release page](
  Be sure to include the whl file as an attachment.
  Release PR for notebooks
  If there are unreleased notebooks, that are under testing (`NOTEBOOKS_DEPENDING_ON_UNRELEASED_FEATURES` is not empty in [dev_tools/notebooks/](dev_tools/notebooks/, follow the steps in our [notebooks guide](docs/dev/
  Email cirq-announce
  Lastly, email with the release notes
  and an announcement of the new version.
  Congratulate yourself for a well done release!