Skip to content

Commit 5a479db

Browse files
authored
Install cirq pre-release with stable dependencies (#6534)
Update instructions to use `pip install cirq~=1.0.dev` for cirq pre-release. This matches the latest pre-release with the major version 1. Avoid using the pip-install `--pre` option as it applies to all direct and transitive dependencies that get installed with cirq.
1 parent 2e2ad24 commit 5a479db

32 files changed

+63
-63
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ RUN pip3 install cirq
2323

2424
##cirq pre_release image
2525
FROM cirq_base AS cirq_pre_release
26-
RUN pip3 install cirq --pre
26+
RUN pip3 install cirq~=1.0.dev

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Installation and Documentation
2222

2323
Cirq documentation is available at `quantumai.google/cirq <https://quantumai.google/cirq>`_.
2424

25-
Documentation for the latest **pre-release** version of cirq (tracks the repository's main branch; what you get if you ``pip install --pre cirq``), is available `here <https://quantumai.google/reference/python/cirq/all_symbols?version=nightly>`__.
25+
Documentation for the latest **pre-release** version of cirq (tracks the repository's main branch; what you get if you ``pip install cirq~=1.0.dev``), is available `here <https://quantumai.google/reference/python/cirq/all_symbols?version=nightly>`__.
2626

2727
Documentation for the latest **stable** version of cirq (what you get if you ``pip install cirq``) is available `here <https://quantumai.google/reference/python/cirq/all_symbols>`__.
2828

cirq-aqt/README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Installation
2020
------------
2121

2222
To install the stable version of only **cirq-aqt**, use `pip install cirq-aqt`.
23-
To install the pre-release version of only **cirq-aqt**, use `pip install cirq-aqt --pre`.
23+
To install the pre-release version of only **cirq-aqt**, use `pip install cirq-aqt~=1.0.dev`.
2424

2525
Note, that this will install both cirq-aqt and cirq-core as well.
2626

27-
To get all the optional modules installed as well, you'll have to use `pip install cirq` or `pip install cirq --pre` for the pre-release version.
27+
To get all the optional modules installed as well, you'll have to use `pip install cirq` or `pip install cirq~=1.0.dev` for the pre-release version.

cirq-core/README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ Installation
1313
------------
1414

1515
To install the stable version of only **cirq-core**, use `pip install cirq-core`.
16-
To install the pre-release version of only **cirq-core**, use `pip install cirq-core --pre`.
16+
To install the pre-release version of only **cirq-core**, use `pip install cirq-core~=1.0.dev`.
1717

18-
To get all the optional modules installed as well, you'll have to use `pip install cirq` or `pip install cirq --pre` for the pre-release version.
18+
To get all the optional modules installed as well, you'll have to use `pip install cirq` or `pip install cirq~=1.0.dev` for the pre-release version.

cirq-core/cirq/contrib/quimb/Cirq-to-Tensor-Networks.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"### Circuit to Tensors\n",
9090
"The circuit defines a tensor network representation. By default, the initial state is the `|0...0>` state (represented by the \"zero qubit\" operations labeled \"Q0\" in the legend. \"Q1\" are single qubit operations and \"Q2\" are two qubit operations. The open legs are the indices into the state vector and are of the form \"i{m}_q{n}\" where `m` is the time index (given by the returned `qubit_frontier` dictionary) and \"n\" is the qubit string.\n",
9191
"\n",
92-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq --pre`."
92+
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
9393
]
9494
},
9595
{

cirq-core/cirq/contrib/quimb/Contract-a-Grid-Circuit.ipynb

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"metadata": {},
66
"source": [
77
"## Setup\n",
8-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq --pre`."
8+
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
99
]
1010
},
1111
{
@@ -20,14 +20,14 @@
2020
" import cirq\n",
2121
"except ImportError:\n",
2222
" print(\"installing cirq...\")\n",
23-
" !pip install --quiet cirq --pre\n",
23+
" !pip install --quiet cirq~=1.0.dev\n",
2424
" print(\"installed cirq.\")\n",
2525
"\n",
2626
"try:\n",
2727
" import quimb\n",
2828
"except ImportError:\n",
2929
" print(\"installing cirq-core[contrib]...\")\n",
30-
" !pip install --quiet 'cirq-core[contrib]' --pre\n",
30+
" !pip install --quiet 'cirq-core[contrib]~=1.0.dev'\n",
3131
" print(\"installed cirq-core[contrib].\")"
3232
]
3333
},
@@ -38,7 +38,7 @@
3838
"# Contract a Grid Circuit\n",
3939
"Shallow circuits on a planar grid with low-weight observables permit easy contraction.\n",
4040
"\n",
41-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq --pre`."
41+
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
4242
]
4343
},
4444
{

cirq-ft/README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ To install the pre-release version of **cirq-ft**, use
1616

1717
.. code-block:: bash
1818
19-
pip install cirq-ft --pre
19+
pip install cirq-ft~=1.0.dev
2020
2121
2222
2323
Note, that this will install both cirq-ft and cirq-core as well.
2424

2525
To get all the optional **Cirq** modules installed as well, use `pip install cirq` or
26-
`pip install cirq --pre` for the pre-release version.
26+
`pip install cirq~=1.0.dev` for the pre-release version.

cirq-google/README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Installation
2323
------------
2424

2525
To install the stable version of only **cirq-google**, use `pip install cirq-google`.
26-
To install the pre-release version of only **cirq-google**, use `pip install cirq-google --pre`.
26+
To install the pre-release version of only **cirq-google**, use `pip install cirq-google~=1.0.dev`.
2727

2828
Note, that this will install both cirq-google and cirq-core as well.
2929

30-
To get all the optional modules installed as well, you'll have to use `pip install cirq` or `pip install cirq --pre` for the pre-release version.
30+
To get all the optional modules installed as well, you'll have to use `pip install cirq` or `pip install cirq~=1.0.dev` for the pre-release version.

cirq-ionq/README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Installation
2020
------------
2121

2222
To install the stable version of only **cirq-ionq**, use `pip install cirq-ionq`.
23-
To install the pre-release version of only **cirq-ionq**, use `pip install cirq-ionq --pre`.
23+
To install the pre-release version of only **cirq-ionq**, use `pip install cirq-ionq~=1.0.dev`.
2424

2525
Note, that this will install both **cirq-ionq** and **cirq-core**.
2626

27-
To get all the optional modules installed, you'll have to use `pip install cirq` or `pip install cirq --pre` for the pre-release version.
27+
To get all the optional modules installed, you'll have to use `pip install cirq` or `pip install cirq~=1.0.dev` for the pre-release version.

cirq-pasqal/README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Installation
2020
------------
2121

2222
To install the stable version of only **cirq-pasqal**, use `pip install cirq-pasqal`.
23-
To install the pre-release version of only **cirq-pasqal**, use `pip install cirq-pasqal --pre`.
23+
To install the pre-release version of only **cirq-pasqal**, use `pip install cirq-pasqal~=1.0.dev`.
2424

2525
Note, that this will install both **cirq-pasqal** and **cirq-core**.
2626

27-
To get all the optional modules installed, you'll have to use `pip install cirq` or `pip install cirq --pre` for the pre-release version.
27+
To get all the optional modules installed, you'll have to use `pip install cirq` or `pip install cirq~=1.0.dev` for the pre-release version.

cirq-rigetti/README.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Installation
2020
------------
2121

2222
To install the stable version of only **cirq-rigetti**, use `pip install cirq-rigetti`.
23-
To install the pre-release version of only **cirq-rigetti**, use `pip install cirq-rigetti --pre`.
23+
To install the pre-release version of only **cirq-rigetti**, use `pip install cirq-rigetti~=1.0.dev`.
2424

2525
Note, that this will install both **cirq-rigetti** and **cirq-core**.
2626

27-
To get all the optional modules installed, you'll have to use `pip install cirq` or `pip install cirq --pre` for the pre-release version.
27+
To get all the optional modules installed, you'll have to use `pip install cirq` or `pip install cirq~=1.0.dev` for the pre-release version.
2828

2929
Development
3030
------------
3131

32-
Please see Cirq `development documentation <../docs/dev/development.md>`_.
32+
Please see Cirq `development documentation <../docs/dev/development.md>`_.

cirq-web/README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Installation
5555

5656
Cirq-web is currently in development, and therefore is only available via pre-release.
5757

58-
To install the pre-release version of only **cirq-web**, use `pip install cirq-web --pre`.
58+
To install the pre-release version of only **cirq-web**, use `pip install cirq-web~=1.0.dev`.
5959

6060
Note, that this will install both cirq-web and cirq-core.
6161

62-
To get all the optional modules installed as well, you'll have to use `pip install cirq` or `pip install cirq --pre` for the pre-release version.
62+
To get all the optional modules installed as well, you'll have to use `pip install cirq` or `pip install cirq~=1.0.dev` for the pre-release version.

dev_tools/docs/build_api_docs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
In order to publish to our site, devsite runs two jobs for us: stable and nightly.
1818
The stable one downloads the latest cirq release from pypi and uses that to generate the reference
1919
API docs.
20-
The nightly one downloads the latest cirq pre-release (pip install cirq --pre) and uses that to
20+
The nightly one downloads the latest cirq pre-release (pip install cirq~=1.0.dev) and uses that to
2121
generate the "nightly diff".
2222
2323
This script needs to cater for both of these cases.

dev_tools/notebooks/isolated_notebook_test.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def _rewrite_and_run_notebook(notebook_path, cloned_env):
183183
f"notebook (in Github Actions, you can download it from the workflow artifact"
184184
f" 'notebook-outputs'). \n"
185185
f"If this is a new failure in this notebook due to a new change, "
186-
f"that is only available in main for now, consider adding `pip install --pre cirq` "
186+
f"that is only available in main for now, consider adding `pip install cirq~=1.0.dev` "
187187
f"instead of `pip install cirq` to this notebook, and exclude it from "
188188
f"dev_tools/notebooks/isolated_notebook_test.py."
189189
)
@@ -231,10 +231,10 @@ def test_ensure_unreleased_notebooks_install_cirq_pre(notebook_path):
231231
with open(notebook_path, encoding="utf-8") as notebook:
232232
content = notebook.read()
233233
mandatory_matches = [
234-
r"!pip install --quiet cirq(-google)? --pre",
234+
r"!pip install --quiet cirq(-google)?~=1.0.dev",
235235
r"Note: this notebook relies on unreleased Cirq features\. "
236236
r"If you want to try these features, make sure you install cirq(-google)? via "
237-
r"`pip install cirq(-google)? --pre`\.",
237+
r"`pip install cirq(-google)?~=1.0.dev`\.",
238238
]
239239

240240
for m in mandatory_matches:

docs/dev/notebooks.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ You should configure notebooks differently depending on whether they rely on fea
7777

7878
When you introduce a notebook that depends on pre-release features of Cirq, make sure to
7979

80-
- mark the notebook at the top that `Note: this notebook relies on unreleased Cirq features. If you want to try these feature, make sure you install cirq via pip install cirq --pre`.
80+
- mark the notebook at the top that `Note: this notebook relies on unreleased Cirq features. If you want to try these feature, make sure you install cirq via pip install cirq~=1.0.dev`.
8181
- use `pip install cirq —pre` in the installation instructions
8282
- make sure [notebook_test.py](https://github.com/quantumlib/Cirq/blob/main/dev_tools/notebooks/notebook_test.py) covers the notebook
8383
- exclude the notebook from the [isolated_notebook_test.py](https://github.com/quantumlib/Cirq/blob/main/dev_tools/notebooks/isolated_notebook_test.py) by adding it to `NOTEBOOKS_DEPENDING_ON_UNRELEASED_FEATURES`
8484

8585
### Stable notebooks
8686

8787
When you introduce a notebook that only uses already released features of Cirq, make sure to
88-
- use `pip install cirq` (NOT `pip install cirq --pre`)
88+
- use `pip install cirq` (NOT `pip install cirq~=1.0.dev`)
8989
- ensure the notebook is not excluded from either [notebook_test.py](https://github.com/quantumlib/Cirq/blob/main/dev_tools/notebooks/notebook_test.py) or [isolated_notebook_test.py](https://github.com/quantumlib/Cirq/blob/main/dev_tools/notebooks/isolated_notebook_test.py) (except if the notebook has external dependencies, in which case you should exclude this from both!)
9090

9191
### Release

docs/gatezoo.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
},
6262
"source": [
6363
"## Setup\n",
64-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq --pre`"
64+
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`"
6565
]
6666
},
6767
{
@@ -76,7 +76,7 @@
7676
" import cirq\n",
7777
"except ImportError:\n",
7878
" print(\"installing cirq...\")\n",
79-
" !pip install --quiet --pre cirq\n",
79+
" !pip install --quiet cirq~=1.0.dev\n",
8080
" print(\"installed cirq.\")\n",
8181
" \n",
8282
"import IPython.display as ipd\n",

docs/google/qubit-placement.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"# Qubit Placement\n",
4141
"\n",
4242
"This notebooks walks through qubit placement runtime features exposed through the `cirq_google.workflow` tools.",
43-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq --pre`."
43+
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
4444
]
4545
},
4646
{
@@ -78,7 +78,7 @@
7878
"except ImportError:\n",
7979
" print(\"installing cirq...\")\n",
8080
" # This depends on unreleased (as of 1.14) qubit placement functions.\n",
81-
" !pip install --quiet cirq --pre\n",
81+
" !pip install --quiet cirq~=1.0.dev\n",
8282
" print(\"installed cirq.\")\n",
8383
" import cirq"
8484
]

