forked from freedomofpress/securedrop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpip_update.sh
executable file
·36 lines (27 loc) · 1019 Bytes
/
pip_update.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
33
34
35
36
#!/bin/bash
# Usage: ./pip_update.sh
# Run periodically to keep Python requirements up-to-date
set -e
cd `dirname $0`/securedrop/requirements
# This method is slow, because we have to:
# 1. Download all of the packages listed in *requirements.txt
# 2. Download any updated versions of these packages
# Unfortunately, it is the only way I have been able to get `pip-dump` to work.
sudo apt-get install python-pip
# Create a temporary virtualenv for the SecureDrop Python packages
#
# If we `pip-review --auto` the global pip packages, we will also get
# packages that are installed as part of Ubuntu/the Vagrant base
# image, which are not SecureDrop dependencies.
VENV=review_env
virtualenv $VENV
source $VENV/bin/activate
# Install the requirements from the current lists
pip install -r securedrop-requirements.txt
pip install -r test-requirements.txt
# Auto-install updated packages
pip-review --auto
# Dump updated version numbers to *requirements.txt
pip-dump
# Remove the temporary virtualenv
rm -r $VENV