From 35b65cea26102ba96299b091ee9c6049a95c3b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= <6774676+eumiro@users.noreply.github.com> Date: Sat, 23 Jan 2021 21:44:38 +0100 Subject: [PATCH 1/8] Add GitHub Actions and set support to Python 2.7,3.6-3.9 --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ .travis.yml | 10 ++++------ setup.py | 7 +++---- tox.ini | 8 +++++--- 4 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..85d1525 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: CI + +on: [push, pull_request, workflow_dispatch] + +jobs: + tests: + name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" + runs-on: "${{ matrix.os }}" + + strategy: + matrix: + python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "pypy2", "pypy3"] + os: ["ubuntu-latest", "macos-latest"] + + steps: + - uses: "actions/checkout@v2" + - uses: "actions/setup-python@v2" + with: + python-version: "${{ matrix.python-version }}" + - name: "Install dependencies" + run: | + set -xe + python -VV + python -m site + python -m pip install --upgrade pip setuptools wheel + python -m pip install --upgrade virtualenv tox tox-gh-actions + + - name: "Run tox targets for ${{ matrix.python-version }}" + run: "python -m tox" diff --git a/.travis.yml b/.travis.yml index ddf968c..10093a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,16 +2,14 @@ language: python sudo: false python: - "2.7" - - "3.2" - - "3.3" - - "3.4" - - "3.5" - "3.6" - - "pypy" + - "3.7" + - "3.8" + - "3.9" + - "pypy2" - "pypy3" before_install: - - if [[ $TRAVIS_PYTHON_VERSION == '3.2' ]]; then pip install 'coverage<4.0.0'; fi - pip install coveralls install: diff --git a/setup.py b/setup.py index 756d071..10dd22a 100644 --- a/setup.py +++ b/setup.py @@ -35,11 +35,10 @@ "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.2", - "Programming Language :: Python :: 3.3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], diff --git a/tox.ini b/tox.ini index abbdf5d..f3ef887 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,8 @@ [tox] -envlist = py27,py32,py33,py34,py35,py36,pypy,pypy3 +envlist = py27,py36,py37,py38,py39,pypy2,pypy3 [testenv] -deps = pytest -commands = py.test +deps = + pytest + pytest-cov +commands = pytest --cov overpy --cov-report=term-missing -v tests/ From 1482244b4b501fe0a087330f21f83e36405b6371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= <6774676+eumiro@users.noreply.github.com> Date: Mon, 8 Feb 2021 08:09:16 +0100 Subject: [PATCH 2/8] Drop Python 2.7 support --- .github/workflows/ci.yml | 2 +- .travis.yml | 2 -- README.rst | 5 ++--- setup.py | 1 - tox.ini | 2 +- 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85d1525..64d77b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "pypy2", "pypy3"] + python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3"] os: ["ubuntu-latest", "macos-latest"] steps: diff --git a/.travis.yml b/.travis.yml index 10093a7..8db5d8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,10 @@ language: python sudo: false python: - - "2.7" - "3.6" - "3.7" - "3.8" - "3.9" - - "pypy2" - "pypy3" before_install: diff --git a/README.rst b/README.rst index bfd5a01..c37c818 100644 --- a/README.rst +++ b/README.rst @@ -33,9 +33,8 @@ Install Supported Python versions: -* Python 2.7 -* Python >= 3.2 -* PyPy and PyPy3 +* Python >= 3.6 +* PyPy3 **Install:** diff --git a/setup.py b/setup.py index 10dd22a..6e26a78 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,6 @@ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", diff --git a/tox.ini b/tox.ini index f3ef887..13b25cb 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py36,py37,py38,py39,pypy2,pypy3 +envlist = py36,py37,py38,py39,pypy3 [testenv] deps = From 23b9fc6dfa40a5b0fff7f410df83981705a1aaf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= <6774676+eumiro@users.noreply.github.com> Date: Mon, 8 Feb 2021 23:07:51 +0100 Subject: [PATCH 3/8] Restructure tox.ini --- tox.ini | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tox.ini b/tox.ini index 13b25cb..d4360ac 100644 --- a/tox.ini +++ b/tox.ini @@ -6,3 +6,11 @@ deps = pytest pytest-cov commands = pytest --cov overpy --cov-report=term-missing -v tests/ + +[gh-actions] +python = + 3.6: py36 + 3.7: py37 + 3.8: py38 + 3.9: py39 + pypy3: pypy3 From 367dcf16c4feb152bb038e101ed5f8811a6999e8 Mon Sep 17 00:00:00 2001 From: PhiBo Date: Wed, 14 Apr 2021 19:54:50 +0200 Subject: [PATCH 4/8] ci - Remove travis config --- .travis.yml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8db5d8f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: python -sudo: false -python: - - "3.6" - - "3.7" - - "3.8" - - "3.9" - - "pypy3" - -before_install: - - pip install coveralls - -install: - - pip install . - - pip install pytest-cov - -script: - py.test --cov overpy --cov-report=term-missing -v tests/ - -after_script: - coveralls --verbose From 8c80449cd0a22416314301eb560b693ed76d0878 Mon Sep 17 00:00:00 2001 From: PhiBo Date: Wed, 14 Apr 2021 20:12:28 +0200 Subject: [PATCH 5/8] ci - Change GitHub actions to reduce number of build tasks --- .github/workflows/ci.yml | 54 +++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64d77b6..1708f39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,29 +1,59 @@ -name: CI +name: Tests -on: [push, pull_request, workflow_dispatch] +on: + push: + branches: + - master + paths-ignore: + - 'docs/**' + - '*.md' + - '*.rst' + pull_request: + branches: + - master + paths-ignore: + - 'docs/**' + - '*.md' + - '*.rst' jobs: tests: - name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" + name: "Python ${{ matrix.name }} on ${{ matrix.os }}" runs-on: "${{ matrix.os }}" strategy: + fail-fast: false matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3"] - os: ["ubuntu-latest", "macos-latest"] + include: + - {name: Linux, python: '3.9', os: ubuntu-latest, tox: py39} + - {name: Windows, python: '3.9', os: windows-latest, tox: py39} + - {name: Mac, python: '3.9', os: macos-latest, tox: py39} + - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38} + - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37} + - {name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36} + - {name: 'PyPy', python: pypy3, os: ubuntu-latest, tox: pypy3} steps: - uses: "actions/checkout@v2" - uses: "actions/setup-python@v2" with: - python-version: "${{ matrix.python-version }}" - - name: "Install dependencies" + python-version: ${{ matrix.python }} + - name: update pip run: | set -xe python -VV python -m site - python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade virtualenv tox tox-gh-actions - - - name: "Run tox targets for ${{ matrix.python-version }}" - run: "python -m tox" + pip install -U wheel + pip install -U setuptools + python -m pip install -U pip + - name: get pip cache dir + id: pip-cache + run: echo "::set-output name=dir::$(pip cache dir)" + - name: cache pip + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements/*.txt') }} + - run: pip install tox + - name: "Run tox targets for ${{ matrix.python }}" + run: tox -e ${{ matrix.tox }} From c43131277bfa0d685a8aa52536ee53778a3defa2 Mon Sep 17 00:00:00 2001 From: PhiBo Date: Wed, 14 Apr 2021 21:15:37 +0200 Subject: [PATCH 6/8] ci - Remove set to support windows targets --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1708f39..a8c2533 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,6 @@ jobs: python-version: ${{ matrix.python }} - name: update pip run: | - set -xe python -VV python -m site pip install -U wheel From 06d4a63004dc9bcd60e341cc5c70ca652673ef29 Mon Sep 17 00:00:00 2001 From: PhiBo Date: Wed, 14 Apr 2021 21:16:04 +0200 Subject: [PATCH 7/8] test - Use HTTPServer instead of ThreadedHTTPServer --- tests/__init__.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 2686eb2..0af614b 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -30,10 +30,6 @@ def get_response(self): yield b"" -class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): - pass - - def read_file(filename, mode="r"): filename = os.path.join(os.path.dirname(__file__), filename) return open(filename, mode).read() @@ -47,7 +43,7 @@ def new_server_thread(handle_cls, port=None): current_port += 1 test_lock.release() - server = ThreadedHTTPServer( + server = HTTPServer( (HOST, port), handle_cls ) From 8cec18c3c229abd3c545ac7761457b3bbe1abf31 Mon Sep 17 00:00:00 2001 From: PhiBo Date: Wed, 14 Apr 2021 21:25:33 +0200 Subject: [PATCH 8/8] ci - Disable Mac tests for now --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8c2533..d5ccf7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,8 @@ jobs: include: - {name: Linux, python: '3.9', os: ubuntu-latest, tox: py39} - {name: Windows, python: '3.9', os: windows-latest, tox: py39} - - {name: Mac, python: '3.9', os: macos-latest, tox: py39} + # ToDo: There are errors on Mac, but I don't know why: Connection timeout or reset + # - {name: Mac, python: '3.9', os: macos-latest, tox: py39} - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38} - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37} - {name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36}