From f5cc228f267de0c3e7b0846a38252409b8c4e749 Mon Sep 17 00:00:00 2001 From: Shubham Agrawal Date: Fri, 7 Nov 2025 07:03:13 +0000 Subject: [PATCH 1/2] Documentation: Improve virtualenvwrapper setup instructions for new contributors --- docs/dev/development.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/dev/development.md b/docs/dev/development.md index cf95f8c1fa5..ce66591de11 100644 --- a/docs/dev/development.md +++ b/docs/dev/development.md @@ -85,10 +85,16 @@ package manager. There are some extra steps if Protocol Buffers are changed; see the next section. -2. Prepare a Python virtual environment that includes the Cirq dev tools (such as Mypy). - One of the system dependencies we installed was `virtualenvwrapper`, which makes it easy to create virtual environments. - If you did not have `virtualenvwrapper` previously, you may need to re-open your terminal or run `source ~/.bashrc` before these commands will work: +2. One of the system dependencies we installed was `virtualenvwrapper`, which makes it easy to create virtual environments. If you did not have `virtualenvwrapper` previously then to complete the setup of virtualenvwrapper, the following lines must be added to your ~/.bashrc or ~/.zshrc file. Once the file is saved, you will need to either open a new terminal session or execute source ~/.bashrc to activate the new configuration. + + ```bash + export WORKON_HOME=$HOME/.virtualenvs + export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 + source /usr/share/virtualenvwrapper/virtualenvwrapper.sh + ``` + +3. Prepare a Python virtual environment that includes the Cirq dev tools (such as Mypy). ```bash mkvirtualenv cirq-py3 --python=/usr/bin/python3 @@ -102,13 +108,13 @@ package manager. **Note**: Some highly managed or customized devices have configurations that interfere with `virtualenv`. In that case, [anaconda](https://www.anaconda.com/) environments may be a better choice. -3. Check that the tests pass. +4. Check that the tests pass. ```bash ./check/pytest . ``` -4. (**OPTIONAL**) include your development copy of Cirq and its subpackages in your Python path. +5. (**OPTIONAL**) include your development copy of Cirq and its subpackages in your Python path. ```bash source dev_tools/pypath From 4889c8cba6fc59acf5eece2ce92fedae7299aee1 Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Wed, 12 Nov 2025 15:08:54 -0800 Subject: [PATCH 2/2] Format for better plain-text readability and add link to virtualenvwrapper docs --- docs/dev/development.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/dev/development.md b/docs/dev/development.md index ce66591de11..a8b4ea4b988 100644 --- a/docs/dev/development.md +++ b/docs/dev/development.md @@ -85,8 +85,13 @@ package manager. There are some extra steps if Protocol Buffers are changed; see the next section. +2. Setup virtualenvwrapper -2. One of the system dependencies we installed was `virtualenvwrapper`, which makes it easy to create virtual environments. If you did not have `virtualenvwrapper` previously then to complete the setup of virtualenvwrapper, the following lines must be added to your ~/.bashrc or ~/.zshrc file. Once the file is saved, you will need to either open a new terminal session or execute source ~/.bashrc to activate the new configuration. + One of the system dependencies we installed was `virtualenvwrapper`, which makes it easy to + create virtual environments. If you did not have `virtualenvwrapper` previously, then to + complete the setup of virtualenvwrapper, the following lines must be added to your ~/.bashrc or + ~/.zshrc file. Once the file is saved, you will need to either open a new terminal session or + execute `source ~/.bashrc` to activate the new configuration. ```bash export WORKON_HOME=$HOME/.virtualenvs @@ -94,6 +99,9 @@ package manager. source /usr/share/virtualenvwrapper/virtualenvwrapper.sh ``` + For a complete reference see the [virtualenvwrapper documentation]( + https://virtualenvwrapper.readthedocs.io). + 3. Prepare a Python virtual environment that includes the Cirq dev tools (such as Mypy). ```bash