Skip to content

Commit 3fe2f95

Browse files
committedJan 29, 2017
always use 'venv' as virtualenv folder
1 parent f570c57 commit 3fe2f95

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed
 

‎README.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ To get started hacking on mitmproxy, please follow the `advanced installation`_
6969
./dev.sh # "powershell .\dev.ps1" on Windows
7070
7171
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
7575
"editable", so any changes to the source in the repository will be reflected
7676
live in the virtualenv.
7777

@@ -82,7 +82,7 @@ you can run them like any other command:
8282

8383
.. code-block:: text
8484
85-
. venv3.5/bin/activate # "venv\Scripts\activate" on Windows
85+
. venv/bin/activate # "venv\Scripts\activate" on Windows
8686
mitmdump --version
8787
8888
Testing

‎dev.ps1

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
$ErrorActionPreference = "Stop"
2-
$VENV = ".\venv"
32

43
$pyver = python --version
54
if($pyver -notmatch "3\.[5-9]") {
65
Write-Warning "Unexpected Python version, expected Python 3.5 or above: $pyver"
76
}
87

9-
python -m venv $VENV --copies
10-
& $VENV\Scripts\activate.ps1
8+
python -m venv .\venv --copies
9+
& .\venv\Scripts\activate.ps1
1110

1211
python -m pip install --disable-pip-version-check -U pip
1312
cmd /c "pip install -r requirements.txt 2>&1"
1413

1514
echo @"
1615
17-
* Created virtualenv environment in $VENV.
16+
* Created virtualenv environment in .\venv.
1817
* Installed all dependencies into the virtualenv.
1918
* Activated virtualenv environment.
2019

‎dev.sh

+8-10
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
set -e
33
set -x
44

5-
PYVERSION=${1:-3.5}
6-
VENV="venv$PYVERSION"
5+
echo "Creating dev environment in ./venv..."
76

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
1411

1512
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\`"

0 commit comments

Comments
 (0)
Please sign in to comment.