Skip to content

Commit a258fc1

Browse files
committed
Rename cirq-dev to cirq-unstable
- Refactor verify-published-package to have an --unstable flag. - Refactor verify-published-package to require --prod/--test/--unstable be specified - Rename various CIRQ_DEV type things to CIRQ_UNSTABLE type things Fixes #2431
1 parent 99677f7 commit a258fc1

File tree

4 files changed

+26
-18
lines changed

4 files changed

+26
-18
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ matrix:
114114
os: linux
115115
env: NAME=dev-release
116116
python: '3.7'
117-
script: export CIRQ_DEV_VERSION=$(dev_tools/packaging/generate-dev-version-id.sh)
117+
script: export CIRQ_UNSTABLE_VERSION=$(dev_tools/packaging/generate-dev-version-id.sh)
118118
before_deploy:
119-
- echo "Deploying dev version '$CIRQ_DEV_VERSION'"
119+
- echo "Deploying dev version '$CIRQ_UNSTABLE_VERSION'"
120120
deploy:
121121
- provider: pypi
122122
user: quantumlibdev
123123
on:
124-
condition: '"$CIRQ_DEV_VERSION" == *dev*'
124+
condition: '"$CIRQ_UNSTABLE_VERSION" == *dev*'
125125
distributions: bdist_wheel
126126
password:
127127
secure: KO3RuwLvjb5/J7akv2v/a9tEIbmErp7El6S+ZfMvDRlx8qpUfav1w4nvSGw6sfn837++2+F2Tb22wbJkjefpFMzg9mOdhFGwtOpiHSOnYlY2mnxVN9XdQnMS7F+8IMFas4J3EhqrlsZxoqyMy122S3pjtE/d6YSG+3YzmCu3rLsFl4EV6I5U8MgWJY8LDFqMIxuxgmEkJfPe5z9Sqqwtneelj39jobg4q1uZc0JD3rkI0hj/uhBvBoTTLQjPiZk3ZIkgkMmPVB8tDGK9eXqVuDK7U1ZoDWvTKNebZ94g46YuKVNY6tEJpgpacti6mMalva6wX8zYpWOrY0PPo34e5d/kfwkttnrMk+sPXJnvn5eM7tEWxF+PHz4ejcLEYpehgdbWksHaUVdPog7UrYXnertHDY42ukxF17JlU9rlf60IXJVmeYHTfB1p8V7Yfllgmfa49yGDnR68Y3iIR9NtT26ZoJnMAkrxvlTgz6poBbTKj+Gyr0pkTHLzniEo3D/C8xeVcD30yZPlXxCojcM4s2dM2h5IiQU//ubptP/TE0idG2AJiooEfGUsXZ+IbN4Zxvkoa4YzYCvYFlr42ZBnv0H5/xZc4uFK6rLcVtysZqWAj3QjVGIUX3G1sxy8ik+RSQun1Dhzov8v5RVtb6aShDWT6l6paAAEwrQNt0T44yo=

dev_tools/packaging/publish-dev-package.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616

1717
################################################################################
18-
# Produces and uploads dev-version wheels to a pypi package repository cirq-dev
18+
# Produces and uploads dev-version wheels to a pypi package 'cirq-unstable'
1919
# Note that this is not the dev-version for cirq, whose use is deprecated.
2020
#
2121
# Uploads to the test pypi repository unless the --prod switch is added.
@@ -112,8 +112,8 @@ cd "$(git rev-parse --show-toplevel)"
112112
tmp_package_dir=$(mktemp -d "/tmp/publish-dev-package_package.XXXXXXXXXXXXXXXX")
113113
trap "{ rm -rf ${tmp_package_dir}; }" EXIT
114114

115-
# Configure to push to cirq-dev and not cirq.
116-
export CIRQ_DEV_VERSION=$(dev_tools/packaging/generate-dev-version-id.sh)
115+
# Configure to push to cirq-unstable and not cirq.
116+
export CIRQ_UNSTABLE_VERSION=$(dev_tools/packaging/generate-dev-version-id.sh)
117117

118118
# Produce packages.
119119
dev_tools/packaging/produce-package.sh "${tmp_package_dir}" "${UPLOAD_VERSION}"

dev_tools/packaging/verify-published-package.sh

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,26 @@
1515
# limitations under the License.
1616

