mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-29 02:57:19 +00:00
Refactor dev.sh
- Parameterise the Python version. All of these now work: ./dev.sh # Use default Python version ./dev.sh 2.7 # Explicitly use 2.7 in venv2.7 ./dev.sh 3.5 # Explicitly use 3.5 in venv3.5 This should also work for Travis, which has a weird setup where Pytho3 can be 3.4.
This commit is contained in:
parent
bcfce32bfa
commit
f7e77d543b
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,8 +1,7 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
MANIFEST
|
MANIFEST
|
||||||
*/tmp
|
*/tmp
|
||||||
/venv
|
/venv*
|
||||||
/venv3
|
|
||||||
*.py[cdo]
|
*.py[cdo]
|
||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
|
29
dev.sh
29
dev.sh
@ -1,29 +1,16 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
VENV="./venv"
|
PYVERSION=$1
|
||||||
VENV3="${VENV}3"
|
VENV="venv$1"
|
||||||
|
|
||||||
python -m virtualenv $VENV --always-copy
|
echo "Creating dev environment in $VENV using Python $PYVERSION"
|
||||||
. $VENV/bin/activate
|
|
||||||
pip install -q -U pip setuptools
|
python$PYVERSION -m virtualenv "$VENV" --always-copy
|
||||||
pip install -q -r requirements.txt
|
. "$VENV/bin/activate"
|
||||||
|
pip$PYVERSION install -q -U pip setuptools
|
||||||
|
pip$PYVERSION install -q -r requirements.txt
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "* Virtualenv created in $VENV and all dependencies installed."
|
echo "* Virtualenv created in $VENV and all dependencies installed."
|
||||||
echo "* You can now activate the $(python --version) virtualenv with this command: \`. $VENV/bin/activate\`"
|
echo "* You can now activate the $(python --version) virtualenv with this command: \`. $VENV/bin/activate\`"
|
||||||
|
|
||||||
if $(python --version 2>&1 | grep -q "Python 2.") && command -v python3 >/dev/null 2>&1; then
|
|
||||||
echo ""
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
python3 -m virtualenv "$VENV3" --always-copy
|
|
||||||
. "$VENV3/bin/activate"
|
|
||||||
pip install -q -U pip setuptools
|
|
||||||
pip install -q -r requirements.txt
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "* Virtualenv created in $VENV3 and all dependencies installed."
|
|
||||||
echo "* You can now activate the $(python --version) virtualenv with this command: \`. $VENV3/bin/activate\`"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
@ -3,4 +3,4 @@ Starting up
|
|||||||
|
|
||||||
- npm install
|
- npm install
|
||||||
- gulp
|
- gulp
|
||||||
- run mitmweb and open http://localhost:8081/
|
- run mitmweb and open http://localhost:8081/
|
||||||
|
Loading…
Reference in New Issue
Block a user