From dd93e35ae0d378e3b156ffaf41cf4b107db83396 Mon Sep 17 00:00:00 2001 From: akloeckner Date: Tue, 16 May 2023 16:33:36 +0200 Subject: [PATCH 01/12] Create python-package.yml I just chose one of the proposed GH actions and changed from pytest to tox. Let's see if that works. ;-) --- .github/workflows/python-package.yml | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/python-package.yml diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..938e3eb --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,40 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python package + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.8", "3.9", "3.10"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 tox + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with tox + run: | + tox From 821ae3a0d0e591add2925684fc0268585b3fa1fa Mon Sep 17 00:00:00 2001 From: akloeckner Date: Tue, 16 May 2023 16:40:28 +0200 Subject: [PATCH 02/12] Update python-package.yml Use pytest? --- .github/workflows/python-package.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 938e3eb..2d56fe1 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.6", "3.7", "3.8"] steps: - uses: actions/checkout@v3 @@ -35,6 +35,6 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with tox + - name: Test with pytest run: | - tox + pytest From c3ba22ca92745f09c705fefc0a5b040418e10449 Mon Sep 17 00:00:00 2001 From: akloeckner Date: Tue, 16 May 2023 16:42:48 +0200 Subject: [PATCH 03/12] Update python-package.yml More current versions --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 2d56fe1..27fbca5 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.6", "3.7", "3.8"] + python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v3 From a58c52d3863f57902c9cb5abbcfb188abd0dba87 Mon Sep 17 00:00:00 2001 From: akloeckner Date: Tue, 16 May 2023 16:53:54 +0200 Subject: [PATCH 04/12] Update python-package.yml Add weekly trigger --- .github/workflows/python-package.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 27fbca5..8718441 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -4,10 +4,14 @@ name: Python package on: + # run for changes in main branch push: branches: [ "main" ] pull_request: branches: [ "main" ] + # also run weekly: Fridays at 11:47. + schedule: + - cron: "47 11 * * 6" jobs: build: From 30cceda1051c89a9e927f08480f7a0f290088bc6 Mon Sep 17 00:00:00 2001 From: dev-docker Date: Sat, 1 Jul 2023 00:49:16 +0200 Subject: [PATCH 05/12] update python versions and remove weekly trigger checking once working local tests weekly doesn't make sense to me. => remove weeekly tests removing actual api tests doesn't make sense to me either. => if a test fails in a PR, it should just be retriggered. --- .github/workflows/python-package.yml | 5 +---- tox.ini | 5 +++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 8718441..2761f0f 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -9,9 +9,6 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] - # also run weekly: Fridays at 11:47. - schedule: - - cron: "47 11 * * 6" jobs: build: @@ -20,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 diff --git a/tox.ini b/tox.ini index 50c40af..c6823b3 100644 --- a/tox.ini +++ b/tox.ini @@ -3,9 +3,10 @@ envlist = py{36,37,38}-requests{oldest,latest}-pytz{oldest,latest} [travis] python = - 3.6: py36 - 3.7: py37 3.8: py38 + 3.9: py39 + 3.10: py310 + 3.11: py311 [travis:env] REQUESTS_VERSION = From b8aaf0c51c0c83ebc36f0bb9e1fc0462a78c5c5d Mon Sep 17 00:00:00 2001 From: akloeckner Date: Thu, 6 Jul 2023 09:16:18 +0200 Subject: [PATCH 06/12] Update envlist --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index c6823b3..07455cc 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{36,37,38}-requests{oldest,latest}-pytz{oldest,latest} +envlist = py{38,39,310,311}-requests{oldest,latest}-pytz{oldest,latest} [travis] python = From 009257cc7024cf914ea3e7487bb11f83b0abf58d Mon Sep 17 00:00:00 2001 From: akloeckner Date: Thu, 6 Jul 2023 09:19:11 +0200 Subject: [PATCH 07/12] Update tox.ini: GH actions --- tox.ini | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tox.ini b/tox.ini index 07455cc..aeac683 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,13 @@ python = 3.10: py310 3.11: py311 +[gh-actions] +python = + 3.8: py38 + 3.9: py39 + 3.10: py310 + 3.11: py311 + [travis:env] REQUESTS_VERSION = oldest: requestsoldest From a0dcd9b8dc8eb1c36b87616ce7e88ef8c5201495 Mon Sep 17 00:00:00 2001 From: akloeckner Date: Thu, 6 Jul 2023 09:30:31 +0200 Subject: [PATCH 08/12] Update python-package.yml. use tox --- .github/workflows/python-package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 2761f0f..44f76de 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -22,13 +22,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install flake8 tox + python -m pip install flake8 tox tox-gh-actions if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | @@ -36,6 +36,6 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest + - name: Test with tox run: | - pytest + tox From 6d7b2d0e58129915a3037bec8a02c4f69a9e380c Mon Sep 17 00:00:00 2001 From: akloeckner Date: Thu, 6 Jul 2023 12:08:35 +0200 Subject: [PATCH 09/12] Update tox.ini: use py310 compatible requests package --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index aeac683..a352b4a 100644 --- a/tox.ini +++ b/tox.ini @@ -27,7 +27,7 @@ PYTZ_VERSION = [testenv] deps = pytest - requestsoldest: requests==2.9.0 + requestsoldest: requests==2.28.0 requestslatest: requests~=2.9 pytzoldest: pytz==2013.6 pytzlatest: pytz>=2013.6 From 1ce4335666dbfb1b766999239c03d2b6f8e2ce4d Mon Sep 17 00:00:00 2001 From: akloeckner Date: Thu, 6 Jul 2023 12:28:21 +0200 Subject: [PATCH 10/12] Update tox.ini: pytz support for py310 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index a352b4a..a0ee2ab 100644 --- a/tox.ini +++ b/tox.ini @@ -29,6 +29,6 @@ deps = pytest requestsoldest: requests==2.28.0 requestslatest: requests~=2.9 - pytzoldest: pytz==2013.6 + pytzoldest: pytz==2022.1 pytzlatest: pytz>=2013.6 commands = pytest From 905a48a9888dbd6f329f8df1bb329efeeb96ab65 Mon Sep 17 00:00:00 2001 From: akloeckner Date: Thu, 6 Jul 2023 12:36:31 +0200 Subject: [PATCH 11/12] Update tox.ini: use minimum version --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index a0ee2ab..61c6e04 100644 --- a/tox.ini +++ b/tox.ini @@ -28,7 +28,7 @@ PYTZ_VERSION = deps = pytest requestsoldest: requests==2.28.0 - requestslatest: requests~=2.9 + requestslatest: requests~=2.28 pytzoldest: pytz==2022.1 - pytzlatest: pytz>=2013.6 + pytzlatest: pytz>=2022.1 commands = pytest From e3f789182890c9dd90a25c2b8b1b23a72991543d Mon Sep 17 00:00:00 2001 From: akloeckner Date: Thu, 6 Jul 2023 12:37:18 +0200 Subject: [PATCH 12/12] Update requirements.txt: bump dependencies --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index d54f16a..c507100 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -requests~=2.9 -pytz>=2013.6 +requests~=2.28 +pytz>=2022.1 pycryptodome~=3.9.8 pytest~=6.2.5