Skip to content

Commit 57f17ce

Browse files
HeyshubhamShubham Agrawalpavoljuhas
authored
Documentation: Improve virtualenvwrapper setup instructions for new contributors (#7741)
Fixes #7739 --------- Co-authored-by: Shubham Agrawal <[email protected]> Co-authored-by: Pavol Juhas <[email protected]>
1 parent ea7c94e commit 57f17ce

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

docs/dev/development.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,24 @@ package manager.
8585

8686
There are some extra steps if Protocol Buffers are changed; see the next section.
8787

88-
2. Prepare a Python virtual environment that includes the Cirq dev tools (such as Mypy).
88+
2. Setup virtualenvwrapper
8989

90-
One of the system dependencies we installed was `virtualenvwrapper`, which makes it easy to create virtual environments.
91-
If you did not have `virtualenvwrapper` previously, you may need to re-open your terminal or run `source ~/.bashrc` before these commands will work:
90+
One of the system dependencies we installed was `virtualenvwrapper`, which makes it easy to
91+
create virtual environments. If you did not have `virtualenvwrapper` previously, then to
92+
complete the setup of virtualenvwrapper, the following lines must be added to your ~/.bashrc or
93+
~/.zshrc file. Once the file is saved, you will need to either open a new terminal session or
94+
execute `source ~/.bashrc` to activate the new configuration.
95+
96+
```bash
97+
export WORKON_HOME=$HOME/.virtualenvs
98+
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
99+
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
100+
```
101+
102+
For a complete reference see the [virtualenvwrapper documentation](
103+
https://virtualenvwrapper.readthedocs.io).
104+
105+
3. Prepare a Python virtual environment that includes the Cirq dev tools (such as Mypy).
92106

93107
```bash
94108
mkvirtualenv cirq-py3 --python=/usr/bin/python3
@@ -102,13 +116,13 @@ package manager.
102116
**Note**: Some highly managed or customized devices have configurations that interfere with `virtualenv`.
103117
In that case, [anaconda](https://www.anaconda.com/) environments may be a better choice.
104118

105-
3. Check that the tests pass.
119+
4. Check that the tests pass.
106120

107121
```bash
108122
./check/pytest .
109123
```
110124

111-
4. (**OPTIONAL**) include your development copy of Cirq and its subpackages in your Python path.
125+
5. (**OPTIONAL**) include your development copy of Cirq and its subpackages in your Python path.
112126

113127
```bash
114128
source dev_tools/pypath

0 commit comments

Comments
 (0)