1717
################################################################################
18-
# Downloads and tests cirq-dev wheels from the pypi package repository. Uses the
19-
# prod pypi repository unless the --test switch is added.
18+
# Downloads and tests cirq wheels from the pypi package repository.
19+
# Can verify prod, test, or unstable versions.
20+
# --unstable: cirq-unstable from prod pypi
21+
# --test: cirq from test pypi
22+
# --prod: cirq from prod pypi
2023
#
2124
# CAUTION: when targeting the test pypi repository, this script assumes that the
2225
# local version of cirq has the same dependencies as the remote one (because the
2326
# dependencies must be installed from the non-test pypi repository). If the
2427
# dependencies disagree, the tests can spuriously fail.
2528
#
2629
# Usage:
27-
# dev_tools/packaging/verify-published-package.sh PACKAGE_VERSION [--test|--prod]
30+
# dev_tools/packaging/verify-published-package.sh PACKAGE_VERSION --test|--prod|--unstable
2831
################################################################################
2932

3033
set -e
3134
trap "{ echo -e '\033[31mFAILED\033[0m'; }" ERR
3235

3336

3437
PROJECT_NAME=cirq
35-
PROJECT_NAME_DEV=cirq-dev
3638
PROJECT_VERSION=$1
3739
PROD_SWITCH=$2
3840

@@ -44,11 +46,17 @@ fi
4446
if [ "${PROD_SWITCH}" = "--test" ]; then
4547
PYPI_REPOSITORY_FLAG="--index-url=https://test.pypi.org/simple/"
4648
PYPI_REPO_NAME="TEST"
47-
elif [ -z "${PROD_SWITCH}" ] || [ "${PROD_SWITCH}" = "--prod" ]; then
49+
PYPI_PROJECT_NAME="cirq"
50+
elif [ "${PROD_SWITCH}" = "--prod" ]; then
4851
PYPI_REPOSITORY_FLAG=''
4952
PYPI_REPO_NAME="PROD"
53+
PYPI_PROJECT_NAME="cirq"
54+
elif [ "${PROD_SWITCH}" = "--unstable" ]; then
55+
PYPI_REPOSITORY_FLAG=''
56+
PYPI_REPO_NAME="PROD"
57+
PYPI_PROJECT_NAME="cirq-unstable"
5058
else
51-
echo -e "\033[31mSecond argument must be empty, '--prod' or '--test'.\033[0m"
59+
echo -e "\033[31mSecond argument must be '--prod' or '--test' or '--unstable'.\033[0m"
5260
exit 1
5361
fi
5462

@@ -76,8 +84,8 @@ for PYTHON_VERSION in python3; do
7684
echo "Pre-installing dependencies since they don't all exist in TEST pypi"
7785
"${tmp_dir}/${PYTHON_VERSION}/bin/pip" install --quiet -r "${RUNTIME_DEPS_FILE}"
7886
fi
79-
echo Installing "${PROJECT_NAME_DEV}==${PROJECT_VERSION} from ${PYPI_REPO_NAME} pypi"
80-
"${tmp_dir}/${PYTHON_VERSION}/bin/pip" install --quiet ${PYPI_REPOSITORY_FLAG} "${PROJECT_NAME_DEV}==${PROJECT_VERSION}"
87+
echo Installing "${PYPI_PROJECT_NAME}==${PROJECT_VERSION} from ${PYPI_REPO_NAME} pypi"
88+
"${tmp_dir}/${PYTHON_VERSION}/bin/pip" install --quiet ${PYPI_REPOSITORY_FLAG} "${PYPI_PROJECT_NAME}==${PROJECT_VERSION}"
8189

8290
# Check that code runs without dev deps.
8391
echo Checking that code executes

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
# README file as long_description.
2929
long_description = io.open('README.rst', encoding='utf-8').read()
3030

31-
# If CIRQ_DEV_VERSION is set then we use cirq-dev as the name of the package
31+
# If CIRQ_UNSTABLE_VERSION is set then we use cirq-unstable as the name of the package
3232
# and update the version to this value.
33-
if 'CIRQ_DEV_VERSION' in os.environ:
34-
name = 'cirq-dev'
35-
__version__ = os.environ['CIRQ_DEV_VERSION']
33+
if 'CIRQ_UNSTABLE_VERSION' in os.environ:
34+
name = 'cirq-unstable'
35+
__version__ = os.environ['CIRQ_UNSTABLE_VERSION']
3636
long_description = (
3737
"**This is a development version of Cirq and may be "
3838
"unstable.**\n\n**For the latest stable release of Cirq "

0 commit comments

Comments
 (0)