GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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
Filter options
  • README.rst
  • dev.ps1
  • dev.sh
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎README.rst‎

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 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
Collapse file

‎dev.ps1‎

Copy file name to clipboardExpand all lines: dev.ps1
+3-4Lines changed: 3 additions & 4 deletions
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
Collapse file

‎dev.sh‎

Copy file name to clipboardExpand all lines: dev.sh
+8-10Lines changed: 8 additions & 10 deletions
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 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.