GeezerVison is showing github.com — always use 'venv' as virtualenv folder · python-D/mitmproxy@3fe2f95
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: README.rst +4-4Lines changed: 4 additions & 4 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -69,9 +69,9 @@ To get started hacking on mitmproxy, please follow the `advanced installation`_ |
69 | 69 | ./dev.sh # "powershell .\dev.ps1" on Windows |
70 | 70 |
|
71 | 71 |
|
72 | | -The *dev* script will create a `virtualenv`_ environment in a directory called |
73 | | -"venv3.5", and install all mandatory and optional dependencies into it. The |
74 | | -primary mitmproxy components - mitmproxy and pathod - are installed as |
| 72 | +The *dev* script will create a `virtualenv`_ environment in a directory called "venv" |
| 73 | +and install all mandatory and optional dependencies into it. The primary |
| 74 | +mitmproxy components - mitmproxy and pathod - are installed as |
75 | 75 | "editable", so any changes to the source in the repository will be reflected |
76 | 76 | live in the virtualenv. |
77 | 77 |
|
@@ -82,7 +82,7 @@ you can run them like any other command: |
82 | 82 |
|
83 | 83 | .. code-block:: text |
84 | 84 |
|
85 | | - . venv3.5/bin/activate # "venv\Scripts\activate" on Windows |
| 85 | + . venv/bin/activate # "venv\Scripts\activate" on Windows |
86 | 86 | mitmdump --version |
87 | 87 |
|
88 | 88 | Testing |
|
Collapse file
Copy file name to clipboardExpand all lines: dev.ps1 +3-4Lines changed: 3 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | $ErrorActionPreference = "Stop" |
2 | | -$VENV = ".\venv" |
3 | 2 |
|
4 | 3 | $pyver = python --version |
5 | 4 | if($pyver -notmatch "3\.[5-9]") { |
6 | 5 | Write-Warning "Unexpected Python version, expected Python 3.5 or above: $pyver" |
7 | 6 | } |
8 | 7 |
|
9 | | -python -m venv $VENV --copies |
10 | | -& $VENV\Scripts\activate.ps1 |
| 8 | +python -m venv .\venv --copies |
| 9 | +& .\venv\Scripts\activate.ps1 |
11 | 10 |
|
12 | 11 | python -m pip install --disable-pip-version-check -U pip |
13 | 12 | cmd /c "pip install -r requirements.txt 2>&1" |
14 | 13 |
|
15 | 14 | echo @" |
16 | 15 |
|
17 | | - * Created virtualenv environment in $VENV. |
| 16 | + * Created virtualenv environment in .\venv. |
18 | 17 | * Installed all dependencies into the virtualenv. |
19 | 18 | * Activated virtualenv environment. |
20 | 19 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: dev.sh +8-10Lines changed: 8 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
2 | 2 | set -e |
3 | 3 | set -x |
4 | 4 |
|
5 | | -PYVERSION=${1:-3.5} |
6 | | -VENV="venv$PYVERSION" |
| 5 | +echo "Creating dev environment in ./venv..." |
7 | 6 |
|
8 | | -echo "Creating dev environment in $VENV using Python $PYVERSION" |
9 | | - |
10 | | -python$PYVERSION -m venv "$VENV" |
11 | | -. "$VENV/bin/activate" |
12 | | -pip$PYVERSION install -U pip setuptools |
13 | | -pip$PYVERSION install -r requirements.txt |
| 7 | +python3 -m venv venv |
| 8 | +. venv/bin/activate |
| 9 | +pip3 install -U pip setuptools |
| 10 | +pip3 install -r requirements.txt |
14 | 11 |
|
15 | 12 | echo "" |
16 | | -echo "* Virtualenv created in $VENV and all dependencies installed." |
17 | | -echo "* You can now activate the $(python --version) virtualenv with this command: \`. $VENV/bin/activate\`" |
| 13 | +echo " * Created virtualenv environment in ./venv." |
| 14 | +echo " * Installed all dependencies into the virtualenv." |
| 15 | +echo " * You can now activate the $(python3 --version) virtualenv with this command: \`. venv/bin/activate\`" |