From c47920ea2baa5372fa5707d8cdb7127605ad0fc8 Mon Sep 17 00:00:00 2001 From: Semir Patel Date: Thu, 28 Jan 2021 09:05:45 -0800 Subject: [PATCH 1/4] Migration to github actions for CI --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ .travis.yml | 33 --------------------------------- CI/requirements.txt | 5 +++-- venv_update.py | 7 ++++++- 4 files changed, 32 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cd808fa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +--- +name: venv-update-ci +on: push +jobs: + tox: + runs-on: ubuntu-18.04 + strategy: + fail-fast: true + matrix: + toxenv: + - lint + - py36 + - py27 + - pypy + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.6 + - run: pip install tox==3.21.2 + - run: pip install -r CI/requirements.txt + - run: sudo apt-get install -y pypy pypy-dev + - run: tox -e ${{ matrix.toxenv }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 29a700e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -language: python - -matrix: - # notify a failed build as soon as anything fails - fast_finish: true - # In order of most-valuable tests first - include: - - env: TOXENV=lint - python: 3.6 - - env: TOXENV=lint - python: 2.7 - - - env: TOXENV=py36 - python: 3.6 - - env: TOXENV=pypy - python: pypy - - env: TOXENV=py27 - python: 2.7 - - env: TOXENV=latest-pip - python: 3.6 - - allow_failures: - # See #203 - - env: TOXENV=latest-pip - python: 3.6 - -install: ./venv_update.py venv= $VIRTUAL_ENV install= -r CI/requirements.txt -script: tox - -cache: - directories: - - $HOME/.pip - - $HOME/.cache/pre-commit diff --git a/CI/requirements.txt b/CI/requirements.txt index fe705ef..48ad566 100644 --- a/CI/requirements.txt +++ b/CI/requirements.txt @@ -1,3 +1,4 @@ -# minimal set of packages for travis to run our test suites -tox +# minimal set of packages for github actions to run our test suites codecov +tox==3.21.2 +virtualenv<20 diff --git a/venv_update.py b/venv_update.py index 5bfde27..c48a457 100755 --- a/venv_update.py +++ b/venv_update.py @@ -272,7 +272,11 @@ def invalid_virtualenv_reason(venv_path, source_python, destination_python, opti if not samefile(orig_path, venv_path): return 'virtualenv moved {} -> {}'.format(timid_relpath(orig_path), timid_relpath(venv_path)) elif has_system_site_packages(destination_python) != options.system_site_packages: - return 'system-site-packages changed, to %s' % options.system_site_packages + info('XXX venv_path=%s' % venv_path) + info('XXX source_python=%s' % source_python) + info('XXX destination_python=%s' % destination_python) + info('XXX options=%s' % options) + return 'system-site-packages for changed, to %s' % options.system_site_packages if source_python is None: return @@ -285,6 +289,7 @@ def invalid_virtualenv_reason(venv_path, source_python, destination_python, opti def ensure_virtualenv(args, return_values): """Ensure we have a valid virtualenv.""" def adjust_options(options, args): + info('XXX options: %s' % options) # TODO-TEST: proper error message with no arguments venv_path = return_values.venv_path = args[0] From e0035ba96dfe521cdb8d04374ac12c010f9ab180 Mon Sep 17 00:00:00 2001 From: Semir Patel Date: Thu, 28 Jan 2021 11:29:50 -0800 Subject: [PATCH 2/4] Disable fail fast --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd808fa..05940cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ jobs: tox: runs-on: ubuntu-18.04 strategy: - fail-fast: true + fail-fast: false matrix: toxenv: - lint From 524945fe350f56d6f0315577f69ee22901ff3d89 Mon Sep 17 00:00:00 2001 From: Semir Patel Date: Thu, 28 Jan 2021 11:35:57 -0800 Subject: [PATCH 3/4] Restore original error msg --- venv_update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/venv_update.py b/venv_update.py index 8bdb99d..5bfde27 100755 --- a/venv_update.py +++ b/venv_update.py @@ -272,7 +272,7 @@ def invalid_virtualenv_reason(venv_path, source_python, destination_python, opti if not samefile(orig_path, venv_path): return 'virtualenv moved {} -> {}'.format(timid_relpath(orig_path), timid_relpath(venv_path)) elif has_system_site_packages(destination_python) != options.system_site_packages: - return 'system-site-packages for changed, to %s' % options.system_site_packages + return 'system-site-packages changed, to %s' % options.system_site_packages if source_python is None: return From e4a093332a18c8de3708386869f81b42735426aa Mon Sep 17 00:00:00 2001 From: Semir Patel Date: Thu, 28 Jan 2021 11:57:48 -0800 Subject: [PATCH 4/4] Remove last remnants of travis ci --- README.md | 2 -- tox.ini | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 963167d..460954b 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ Quickly and exactly synchronize a large python project's virtualenv with its [requirements](https://pip.pypa.io/en/stable/user_guide/#requirements-files). [![PyPI version](https://badge.fury.io/py/venv-update.svg)](https://pypi.python.org/pypi/venv-update) -[![Travis CI](https://img.shields.io/travis/Yelp/venv-update/master.svg?label=travis-ci)](https://travis-ci.org/Yelp/venv-update/branches) -[![Coverage](https://codecov.io/github/Yelp/venv-update/coverage.svg?branch=master)](https://codecov.io/github/Yelp/venv-update?branch=master) [![Documentation](https://readthedocs.org/projects/venv-update/badge/?version=master)](http://venv-update.readthedocs.org/en/master/) diff --git a/tox.ini b/tox.ini index e2d2cfa..d07d8bf 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ skipsdist=True # `changedir` ensures we run against the installed, rather than the working directory: passenv = # For codecov - CI TOXENV TRAVIS TRAVIS_* + CI TOXENV PYTEST_OPTIONS changedir = {envtmpdir}