From 8f2e0637ae1ef6cdc996e68ff3e8c68d2a3850ff Mon Sep 17 00:00:00 2001 From: MaxDall Date: Mon, 10 Jul 2023 17:36:35 +0200 Subject: [PATCH 01/13] use os|python_version matrix for `pytest`, `mypy` actions --- .github/workflows/tests.yml | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b26d378bb..1d7d1b64c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python + # This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: # https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions @@ -12,21 +12,26 @@ on: jobs: pytest: # Containers must run in Linux based operating systems - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] steps: - uses: actions/checkout@v3 - - name: Set up Python 3.8 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: ${{ matrix.python-version }} - name: Cache environment uses: actions/cache@master id: cache with: - path: ${{ env.pythonLocation }}/lib/python3.8/site-packages/* - key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt', 'requirements-dev.txt') }} + path: ${{ env.pythonLocation }} + key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }} + - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -37,21 +42,26 @@ jobs: mypy: # Containers must run in Linux based operating systems - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] steps: - uses: actions/checkout@v3 - - name: Set up Python 3.8 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: ${{ matrix.python-version }} - name: Cache environment uses: actions/cache@master id: cache with: - path: ${{ env.pythonLocation }}/lib/python3.8/site-packages/* - key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt', 'requirements-dev.txt') }} + path: ${{ env.pythonLocation }} + key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }} + - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' run: | From e06049f71719b456ec073a19cdf90b5c9abba470 Mon Sep 17 00:00:00 2001 From: MaxDall Date: Mon, 10 Jul 2023 17:43:13 +0200 Subject: [PATCH 02/13] remove python version 3.7 from matrix --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1d7d1b64c..34cb5a090 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ - # This workflow will install Python dependencies, run tests and lint with a single version of Python +# This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: # https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions @@ -16,7 +16,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] + python-version: [ "3.8", "3.9", "3.10", "3.11" ] steps: - uses: actions/checkout@v3 From abb5b5e34cad10f1b6bda2221231353e608b2630 Mon Sep 17 00:00:00 2001 From: MaxDall Date: Mon, 10 Jul 2023 17:47:44 +0200 Subject: [PATCH 03/13] remove python version 3.7 from matrix --- .github/workflows/tests.yml | 2 +- setup.cfg | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 34cb5a090..6282d2bc4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - python-version: [ "3.8", "3.9", "3.10", "3.11" ] + python-version: [ "3.8" ] steps: - uses: actions/checkout@v3 diff --git a/setup.cfg b/setup.cfg index 0b889fd1c..1a1a06ae4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,8 +13,6 @@ author_email = max.dallabetta@gmail.com package_dir = =src install_requires = - dill~=0.3.5.1 - FastWARC~=0.12.2 requests~=2.28.1 ftfy~=6.1.1 python-dateutil~=2.8.2 From 5ff1c2c4e3ba281927a9440fe5ee5052637dfc66 Mon Sep 17 00:00:00 2001 From: MaxDall Date: Mon, 10 Jul 2023 17:48:56 +0200 Subject: [PATCH 04/13] fix some bugs --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6282d2bc4..d89b36688 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -46,7 +46,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] + python-version: [ "3.8" ] steps: - uses: actions/checkout@v3 From d2b39ac8cae7b15717271c56dddf89b6aa70db0e Mon Sep 17 00:00:00 2001 From: MaxDall Date: Mon, 10 Jul 2023 17:56:39 +0200 Subject: [PATCH 05/13] continue on error --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d89b36688..8ba5cc88d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,6 +17,7 @@ jobs: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] python-version: [ "3.8" ] + continue-on-error: true steps: - uses: actions/checkout@v3 @@ -47,6 +48,7 @@ jobs: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] python-version: [ "3.8" ] + continue-on-error: true steps: - uses: actions/checkout@v3 From ee90ab81bccbf65d4fb2af4e886586b165d6d0f8 Mon Sep 17 00:00:00 2001 From: Max Dallabetta <46926170+MaxDall@users.noreply.github.com> Date: Wed, 12 Jul 2023 14:22:38 +0200 Subject: [PATCH 06/13] include python version 3.9 --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8ba5cc88d..890341bf5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - python-version: [ "3.8" ] + python-version: [ "3.8", "3.9" ] continue-on-error: true steps: - uses: actions/checkout@v3 @@ -47,7 +47,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - python-version: [ "3.8" ] + python-version: [ "3.8", "3.9" ] continue-on-error: true steps: - uses: actions/checkout@v3 From e24616f3714b8cc49426d3d4207cc9b951d649b9 Mon Sep 17 00:00:00 2001 From: MaxDall Date: Wed, 12 Jul 2023 15:22:39 +0200 Subject: [PATCH 07/13] rework cache --- .github/workflows/tests.yml | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 890341bf5..0b54ba68e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,18 +25,9 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - - name: Cache environment - uses: actions/cache@master - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }} - - - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' + cache: 'pip' run: | - pip install -e .[dev] + pip install -e .[dev] - name: Run pytest run: python -m pytest -vv @@ -56,16 +47,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - - name: Cache environment - uses: actions/cache@master - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }} - - - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' + cache: 'pip' run: | pip install -e .[dev] From d2c95abc1baeba613947e8bc267550b8358dbf2c Mon Sep 17 00:00:00 2001 From: MaxDall Date: Wed, 12 Jul 2023 17:22:40 +0200 Subject: [PATCH 08/13] rename cache key --- .github/workflows/tests.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0b54ba68e..5b1e2807a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,9 +25,18 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - cache: 'pip' + + - name: Cache environment + uses: actions/cache@master + id: cache + with: + path: ${{ env.pythonLocation }} + key: ${{ matrix.os }}-${{ steps.cache.output.python-version }}-${{ hashFiles('setup.cfg') }} + + - name: Install dependencies + if: steps.cache.outputs.cache-hit != 'true' run: | - pip install -e .[dev] + pip install -e .[dev] - name: Run pytest run: python -m pytest -vv @@ -47,7 +56,16 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - cache: 'pip' + + - name: Cache environment + uses: actions/cache@master + id: cache + with: + path: ${{ env.pythonLocation }} + key: ${{ matrix.os }}-${{ steps.cache.output.python-version }}-${{ hashFiles('setup.cfg') }} + + - name: Install dependencies + if: steps.cache.outputs.cache-hit != 'true' run: | pip install -e .[dev] From cfcc3c8678669fe36056b2727ac074226ac94d8e Mon Sep 17 00:00:00 2001 From: MaxDall Date: Wed, 12 Jul 2023 17:34:09 +0200 Subject: [PATCH 09/13] fix a bug --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5b1e2807a..2b121473f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,7 +31,7 @@ jobs: id: cache with: path: ${{ env.pythonLocation }} - key: ${{ matrix.os }}-${{ steps.cache.output.python-version }}-${{ hashFiles('setup.cfg') }} + key: ${{ matrix.os }}-${{ steps.cache.outputs.python-version }}-${{ hashFiles('setup.cfg') }} - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' @@ -62,7 +62,7 @@ jobs: id: cache with: path: ${{ env.pythonLocation }} - key: ${{ matrix.os }}-${{ steps.cache.output.python-version }}-${{ hashFiles('setup.cfg') }} + key: ${{ matrix.os }}-${{ steps.cache.outputs.python-version }}-${{ hashFiles('setup.cfg') }} - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' From 8ce162de575c9de9a9a4f879c0d12ff66fbd53e7 Mon Sep 17 00:00:00 2001 From: MaxDall Date: Wed, 12 Jul 2023 17:40:53 +0200 Subject: [PATCH 10/13] fix another bug and add 3.10 --- .github/workflows/tests.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2b121473f..cafce6494 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,17 +11,17 @@ on: jobs: pytest: - # Containers must run in Linux based operating systems runs-on: ${{ matrix.os }} strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - python-version: [ "3.8", "3.9" ] + python-version: [ "3.8", "3.9", "3.10" ] continue-on-error: true steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} + id: setup_python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -31,7 +31,7 @@ jobs: id: cache with: path: ${{ env.pythonLocation }} - key: ${{ matrix.os }}-${{ steps.cache.outputs.python-version }}-${{ hashFiles('setup.cfg') }} + key: ${{ matrix.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('setup.cfg') }} - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' @@ -42,17 +42,17 @@ jobs: run: python -m pytest -vv mypy: - # Containers must run in Linux based operating systems runs-on: ${{ matrix.os }} strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - python-version: [ "3.8", "3.9" ] + python-version: [ "3.8", "3.9", "3.10" ] continue-on-error: true steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} + id: setup_python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -62,7 +62,7 @@ jobs: id: cache with: path: ${{ env.pythonLocation }} - key: ${{ matrix.os }}-${{ steps.cache.outputs.python-version }}-${{ hashFiles('setup.cfg') }} + key: ${{ matrix.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('setup.cfg') }} - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' From 4b8992160b281c439c1047de8cf57a788f2634ea Mon Sep 17 00:00:00 2001 From: MaxDall Date: Wed, 12 Jul 2023 17:50:38 +0200 Subject: [PATCH 11/13] add bete macOS 13 and bump up python version one more --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cafce6494..db6d67762 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,8 +14,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] - python-version: [ "3.8", "3.9", "3.10" ] + os: [ ubuntu-latest, macos-13, windows-latest ] + python-version: [ "3.8", "3.9", "3.10", "3.11" ] continue-on-error: true steps: - uses: actions/checkout@v3 @@ -45,8 +45,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] - python-version: [ "3.8", "3.9", "3.10" ] + os: [ ubuntu-latest, macos-13, windows-latest ] + python-version: [ "3.8", "3.9", "3.10", "3.11" ] continue-on-error: true steps: - uses: actions/checkout@v3 From be14db19333172f951c2d0c262397dc8e7d0cfcb Mon Sep 17 00:00:00 2001 From: MaxDall Date: Wed, 12 Jul 2023 18:01:12 +0200 Subject: [PATCH 12/13] return to macos-latest --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index db6d67762..12896e18d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest, macos-13, windows-latest ] + os: [ ubuntu-latest, macos-latest, windows-latest ] python-version: [ "3.8", "3.9", "3.10", "3.11" ] continue-on-error: true steps: @@ -45,7 +45,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest, macos-13, windows-latest ] + os: [ ubuntu-latest, macos-latest, windows-latest ] python-version: [ "3.8", "3.9", "3.10", "3.11" ] continue-on-error: true steps: From 42ed26c8dfa7e463d5186a76bcc631764c048209 Mon Sep 17 00:00:00 2001 From: Max Dallabetta Date: Thu, 15 Feb 2024 16:21:02 +0100 Subject: [PATCH 13/13] fix cache key and remove macos, windows from mypy run --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f4cc2ef34..da217f133 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,7 +31,7 @@ jobs: id: cache with: path: ${{ env.pythonLocation }} - key: ${{ matrix.os }}-{{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} + key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' run: | @@ -44,7 +44,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] + os: [ ubuntu-latest ] python-version: [ "3.8", "3.9", "3.10", "3.11" ] continue-on-error: true steps: @@ -61,7 +61,7 @@ jobs: id: cache with: path: ${{ env.pythonLocation }} - key: ${{ matrix.os }}-{{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} + key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' run: |