From 12a36abf63c29b05dda870b6ce6e6b47db542b62 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Mon, 9 Jul 2018 13:32:59 -0400 Subject: [PATCH] Attempt to have a cached wheelhouse for pip --- .circleci/config.yml | 30 +++++++++++++++++++++++++++++- .circleci/setup-virtualenv.sh | 3 +++ tox.ini | 2 +- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8e68126bf..ad9f2de2a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,7 +63,11 @@ jobs: # Select a tox environment to run for this job. TAHOE_LAFS_TOX_ENVIRONMENT: "coverage" # Additional arguments to pass to tox. - TAHOE_LAFS_TOX_ARGS: "" + TAHOE_LAFS_TOX_ARGS: "allmydata.test.cli.test_daemonize" + # Convince all of our pip invocations to look at the cached wheelhouse + # we maintain. + WHEELHOUSE_PATH: &WHEELHOUSE_PATH "/tmp/wheelhouse" + PIP_FIND_LINKS: "file:///tmp/wheelhouse" steps: - run: &INSTALL_GIT @@ -74,6 +78,19 @@ jobs: - "checkout" + - restore_cache: &RESTORE_HTTP_CACHE + keys: + - v1-pip-http-{{ .Branch }}-{{ checksum "setup.py" }}-{{ checksum "src/allmydata/_auto_deps.py" }} + - v1-pip-http-{{ .Branch }} + - v1-pip-http- + + - restore_cache: &RESTORE_WHEELHOUSE + keys: + - v1-wheelhouse-{{ .arch }}-{{ .Branch }}-{{ checksum "setup.py" }}-{{ checksum "src/allmydata/_auto_deps.py" }} + - v1-wheelhouse-{{ .arch }}-{{ .Branch }} + - v1-wheelhouse-{{ .arch }} + - v1-wheelhouse- + - run: &BOOTSTRAP_TEST_ENVIRONMENT name: "Bootstrap test environment" command: | @@ -89,6 +106,17 @@ jobs: "${TAHOE_LAFS_TOX_ENVIRONMENT}" \ "${TAHOE_LAFS_TOX_ARGS}" + - save_cache: &SAVE_HTTP_CACHE + key: v1-pip-http-{{ .Branch }}-{{ checksum "setup.py" }}-{{ checksum "src/allmydata/_auto_deps.py" }} + paths: + # Perfectly valid for Linux. + - "/tmp/nobody/.cache/pip" + + - save_cache: &SAVE_WHEELHOUSE + key: v1-wheelhouse-{{ .arch }}-{{ .Branch }}-{{ checksum "setup.py" }}-{{ checksum "src/allmydata/_auto_deps.py" }} + paths: + - *WHEELHOUSE_PATH + - run: &RUN_TESTS name: "Run test suite" # Something about when it re-uses an existing environment blows up diff --git a/.circleci/setup-virtualenv.sh b/.circleci/setup-virtualenv.sh index 0df230de6..dcd9ff812 100755 --- a/.circleci/setup-virtualenv.sh +++ b/.circleci/setup-virtualenv.sh @@ -10,6 +10,9 @@ shift || : # non-root user. See below. sudo --set-home -u nobody virtualenv --python python2.7 /tmp/tests +# Populate the wheelhouse, if necessary. +/tmp/tests/bin/pip wheel --wheel-dir "${WHEELHOUSE_PATH}" /tmp/project + # Get "certifi" to avoid bug #2913. Basically if a `setup_requires=...` causes # a package to be installed (with setuptools) then it'll fail on certain # platforms (travis's OX-X 10.12, Slackware 14.2) because PyPI's TLS diff --git a/tox.ini b/tox.ini index f7a7f96b3..5a08728f8 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ skipsdist = True [testenv] basepython=python2.7 -passenv = TAHOE_LAFS_* SUBUNITREPORTER_* USERPROFILE HOMEDRIVE HOMEPATH +passenv = TAHOE_LAFS_* PIP_* SUBUNITREPORTER_* USERPROFILE HOMEDRIVE HOMEPATH # Get "certifi" to avoid bug #2913. Basically if a `setup_requires=...` causes # a package to be installed (with setuptools) then it'll fail on certain # platforms (travis's OX-X 10.12, Slackware 14.2) because PyPI's TLS