docs/named_topologies.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"id": "ea381f53cf89"
7171
},
7272
"source": [
73-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq --pre`."
73+
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
7474
]
7575
},
7676
{
@@ -85,7 +85,7 @@
8585
" import cirq\n",
8686
"except ImportError:\n",
8787
" print(\"installing cirq...\")\n",
88-
" !pip install --quiet cirq --pre\n",
88+
" !pip install --quiet cirq~=1.0.dev\n",
8989
" print(\"installed cirq.\")\n",
9090
" \n",
9191
"import cirq"

docs/noise/calibration_api.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
},
8181
"source": [
8282
"## Setup\n",
83-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq --pre`."
83+
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
8484
]
8585
},
8686
{
@@ -103,7 +103,7 @@
103103
" import cirq\n",
104104
"except ImportError:\n",
105105
" print(\"installing cirq...\")\n",
106-
" !pip install --quiet cirq --pre\n",
106+
" !pip install --quiet cirq~=1.0.dev\n",
107107
" print(\"installed cirq.\")\n",
108108
" import cirq\n",
109109
"print(\"Using cirq version\", cirq.__version__)"

docs/noise/floquet_calibration_example.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
},
8181
"source": [
8282
"## Setup\n",
83-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq --pre`."
83+
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
8484
]
8585
},
8686
{
@@ -106,7 +106,7 @@
106106
" import cirq\n",
107107
"except ImportError:\n",
108108
" print(\"installing cirq...\")\n",
109-
" !pip install --quiet cirq --pre\n",
109+
" !pip install --quiet cirq~=1.0.dev\n",
110110
" print(\"installed cirq.\")\n",
111111
" import cirq\n",
112112
"print(\"Using cirq version\", cirq.__version__)"

docs/noise/qcvv/parallel_xeb.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
" import cirq\n",
6666
"except ImportError:\n",
6767
" print(\"installing cirq...\")\n",
68-
" !pip install --quiet cirq --pre\n",
68+
" !pip install --quiet cirq~=1.0.dev\n",
6969
" print(\"installed cirq.\")"
7070
]
7171
},

docs/noise/qcvv/xeb_calibration_example.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"source": [
9191
"## Setup\n",
9292
"\n",
93-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq --pre`."
93+
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
9494
]
9595
},
9696
{
@@ -116,7 +116,7 @@
116116
"try:\n",
117117
" import cirq\n",
118118
"except ImportError:\n",
119-
" !pip install --quiet cirq --pre"
119+
" !pip install --quiet cirq~=1.0.dev"
120120
]
121121
},
122122
{

docs/simulate/qvm_stabilizer_example.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@
504504
},
505505
"outputs": [],
506506
"source": [
507-
"!pip install -q cirq-web --pre\n",
507+
"!pip install -q cirq-web~=1.0.dev\n",
508508
"import cirq_web\n",
509509
"\n",
510510
"circuit_vis = cirq_web.Circuit3D(stabilizer_grid_circuit)\n",

docs/start/intro.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"> Different notebook execution systems exist, but for most part they have \"run\" button on a cell which you can click, or \"shift + enter\" is often the shortcut to run the cell. \n",
8686
"\n",
8787
"\n",
88-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq --pre`.\n"
88+
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`.\n"
8989
]
9090
},
9191
{
@@ -100,7 +100,7 @@
100100
" import cirq\n",
101101
"except ImportError:\n",
102102
" print(\"installing cirq...\")\n",
103-
" !pip install --quiet cirq --pre\n",
103+
" !pip install --quiet cirq~=1.0.dev\n",
104104
" print(\"installed cirq.\")\n",
105105
" import cirq\n",
106106
"\n",

docs/transform/routing_transformer.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
},
7171
"source": [
7272
"## Setup\n",
73-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq --pre`."
73+
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
7474
]
7575
},
7676
{
@@ -85,7 +85,7 @@
8585
" import cirq\n",
8686
"except ImportError:\n",
8787
" print(\"installing cirq...\")\n",
88-
" !pip install --quiet cirq --pre\n",
88+
" !pip install --quiet cirq~=1.0.dev\n",
8989
" import cirq\n",
9090
"\n",
9191
" print(\"installed cirq.\")"

docs/tutorials/google/colab.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
},
7070
"source": [
7171
"## Setup\n",
72-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq --pre`."
72+
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
7373
]
7474
},
7575
{
@@ -85,7 +85,7 @@
8585
" import cirq_google\n",
8686
"except ImportError:\n",
8787
" print(\"installing cirq...\")\n",
88-
" !pip install --quiet cirq-google --pre\n",
88+
" !pip install --quiet cirq-google~=1.0.dev\n",
8989
" print(\"installed cirq.\")\n",
9090
" import cirq\n",
9191
" import cirq_google"
@@ -158,7 +158,7 @@
158158
"\n",
159159
"For details of authentication and installation, please see [Get started with Quantum Computing Service](start.ipynb).\n",
160160
"\n",
161-
"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",
161+
"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 cirq~=1.0.dev` instead of `pip install cirq` to get the most up-to-date features of Cirq.\n",
162162
"\n",
163163
"1. Enter the Cloud project ID you'd like to use in the `project_id` field.\n",
164164
"2. Then run the cell below (and go through the auth flow for access to the project id you entered).\n",

0 commit comments

Comments
 (0)