diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index 3f5058a4649..111d7abd712 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -1,4 +1,4 @@ -name: Release cirq-unstable to PyPi +name: Pre-release cirq to PyPi on: push: @@ -25,7 +25,7 @@ jobs: TWINE_USERNAME: ${{ secrets.PYPI_USER }} TWINE_PASSWORD: ${{ secrets.PYPI_PASS }} run: | - export CIRQ_UNSTABLE_VERSION=$(dev_tools/packaging/generate-dev-version-id.sh) - [[ "$CIRQ_UNSTABLE_VERSION" =~ .*dev.* ]] && echo "Deploying dev version '$CIRQ_UNSTABLE_VERSION'" || (echo "not dev version"; exit 1) + export CIRQ_PRE_RELEASE_VERSION=$(dev_tools/packaging/generate-dev-version-id.sh) + [[ "$CIRQ_PRE_RELEASE_VERSION" =~ .*dev.* ]] && echo "Deploying dev version '$CIRQ_PRE_RELEASE_VERSION'" || (echo "not dev version"; exit 1) python setup.py bdist_wheel twine upload dist/* \ No newline at end of file diff --git a/README.rst b/README.rst index da195a2d2df..8f226afb784 100644 --- a/README.rst +++ b/README.rst @@ -23,7 +23,7 @@ Installation and Documentation Cirq documentation is available at `cirq.readthedocs.io `_. -Documentation for the latest **unstable** version of cirq (tracks the repository's master branch; what you get if you ``pip install cirq-unstable``), is available at `cirq.readthedocs.io/latest `_. +Documentation for the latest **pre-release** version of cirq (tracks the repository's master branch; what you get if you ``pip install --pre cirq``), is available at `cirq.readthedocs.io/latest `_. Documentation for the latest **stable** version of cirq (what you get if you ``pip install cirq``) is available at `cirq.readthedocs.io/stable `_. diff --git a/dev_tools/packaging/publish-dev-package.sh b/dev_tools/packaging/publish-dev-package.sh index d63ea052920..efabf878d5c 100755 --- a/dev_tools/packaging/publish-dev-package.sh +++ b/dev_tools/packaging/publish-dev-package.sh @@ -15,8 +15,7 @@ # limitations under the License. ################################################################################ -# Produces and uploads dev-version wheels to a pypi package 'cirq-unstable' -# Note that this is not the dev-version for cirq, whose use is deprecated. +# Produces and uploads dev-version wheels to the 'cirq' pypi package # # Uploads to the test pypi repository unless the --prod switch is added. # @@ -112,8 +111,8 @@ cd "$(git rev-parse --show-toplevel)" tmp_package_dir=$(mktemp -d "/tmp/publish-dev-package_package.XXXXXXXXXXXXXXXX") trap "{ rm -rf ${tmp_package_dir}; }" EXIT -# Configure to push to cirq-unstable and not cirq. -export CIRQ_UNSTABLE_VERSION=$(dev_tools/packaging/generate-dev-version-id.sh) +# Configure to push to a pre-release package of cirq. +export CIRQ_PRE_RELEASE_VERSION=$(dev_tools/packaging/generate-dev-version-id.sh) # Produce packages. dev_tools/packaging/produce-package.sh "${tmp_package_dir}" "${UPLOAD_VERSION}" diff --git a/dev_tools/packaging/verify-published-package.sh b/dev_tools/packaging/verify-published-package.sh index baa158624b7..cc9e6e55381 100755 --- a/dev_tools/packaging/verify-published-package.sh +++ b/dev_tools/packaging/verify-published-package.sh @@ -16,8 +16,8 @@ ################################################################################ # Downloads and tests cirq wheels from the pypi package repository. -# Can verify prod, test, or unstable versions. -# --unstable: cirq-unstable from prod pypi +# Can verify prod, test, or pre-release versions. +# --pre: pre-release cirq from prod pypi # --test: cirq from test pypi # --prod: cirq from prod pypi # @@ -27,7 +27,7 @@ # dependencies disagree, the tests can spuriously fail. # # Usage: -# dev_tools/packaging/verify-published-package.sh PACKAGE_VERSION --test|--prod|--unstable +# dev_tools/packaging/verify-published-package.sh PACKAGE_VERSION --test|--prod|--pre ################################################################################ set -e @@ -44,19 +44,19 @@ if [ -z "${PROJECT_VERSION}" ]; then fi if [ "${PROD_SWITCH}" = "--test" ]; then - PYPI_REPOSITORY_FLAG="--index-url=https://test.pypi.org/simple/" + PIP_FLAGS="--index-url=https://test.pypi.org/simple/" PYPI_REPO_NAME="TEST" PYPI_PROJECT_NAME="cirq" elif [ "${PROD_SWITCH}" = "--prod" ]; then - PYPI_REPOSITORY_FLAG='' + PIP_FLAGS='' PYPI_REPO_NAME="PROD" PYPI_PROJECT_NAME="cirq" -elif [ "${PROD_SWITCH}" = "--unstable" ]; then - PYPI_REPOSITORY_FLAG='' +elif [ "${PROD_SWITCH}" = "--pre" ]; then + PIP_FLAGS='--pre' PYPI_REPO_NAME="PROD" - PYPI_PROJECT_NAME="cirq-unstable" + PYPI_PROJECT_NAME="cirq" else - echo -e "\033[31mSecond argument must be '--prod' or '--test' or '--unstable'.\033[0m" + echo -e "\033[31mSecond argument must be '--prod' or '--test' or '--pre'.\033[0m" exit 1 fi @@ -85,7 +85,7 @@ for PYTHON_VERSION in python3; do "${tmp_dir}/${PYTHON_VERSION}/bin/pip" install --quiet -r "${RUNTIME_DEPS_FILE}" fi echo Installing "${PYPI_PROJECT_NAME}==${PROJECT_VERSION} from ${PYPI_REPO_NAME} pypi" - "${tmp_dir}/${PYTHON_VERSION}/bin/pip" install --quiet ${PYPI_REPOSITORY_FLAG} "${PYPI_PROJECT_NAME}==${PROJECT_VERSION}" + "${tmp_dir}/${PYTHON_VERSION}/bin/pip" install --quiet ${PIP_FLAGS} "${PYPI_PROJECT_NAME}==${PROJECT_VERSION}" # Check that code runs without dev deps. echo Checking that code executes diff --git a/docs/tutorials/google/colab.ipynb b/docs/tutorials/google/colab.ipynb index 26d3d4e5936..87ed2acdea7 100644 --- a/docs/tutorials/google/colab.ipynb +++ b/docs/tutorials/google/colab.ipynb @@ -161,7 +161,7 @@ "\n", "For details of authentication and installation, please see [go/quantum-engine-quickstart](http://go/quantum-engine-quickstart). \n", "\n", - "Note: The below code will install the latest stable release of cirq. If you need the latest and greatest features and don't mind if a few things aren't quite working correctly, you can install `cirq-unstable` instead of `cirq` to get the most up-to-date features of cirq.\n", + "Note: The below code will install the latest stable release of cirq. If you need the latest and greatest features and don't mind if a few things aren't quite working correctly, you can install the pre-release version of `cirq` using `pip install --pre cirq` instead of `pip install cirq` to get the most up-to-date features of cirq.\n", "\n", "1. Enter the Cloud project ID you'd like to use in the `project_id` field.\n", "2. Then run the cell below (and go through the auth flow for access to the project id you entered).\n", diff --git a/release.md b/release.md index 6b32a894bb3..5b6bc874c66 100644 --- a/release.md +++ b/release.md @@ -6,7 +6,7 @@ themselves are created. Note that development is done on the `master` branch, so if you want to use a more stable version you should use one of the [releases](https://github.com/quantumlib/Cirq/releases) or install from pypi using `pip install cirq`. The release from the -latest commit to master can be installed with `pip install cirq-unstable`. +latest commit to master can be installed with `pip install --pre cirq`. ## Versioning diff --git a/setup.py b/setup.py index 90c3888174f..ef26e6ea428 100644 --- a/setup.py +++ b/setup.py @@ -30,11 +30,13 @@ # README file as long_description. long_description = io.open('README.rst', encoding='utf-8').read() -# If CIRQ_UNSTABLE_VERSION is set then we use cirq-unstable as the name of the package -# and update the version to this value. -if 'CIRQ_UNSTABLE_VERSION' in os.environ: - name = 'cirq-unstable' - __version__ = os.environ['CIRQ_UNSTABLE_VERSION'] +# If CIRQ_PRE_RELEASE_VERSION is set then we update the version to this value. +# It is assumed that it ends with one of `.devN`, `.aN`, `.bN`, `.rcN` and hence +# it will be a pre-release version on PyPi. See +# https://packaging.python.org/guides/distributing-packages-using-setuptools/#pre-release-versioning +# for more details. +if 'CIRQ_PRE_RELEASE_VERSION' in os.environ: + __version__ = os.environ['CIRQ_PRE_RELEASE_VERSION'] long_description = ( "**This is a development version of Cirq and may be " "unstable.**\n\n**For the latest stable release of Cirq "