|
15 | 15 | # limitations under the License.
|
16 | 16 |
|
17 | 17 | ################################################################################
|
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 |
20 | 23 | #
|
21 | 24 | # CAUTION: when targeting the test pypi repository, this script assumes that the
|
22 | 25 | # local version of cirq has the same dependencies as the remote one (because the
|
23 | 26 | # dependencies must be installed from the non-test pypi repository). If the
|
24 | 27 | # dependencies disagree, the tests can spuriously fail.
|
25 | 28 | #
|
26 | 29 | # 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 |
28 | 31 | ################################################################################
|
29 | 32 |
|
30 | 33 | set -e
|
31 | 34 | trap "{ echo -e '\033[31mFAILED\033[0m'; }" ERR
|
32 | 35 |
|
33 | 36 |
|
34 | 37 | PROJECT_NAME=cirq
|
35 |
| -PROJECT_NAME_DEV=cirq-dev |
36 | 38 | PROJECT_VERSION=$1
|
37 | 39 | PROD_SWITCH=$2
|
38 | 40 |
|
|
44 | 46 | if [ "${PROD_SWITCH}" = "--test" ]; then
|
45 | 47 | PYPI_REPOSITORY_FLAG="--index-url=https://test.pypi.org/simple/"
|
46 | 48 | PYPI_REPO_NAME="TEST"
|
47 |
| -elif [ -z "${PROD_SWITCH}" ] || [ "${PROD_SWITCH}" = "--prod" ]; then |
| 49 | + PYPI_PROJECT_NAME="cirq" |
| 50 | +elif [ "${PROD_SWITCH}" = "--prod" ]; then |
48 | 51 | PYPI_REPOSITORY_FLAG=''
|
49 | 52 | 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" |
50 | 58 | 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" |
52 | 60 | exit 1
|
53 | 61 | fi
|
54 | 62 |
|
@@ -76,8 +84,8 @@ for PYTHON_VERSION in python3; do
|
76 | 84 | echo "Pre-installing dependencies since they don't all exist in TEST pypi"
|
77 | 85 | "${tmp_dir}/${PYTHON_VERSION}/bin/pip" install --quiet -r "${RUNTIME_DEPS_FILE}"
|
78 | 86 | 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}" |
81 | 89 |
|
82 | 90 | # Check that code runs without dev deps.
|
83 | 91 | echo Checking that code executes
|
|
0 commit comments