From 9311f268c1159430a12f64a631fc135f15607970 Mon Sep 17 00:00:00 2001 From: Jeremy Bowman Date: Tue, 19 Jun 2018 15:09:11 -0400 Subject: [PATCH] TE-2593 Make pip-compile output whitespace consistent --- Makefile | 17 +++++++++-------- requirements/edx-sandbox/base.txt | 1 - requirements/edx-sandbox/shared.txt | 1 - requirements/edx/base.txt | 3 +-- requirements/edx/coverage.txt | 1 - requirements/edx/development.txt | 9 ++++----- requirements/edx/paver.txt | 1 - requirements/edx/pip-tools.txt | 1 - requirements/edx/testing.txt | 7 +++---- scripts/post-pip-compile.sh | 16 +++------------- 10 files changed, 20 insertions(+), 37 deletions(-) diff --git a/Makefile b/Makefile index 7a3f218f53..2667e6e37c 100644 --- a/Makefile +++ b/Makefile @@ -38,17 +38,18 @@ pull_translations: ## pull translations from Transifex requirements: ## install development environment requirements pip install -qr requirements/edx/development.txt --exists-action w +upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade upgrade: ## update the pip requirements files to use the latest releases satisfying our constraints pip install -qr requirements/edx/pip-tools.txt # Make sure to compile files after any other files they include! - pip-compile --upgrade -o requirements/edx/pip-tools.txt requirements/edx/pip-tools.in - pip-compile --upgrade -o requirements/edx/coverage.txt requirements/edx/coverage.in - pip-compile --upgrade -o requirements/edx/paver.txt requirements/edx/paver.in - pip-compile --upgrade -o requirements/edx-sandbox/shared.txt requirements/edx-sandbox/shared.in - pip-compile --upgrade -o requirements/edx-sandbox/base.txt requirements/edx-sandbox/base.in - pip-compile --upgrade -o requirements/edx/base.txt requirements/edx/base.in - pip-compile --upgrade -o requirements/edx/testing.txt requirements/edx/testing.in - pip-compile --upgrade -o requirements/edx/development.txt requirements/edx/development.in + pip-compile --no-emit-trusted-host --no-index --upgrade -o requirements/edx/pip-tools.txt requirements/edx/pip-tools.in + pip-compile --no-emit-trusted-host --no-index --upgrade -o requirements/edx/coverage.txt requirements/edx/coverage.in + pip-compile --no-emit-trusted-host --no-index --upgrade -o requirements/edx/paver.txt requirements/edx/paver.in + pip-compile --no-emit-trusted-host --no-index --upgrade -o requirements/edx-sandbox/shared.txt requirements/edx-sandbox/shared.in + pip-compile --no-emit-trusted-host --no-index --upgrade -o requirements/edx-sandbox/base.txt requirements/edx-sandbox/base.in + pip-compile --no-emit-trusted-host --no-index --upgrade -o requirements/edx/base.txt requirements/edx/base.in + pip-compile --no-emit-trusted-host --no-index --upgrade -o requirements/edx/testing.txt requirements/edx/testing.in + pip-compile --no-emit-trusted-host --no-index --upgrade -o requirements/edx/development.txt requirements/edx/development.in # Post process all of the files generated above to work around open pip-tools issues scripts/post-pip-compile.sh \ requirements/edx/pip-tools.txt \ diff --git a/requirements/edx-sandbox/base.txt b/requirements/edx-sandbox/base.txt index e961524518..d505492821 100644 --- a/requirements/edx-sandbox/base.txt +++ b/requirements/edx-sandbox/base.txt @@ -4,7 +4,6 @@ # # make upgrade # - common/lib/calc common/lib/chem common/lib/sandbox-packages diff --git a/requirements/edx-sandbox/shared.txt b/requirements/edx-sandbox/shared.txt index 9967096c8c..9c112a860a 100644 --- a/requirements/edx-sandbox/shared.txt +++ b/requirements/edx-sandbox/shared.txt @@ -4,7 +4,6 @@ # # make upgrade # - -e common/lib/calc -e common/lib/chem -e common/lib/sandbox-packages diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index 9cf6de7159..f53281443b 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -4,7 +4,6 @@ # # make upgrade # - -e git+https://github.com/edx/acid-block.git@e46f9cda8a03e121a00c7e347084d142d22ebfb7#egg=acid-xblock -e common/lib/calc -e common/lib/capa @@ -93,7 +92,7 @@ django-require==1.0.11 django-rest-swagger==2.2.0 django-sekizai==0.10.0 django-ses==0.8.4 -django-simple-history==2.1.0 +django-simple-history==2.1.1 django-splash==0.2.2 django-statici18n==1.4.0 django-storages==1.4.1 diff --git a/requirements/edx/coverage.txt b/requirements/edx/coverage.txt index c721171b43..2ee1172486 100644 --- a/requirements/edx/coverage.txt +++ b/requirements/edx/coverage.txt @@ -4,7 +4,6 @@ # # make upgrade # - coverage==4.2 diff-cover==0.9.8 inflect==0.3.1 # via jinja2-pluralize diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index 389955e92b..d2242f6ff1 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -4,7 +4,6 @@ # # make upgrade # - -e git+https://github.com/edx/acid-block.git@e46f9cda8a03e121a00c7e347084d142d22ebfb7#egg=acid-xblock -e common/lib/calc -e common/lib/capa @@ -44,7 +43,7 @@ git+https://github.com/edx-solutions/xblock-drag-and-drop-v2@v2.1.6#egg=xblock-d git+https://github.com/open-craft/xblock-poll@add89e14558c30f3c8dc7431e5cd6536fff6d941#egg=xblock-poll==1.5.1 git+https://github.com/edx/xblock-utils.git@v1.1.1#egg=xblock-utils==1.1.1 -e common/lib/xmodule -alabaster==0.7.10 # via sphinx +alabaster==0.7.11 # via sphinx amqp==1.4.9 analytics-python==1.1.0 anyjson==0.3.3 @@ -113,7 +112,7 @@ django-require==1.0.11 django-rest-swagger==2.2.0 django-sekizai==0.10.0 django-ses==0.8.4 -django-simple-history==2.1.0 +django-simple-history==2.1.1 django-splash==0.2.2 django-statici18n==1.4.0 django-storages==1.4.1 @@ -156,7 +155,7 @@ event-tracking==0.2.4 execnet==1.5.0 extras==1.0.0 factory_boy==2.8.1 -faker==0.8.15 +faker==0.8.16 feedparser==5.1.3 firebase-token-generator==1.3.2 first==2.0.1 @@ -316,7 +315,7 @@ sqlparse==0.2.4 # via django-debug-toolbar stevedore==1.10.0 sure==1.4.11 sympy==0.7.1 -testfixtures==6.1.0 +testfixtures==6.2.0 testtools==2.3.0 text-unidecode==1.2 tox-battery==0.5.1 diff --git a/requirements/edx/paver.txt b/requirements/edx/paver.txt index 697c166940..9a6a6a4b3e 100644 --- a/requirements/edx/paver.txt +++ b/requirements/edx/paver.txt @@ -4,7 +4,6 @@ # # make upgrade # - argh==0.26.2 # via watchdog argparse==1.4.0 # via stevedore edx-opaque-keys==0.4.4 diff --git a/requirements/edx/pip-tools.txt b/requirements/edx/pip-tools.txt index 44aa65b2a3..e7027f3fb2 100644 --- a/requirements/edx/pip-tools.txt +++ b/requirements/edx/pip-tools.txt @@ -4,7 +4,6 @@ # # make upgrade # - click==6.7 # via pip-tools first==2.0.1 # via pip-tools pip-tools==2.0.2 diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index d2024b5f30..9f557b6990 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -4,7 +4,6 @@ # # make upgrade # - -e git+https://github.com/edx/acid-block.git@e46f9cda8a03e121a00c7e347084d142d22ebfb7#egg=acid-xblock -e common/lib/calc -e common/lib/capa @@ -109,7 +108,7 @@ django-require==1.0.11 django-rest-swagger==2.2.0 django-sekizai==0.10.0 django-ses==0.8.4 -django-simple-history==2.1.0 +django-simple-history==2.1.1 django-splash==0.2.2 django-statici18n==1.4.0 django-storages==1.4.1 @@ -150,7 +149,7 @@ event-tracking==0.2.4 execnet==1.5.0 # via pytest-xdist extras==1.0.0 # via python-subunit, testtools factory_boy==2.8.1 -faker==0.8.15 # via factory-boy +faker==0.8.16 # via factory-boy feedparser==5.1.3 firebase-token-generator==1.3.2 fixtures==3.0.0 # via testtools @@ -300,7 +299,7 @@ splinter==0.8.0 stevedore==1.10.0 sure==1.4.11 sympy==0.7.1 -testfixtures==6.1.0 +testfixtures==6.2.0 testtools==2.3.0 # via fixtures, python-subunit text-unidecode==1.2 # via faker tox-battery==0.5.1 diff --git a/scripts/post-pip-compile.sh b/scripts/post-pip-compile.sh index a317874efd..4706290c3d 100755 --- a/scripts/post-pip-compile.sh +++ b/scripts/post-pip-compile.sh @@ -1,25 +1,19 @@ #!/usr/bin/env bash set -e -# Remove any cruft from a requirements file generated by pip-tools which we don't want to keep +# Remove any cruft from a requirements file generated by pip-compile which we don't want to keep function show_help { echo "Usage: post-pip-compile.sh file ..." echo "Remove any cruft left behind by pip-compile in the given requirements file(s)." echo "" - echo "Removes devstack-specific pip options and \"-e\" prefixes which were" - echo "added to GitHub URLs only so that pip-compile could process them" - echo "correctly." + echo "Removes \"-e\" prefixes which were added to GitHub URLs only so that" + echo "pip-compile could process them correctly." } function clean_file { FILE_PATH=$1 TEMP_FILE=${FILE_PATH}.tmp - # pip-compile captures the devpi-related settings from devstack's pip.conf, remove them - sed '/^--index-url/d' ${FILE_PATH} > ${TEMP_FILE} - mv ${TEMP_FILE} ${FILE_PATH} - sed '/^--trusted-host/d' ${FILE_PATH} > ${TEMP_FILE} - mv ${TEMP_FILE} ${FILE_PATH} # If an editable VCS URL has a version number suffix, it was only editable for pip-compile's benefit; # this is a workaround for https://github.com/jazzband/pip-tools/issues/355 sed 's/-e \(.*==.*\)/\1/' ${FILE_PATH} > ${TEMP_FILE} @@ -42,10 +36,6 @@ function clean_file { sed "s|-e common/lib/|common/lib/|" ${FILE_PATH} > ${TEMP_FILE} mv ${TEMP_FILE} ${FILE_PATH} fi - # Replace the instructions for regenerating the output file. - INPUT_FILE=${FILE_PATH/\.txt/\.in} - sed "s/pip-compile --output-file.*/make upgrade/" ${FILE_PATH} > ${TEMP_FILE} - mv ${TEMP_FILE} ${FILE_PATH} } for i in "$@"; do