-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_pip.sh
executable file
·32 lines (27 loc) · 1.08 KB
/
test_pip.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
uninstall_packages() {
pip freeze | grep -v "^uv==" | grep -v '\-e' | xargs pip uninstall -y -q
}
pip cache purge
echo "--------------------------------------------"
echo "Public PYPI PROXY"
time pip install -q --index-url https://pypi.org/simple/ -r requirements.txt
uninstall_packages
echo "Reinstall"
time pip install -q --index-url https://pypi.org/simple/ -r requirements.txt
uninstall_packages
echo "--------------------------------------------"
echo "LOCAL PYPI PROXY (keep cache-control header)"
time pip install -q --index-url http://localhost:8000/cached/ -r requirements.txt
uninstall_packages
echo "Reinstall"
time pip install --index-url http://localhost:8000/cached/ -r requirements.txt
uninstall_packages
echo "--------------------------------------------"
echo "LOCAL PYPI PROXY (cache-control: no-cache)"
time pip install -q --index-url http://localhost:8000/no_cache/ -r requirements.txt
uninstall_packages
echo "Reinstall"
# This is the command which has slow Resolve
time pip install --index-url http://localhost:8000/no_cache/ -r requirements.txt
uninstall_packages