From bf72a830c23f4d7348643aead2a1895a2da92926 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Nov 2020 14:55:01 +0100 Subject: [PATCH 01/17] Add test workflow. --- .github/workflows/test.yml | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f7404c1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,49 @@ +name: Test + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 'pypy2', 'pypy3'] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - name: Cache + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: + test-${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }} + restore-keys: | + test-${{ matrix.python-version }}-v1- + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade tox tox-gh-actions + + - name: Tox tests + shell: bash + run: | + tox + env: + TARGET: ${{ matrix.target }} + + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.COVERALLS_GITHUB_TOKEN }} From 7eb119a73ec2d6db1acb001f53e2357e1a01e052 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Nov 2020 14:59:47 +0100 Subject: [PATCH 02/17] Remove cruft. --- .github/workflows/test.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f7404c1..a70829d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,11 +37,7 @@ jobs: python -m pip install --upgrade tox tox-gh-actions - name: Tox tests - shell: bash - run: | - tox - env: - TARGET: ${{ matrix.target }} + run: tox - name: Upload coverage to Coveralls uses: coverallsapp/github-action@master From f8a34392090a4276611462fc338d50af7131e596 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Nov 2020 15:01:42 +0100 Subject: [PATCH 03/17] Limit parallel runs. --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a70829d..2f2ead4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,6 +6,7 @@ jobs: build: runs-on: ubuntu-latest strategy: + max-parallel: 6 matrix: python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 'pypy2', 'pypy3'] From 78ec3a1f4bd4482715e3d92a58c38cd183dbc90c Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Nov 2020 15:05:27 +0100 Subject: [PATCH 04/17] Debugging errors.. --- .github/workflows/test.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2f2ead4..0128c5c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,20 +18,6 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache - uses: actions/cache@v2 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: - test-${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }} - restore-keys: | - test-${{ matrix.python-version }}-v1- - - name: Install dependencies run: | python -m pip install --upgrade pip From 178007ad39856394d2e71e7132585fef00962ab3 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Nov 2020 15:57:55 +0100 Subject: [PATCH 05/17] Define gh-actions matrix. --- tox.ini | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tox.ini b/tox.ini index 5d2589a..b388708 100644 --- a/tox.ini +++ b/tox.ini @@ -11,3 +11,14 @@ deps = coverage py27: unittest2 pypy: unittest2 + +[gh-actions] +python = + 2.7: py27 + 3.4: py34 + 3.5: py35 + 3.6: py36 + 3.7: py37 + 3.8: py38 + pypy2: pypy + pypy3: pypy3 From b06a025948e6c29d04a6ab8351ff5079757fd1eb Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Nov 2020 16:06:51 +0100 Subject: [PATCH 06/17] Write coverage file. --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index b388708..51ba925 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,7 @@ commands = coverage erase coverage run test_contextlib2.py coverage report + coverage xml deps = coverage py27: unittest2 From 70cba0264a3bd9f5f3c347eca82dcd53ca310e71 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Nov 2020 16:21:54 +0100 Subject: [PATCH 07/17] Use Codecov instead of coveralls. --- .github/workflows/test.yml | 6 +++--- README.rst | 17 ++++++++--------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0128c5c..8477cea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: - name: Tox tests run: tox - - name: Upload coverage to Coveralls - uses: coverallsapp/github-action@master + - name: Upload coverage + uses: codecov/codecov-action@v1 with: - github-token: ${{ secrets.COVERALLS_GITHUB_TOKEN }} + name: Python ${{ matrix.python-version }} diff --git a/README.rst b/README.rst index 7fe170f..bfed991 100644 --- a/README.rst +++ b/README.rst @@ -2,19 +2,18 @@ :target: https://jazzband.co/ :alt: Jazzband +.. image:: https://github.com/jazzband/sorl-thumbnail/workflows/Test/badge.svg + :target: https://github.com/jazzband/sorl-thumbnail/actions + :alt: Tests + +.. image:: https://codecov.io/gh/jazzband/contextlib2/branch/master/graph/badge.svg + :target: https://codecov.io/gh/jazzband/contextlib2 + :alt: Coverage + .. image:: https://readthedocs.org/projects/contextlib2/badge/?version=latest :target: https://contextlib2.readthedocs.org/ :alt: Latest Docs -.. image:: https://img.shields.io/travis/jazzband/contextlib2/master.svg - :target: http://travis-ci.org/jazzband/contextlib2 - -.. image:: https://coveralls.io/repos/github/jazzband/contextlib2/badge.svg?branch=master - :target: https://coveralls.io/github/jazzband/contextlib2?branch=master - -.. image:: https://landscape.io/github/jazzband/contextlib2/master/landscape.svg - :target: https://landscape.io/github/jazzband/contextlib2/ - contextlib2 is a backport of the `standard library's contextlib module `_ to earlier Python versions. From 72bde0ee1de73c2ffeabb553927ea9f41bc6e482 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Nov 2020 16:25:24 +0100 Subject: [PATCH 08/17] No 3.4 --- .github/workflows/test.yml | 4 ++-- tox.ini | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8477cea..545110c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,9 +6,9 @@ jobs: build: runs-on: ubuntu-latest strategy: - max-parallel: 6 + max-parallel: 5 matrix: - python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 'pypy2', 'pypy3'] + python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 'pypy2', 'pypy3'] steps: - uses: actions/checkout@v2 diff --git a/tox.ini b/tox.ini index 51ba925..fbd2a40 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{27,34,35,36,37,py,py3} +envlist = py{27,35,36,37,py,py3} skip_missing_interpreters = True [testenv] @@ -16,7 +16,6 @@ deps = [gh-actions] python = 2.7: py27 - 3.4: py34 3.5: py35 3.6: py36 3.7: py37 From cd80f6860d0d571f1e0cfa4772fc35658db9d1b9 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Nov 2020 16:26:48 +0100 Subject: [PATCH 09/17] Run tox in verbose mode --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 545110c..674cd20 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,8 @@ jobs: python -m pip install --upgrade tox tox-gh-actions - name: Tox tests - run: tox + run: | + tox -v - name: Upload coverage uses: codecov/codecov-action@v1 From 403bb511024c725ad0bb0b44194c9f5c091f6a17 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Nov 2020 16:31:16 +0100 Subject: [PATCH 10/17] Combine coverage data --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index fbd2a40..7706b18 100644 --- a/tox.ini +++ b/tox.ini @@ -4,9 +4,9 @@ skip_missing_interpreters = True [testenv] commands = - coverage erase coverage run test_contextlib2.py coverage report + coverage combine coverage xml deps = coverage From f50a62ed77b502976a25c6376ebd9ffd61adf01c Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Nov 2020 16:34:36 +0100 Subject: [PATCH 11/17] No combine --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index 7706b18..d682619 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,6 @@ skip_missing_interpreters = True commands = coverage run test_contextlib2.py coverage report - coverage combine coverage xml deps = coverage From 4a2baeceab6bca9a1fc4a2f468a8b312a1273421 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Nov 2020 16:38:15 +0100 Subject: [PATCH 12/17] Cache pip --- .github/workflows/test.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 674cd20..a02eaf0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,20 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - name: Cache + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: + ${{ matrix.os }}-${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }} + restore-keys: | + ${{ matrix.os }}-${{ matrix.python-version }}-v1- + - name: Install dependencies run: | python -m pip install --upgrade pip From 90b643f5fb7ad59a0b9351cedda79df213ac6ec1 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Nov 2020 16:41:12 +0100 Subject: [PATCH 13/17] Add release workflow. --- .github/workflows/release.yml | 56 +++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..655635d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,56 @@ +name: Release + +on: + push: + branches: + - master + release: + types: + - published + +jobs: + build: + if: github.repository == 'jazzband/contextlib2' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - name: Cache + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: release-${{ hashFiles('**/setup.py') }} + restore-keys: | + release- + + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install -U setuptools twine wheel + + - name: Build package + run: | + python setup.py --version + python setup.py sdist --format=gztar bdist_wheel + twine check dist/* + + - name: Upload packages to Jazzband + if: github.event.action == 'published' + uses: pypa/gh-action-pypi-publish@master + with: + user: jazzband + password: ${{ secrets.JAZZBAND_RELEASE_KEY }} + repository_url: https://jazzband.co/projects/contextlib2/upload From 5eba33be659704437a36c9518a16229f5946989b Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Nov 2020 16:45:50 +0100 Subject: [PATCH 14/17] Remove all Travis-CI cruft. --- .travis.yml | 33 --------------------------------- README.rst | 4 ++-- 2 files changed, 2 insertions(+), 35 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a74b060..0000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -language: python -matrix: - include: - - python: 2.7 - env: TOXENV=py27 - - python: 3.4 - env: TOXENV=py34 - - python: 3.5 - env: TOXENV=py35 - - python: 3.6 - env: TOXENV=py36 - - python: 3.7 - env: TOXENV=py37 - dist: xenial # required for Python >= 3.7 - - python: pypy - env: TOXENV=pypy - - python: pypy3 - env: TOXENV=pypy3 -install: pip install tox coveralls && tox --notest -script: tox -after_success: coveralls -deploy: - provider: pypi - user: jazzband - server: https://jazzband.co/projects/contextlib2/upload - distributions: sdist bdist_wheel - password: - secure: lmCsNEmxcYTcdDz1ZdoegDvZxIRFBsjoQoT5O1t9GsYKzEMebPxEMZKRIxWXLIu1HKXSSAnb6foDvK+v61VK1PiGBfn2KMeOr1y7G+gm2sOSXRiWtvnzz7LTWTW6cHdwOz6Un3FNxhTRqrQ4Jz9Nsik0YuA+MOn8bhWvTAxY5iIYRuDoyNpUDBwMOTQchfpjJhID0Zhuvk1gTX5Jrp425FPhTvGgUEefBh48PFN/1qBFmV45X5Y0bZEcd8lRGXxrUFej2Pk54sSVurhIAJLmWE9S9VsnBeRZMCB04jWBSGNrrUF11LK2EtzZ701liZzET6NLztLc9ZXdrpSWWQ07W0QinHo4v1PNA7b5JHEhhqEIHlE/XBDSqQrKWbonBlNXp9YXMtTfF5OFPmc2V33ad1WMnqvo0w76twRigGWQsKwWrtJUG0SrSybQg8YxsyH9DfVhUwQ56WhaBZSL8vTN4L8v+rmv2yyAkgmx6GicCF5lDqZs3NpRrK5jWrZSu6prfkfoZhfLz29em75t6JP8d1Q1a9JqFQJTGCe78cDuOj+KAlcIz43G59iGyE63nBJ7VlezUE2XouQs3G2Uf0+bx8YIH43uMbiNb9ITghqPFJEOjcKcv0B3VSUhaV91co+D5NL0AZ9E4dF5jCTrNmt0X20EVOucpm/KWruujXEoCSY= - - on: - tags: true - repo: jazzband/contextlib2 - condition: "$TOXENV = py35" # only release once per test run for a Git tag diff --git a/README.rst b/README.rst index bfed991..e98dba4 100644 --- a/README.rst +++ b/README.rst @@ -36,12 +36,12 @@ You can test against multiple versions of Python with pip install tox tox -Versions currently tested in both tox and Travis CI are: +Versions currently tested in both tox and GitHub Actions are: * CPython 2.7 -* CPython 3.4 * CPython 3.5 * CPython 3.6 * CPython 3.7 +* CPython 3.8 * PyPy * PyPy3 From ca6d76fb9f766b4225fc8f954c2ede1befe86f2d Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Nov 2020 20:51:09 +0100 Subject: [PATCH 15/17] Use tag event instead of release. --- .github/workflows/release.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 655635d..84b9034 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,11 +2,8 @@ name: Release on: push: - branches: - - master - release: - types: - - published + tags: + - '*' jobs: build: @@ -48,7 +45,7 @@ jobs: twine check dist/* - name: Upload packages to Jazzband - if: github.event.action == 'published' + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@master with: user: jazzband From 07825fc9d913e5dd1298bd374dfc114b2a1f7cfd Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Wed, 25 Nov 2020 19:48:42 +0100 Subject: [PATCH 16/17] Update README.rst Co-authored-by: Hugo van Kemenade --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index e98dba4..84f25c5 100644 --- a/README.rst +++ b/README.rst @@ -2,8 +2,8 @@ :target: https://jazzband.co/ :alt: Jazzband -.. image:: https://github.com/jazzband/sorl-thumbnail/workflows/Test/badge.svg - :target: https://github.com/jazzband/sorl-thumbnail/actions +.. image:: https://github.com/jazzband/contextlib2/workflows/Test/badge.svg + :target: https://github.com/jazzband/contextlib2/actions :alt: Tests .. image:: https://codecov.io/gh/jazzband/contextlib2/branch/master/graph/badge.svg From 34947502e5f5dc9ff3df5e6bd6146579be560f6e Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 30 Nov 2020 12:19:07 +0100 Subject: [PATCH 17/17] Update .github/workflows/release.yml Co-authored-by: Hugo van Kemenade --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 84b9034..f905a1c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ steps.pip-cache.outputs.dir }} - key: release-${{ hashFiles('**/setup.py') }} + key: release-${{ hashFiles('**/tox.ini') }} restore-keys: | release-