From 9621aea63960c416a8c72ca3b366bbe3544fe018 Mon Sep 17 00:00:00 2001 From: YigitElma Date: Wed, 11 Dec 2024 21:00:04 -0500 Subject: [PATCH 01/24] debug unit tests --- .github/workflows/unit_tests.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 6e8ebc7a66..059f89a1c7 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -80,13 +80,18 @@ jobs: with: swap-size-gb: 10 - - name: Test with pytest + - name: List of Used Dependencies if: env.has_changes == 'true' run: | - source .venv-${{ matrix.combos.python_version }}/bin/activate pwd lscpu - pip list + source .venv-${{ matrix.combos.python_version }}/bin/activate + python -m pip list + + - name: Test with pytest + if: env.has_changes == 'true' + run: | + source .venv-${{ matrix.combos.python_version }}/bin/activate python -m pytest -v -m unit \ --durations=0 \ --cov-report xml:cov.xml \ From 4f4c5efd944ff1bfdc02757f424697da37758cc1 Mon Sep 17 00:00:00 2001 From: YigitElma Date: Wed, 11 Dec 2024 21:40:47 -0500 Subject: [PATCH 02/24] more debugging --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 059f89a1c7..f6469462e5 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -86,7 +86,7 @@ jobs: pwd lscpu source .venv-${{ matrix.combos.python_version }}/bin/activate - python -m pip list + pip list - name: Test with pytest if: env.has_changes == 'true' From 5db9c6cf7f3b45af21dbe3280086f2ec6fb8002d Mon Sep 17 00:00:00 2001 From: YigitElma Date: Wed, 11 Dec 2024 21:49:27 -0500 Subject: [PATCH 03/24] update --- .github/workflows/unit_tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index f6469462e5..393dfb52d7 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -80,12 +80,14 @@ jobs: with: swap-size-gb: 10 - - name: List of Used Dependencies + - name: Action Details if: env.has_changes == 'true' run: | pwd + ls -l lscpu source .venv-${{ matrix.combos.python_version }}/bin/activate + ls -l pip list - name: Test with pytest From 27e95509000d35e251415c071243dc5b7e27b782 Mon Sep 17 00:00:00 2001 From: YigitElma Date: Wed, 11 Dec 2024 21:53:10 -0500 Subject: [PATCH 04/24] update --- .github/workflows/unit_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 393dfb52d7..aaee705b1c 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -84,10 +84,10 @@ jobs: if: env.has_changes == 'true' run: | pwd - ls -l + ls -a lscpu source .venv-${{ matrix.combos.python_version }}/bin/activate - ls -l + ls -a pip list - name: Test with pytest From 044afcc409e379f1c36950e58dccc33ed6d7e879 Mon Sep 17 00:00:00 2001 From: YigitElma Date: Wed, 11 Dec 2024 21:59:46 -0500 Subject: [PATCH 05/24] add more debugging --- .github/workflows/unit_tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index aaee705b1c..2d2fa3fc0a 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -85,9 +85,10 @@ jobs: run: | pwd ls -a + ls -a .venv-${{ matrix.combos.python_version }}/bin lscpu source .venv-${{ matrix.combos.python_version }}/bin/activate - ls -a + ls -a .venv-${{ matrix.combos.python_version }}/bin pip list - name: Test with pytest From 72e38243b2067d900cafe643192773633863d945 Mon Sep 17 00:00:00 2001 From: YigitElma Date: Wed, 11 Dec 2024 22:15:29 -0500 Subject: [PATCH 06/24] check if new action version caused this --- .github/workflows/unit_tests.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 2d2fa3fc0a..ccae1641bf 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -121,9 +121,14 @@ jobs: - name: Upload coverage if: env.has_changes == 'true' id : codecov - uses: codecov/codecov-action@v5 + uses: Wandalen/wretry.action@v3.5.0 with: - name: codecov-umbrella - files: ./cov.xml - fail_ci_if_error: true - verbose: true + action: codecov/codecov-action@v4 + with: | + token: ${{ secrets.CODECOV_TOKEN }} + name: codecov-umbrella + files: ./cov.xml + fail_ci_if_error: true + verbose: true + attempt_limit: 10 + attempt_delay: 60000 # ms, 1 min From 005ee84afe7a12285fb9cc39b7d135b7931a476c Mon Sep 17 00:00:00 2001 From: YigitElma Date: Wed, 11 Dec 2024 22:30:44 -0500 Subject: [PATCH 07/24] add more debugging. maybe the problem is 3.12.8 --- .github/workflows/unit_tests.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index ccae1641bf..9fb478b46f 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -83,6 +83,12 @@ jobs: - name: Action Details if: env.has_changes == 'true' run: | + echo "Checking virtual environment directory" + ls -la .venv-${{ matrix.combos.python_version }}/bin + echo "Trying to activate virtual environment" + source .venv-${{ matrix.combos.python_version }}/bin/activate + which python + python --version pwd ls -a ls -a .venv-${{ matrix.combos.python_version }}/bin @@ -121,14 +127,9 @@ jobs: - name: Upload coverage if: env.has_changes == 'true' id : codecov - uses: Wandalen/wretry.action@v3.5.0 + uses: codecov/codecov-action@v5 with: - action: codecov/codecov-action@v4 - with: | - token: ${{ secrets.CODECOV_TOKEN }} - name: codecov-umbrella - files: ./cov.xml - fail_ci_if_error: true - verbose: true - attempt_limit: 10 - attempt_delay: 60000 # ms, 1 min + name: codecov-umbrella + files: ./cov.xml + fail_ci_if_error: true + verbose: true From a41e94e29dc134fd0714a01d289def42f14d2556 Mon Sep 17 00:00:00 2001 From: YigitElma Date: Wed, 11 Dec 2024 22:38:37 -0500 Subject: [PATCH 08/24] more and more debugging --- .github/workflows/unit_tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 9fb478b46f..e719c01813 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -95,6 +95,8 @@ jobs: lscpu source .venv-${{ matrix.combos.python_version }}/bin/activate ls -a .venv-${{ matrix.combos.python_version }}/bin + python -m pip install --upgrade pip + pip install -r devtools/dev-requirements.txt pip list - name: Test with pytest From 27ec9c702cafb431e7748fc540f1834cb8282c01 Mon Sep 17 00:00:00 2001 From: YigitElma Date: Wed, 11 Dec 2024 22:52:51 -0500 Subject: [PATCH 09/24] try renaming the cached venv --- .github/workflows/benchmark.yml | 10 +++++----- .github/workflows/black.yml | 4 ++-- .github/workflows/cache_dependencies.yml | 14 +++++++------- .github/workflows/notebook_tests.yml | 4 ++-- .github/workflows/regression_tests.yml | 10 +++++----- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 9f13a85de7..b56036be52 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -71,7 +71,7 @@ jobs: run: | gh cache list python -m venv .venv-${{ matrix.python-version }} - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -79,7 +79,7 @@ jobs: - name: Benchmark with pytest-benchmark (PR) if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate pwd lscpu pip list @@ -106,7 +106,7 @@ jobs: - name: Benchmark with pytest-benchmark (MASTER) if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate pwd lscpu pip list @@ -122,7 +122,7 @@ jobs: - name: Put benchmark results in same folder if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate pwd cd tests/benchmarks find .benchmarks/ -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2- | tail -n 1 > temp1 @@ -143,7 +143,7 @@ jobs: - name: Compare latest commit results to the master branch results if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate cd tests/benchmarks pwd python compare_bench_results.py diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index ae0be3dbb7..07e5a16fd5 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -31,13 +31,13 @@ jobs: run: | gh cache list python -m venv .venv-${{ matrix.python-version }} - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt - name: Check files using the black formatter run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate black --version black --check desc/ tests/ || black_return_code=$? echo "BLACK_RETURN_CODE=$black_return_code" >> $GITHUB_ENV diff --git a/.github/workflows/cache_dependencies.yml b/.github/workflows/cache_dependencies.yml index dd648d78f4..7bef543c67 100644 --- a/.github/workflows/cache_dependencies.yml +++ b/.github/workflows/cache_dependencies.yml @@ -28,8 +28,8 @@ jobs: run: | echo "Current Cached files list" gh cache list - echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${{ matrix.python-version }}-" - for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${{ matrix.python-version }}-\")) | .key"); do + echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${{ matrix.python-version | split('.')[1] }}-" + for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${{ matrix.python-version | split('.')[1] }}-\")) | .key"); do echo "Deleting cache with key: $cache_key" gh cache delete "$cache_key" done @@ -37,8 +37,8 @@ jobs: # Update the matplotlib version if needed later - name: Set up virtual environment run: | - python -m venv .venv-${{ matrix.python-version }} - source .venv-${{ matrix.python-version }}/bin/activate + python -m venv .venv-${{ matrix.python-version | split('.')[1] }} + source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -47,12 +47,12 @@ jobs: id: cache-env uses: actions/cache@v4 with: - path: .venv-${{ matrix.python-version }} - key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ matrix.python-version | split('.')[1] }} + key: ${{ runner.os }}-venv-${{ matrix.python-version | split('.')[1] }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Verify virtual environment activation run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate python --version pip --version pip list diff --git a/.github/workflows/notebook_tests.yml b/.github/workflows/notebook_tests.yml index 1d1dc1473c..27cab48a41 100644 --- a/.github/workflows/notebook_tests.yml +++ b/.github/workflows/notebook_tests.yml @@ -64,7 +64,7 @@ jobs: run: | gh cache list python -m venv .venv-${{ matrix.python-version }} - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -72,7 +72,7 @@ jobs: - name: Test notebooks with pytest and nbmake if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate pwd lscpu pip list diff --git a/.github/workflows/regression_tests.yml b/.github/workflows/regression_tests.yml index 9e648d3ec1..2b7f4b44d7 100644 --- a/.github/workflows/regression_tests.yml +++ b/.github/workflows/regression_tests.yml @@ -55,15 +55,15 @@ jobs: id: restore-env uses: actions/cache/restore@v4 with: - path: .venv-${{ matrix.python-version }} - key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ matrix.python-version | split('.')[1] }} + key: ${{ runner.os }}-venv-${{ matrix.python-version | split('.')[1] }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Set up virtual environment if not restored from cache if: steps.restore-env.outputs.cache-hit != 'true' && env.has_changes == 'true' run: | gh cache list - python -m venv .venv-${{ matrix.python-version }} - source .venv-${{ matrix.python-version }}/bin/activate + python -m venv .venv-${{ matrix.python-version | split('.')[1] }} + source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -77,7 +77,7 @@ jobs: - name: Test with pytest if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate pwd lscpu pip list From caf8d33dd3a9671f710f48c77444965c621c7783 Mon Sep 17 00:00:00 2001 From: YigitElma Date: Wed, 11 Dec 2024 23:01:26 -0500 Subject: [PATCH 10/24] rename format --- .github/workflows/benchmark.yml | 10 ++++----- .github/workflows/black.yml | 4 ++-- .github/workflows/cache_dependencies.yml | 18 +++++++++------ .github/workflows/notebook_tests.yml | 4 ++-- .github/workflows/regression_tests.yml | 14 +++++++----- .github/workflows/unit_tests.yml | 28 ++++++++++++++---------- .github/workflows/weekly_tests.yml | 4 ++-- 7 files changed, 47 insertions(+), 35 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index b56036be52..d757f4ddd6 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -71,7 +71,7 @@ jobs: run: | gh cache list python -m venv .venv-${{ matrix.python-version }} - source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -79,7 +79,7 @@ jobs: - name: Benchmark with pytest-benchmark (PR) if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate pwd lscpu pip list @@ -106,7 +106,7 @@ jobs: - name: Benchmark with pytest-benchmark (MASTER) if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate pwd lscpu pip list @@ -122,7 +122,7 @@ jobs: - name: Put benchmark results in same folder if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate pwd cd tests/benchmarks find .benchmarks/ -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2- | tail -n 1 > temp1 @@ -143,7 +143,7 @@ jobs: - name: Compare latest commit results to the master branch results if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate cd tests/benchmarks pwd python compare_bench_results.py diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 07e5a16fd5..58f2c90ad0 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -31,13 +31,13 @@ jobs: run: | gh cache list python -m venv .venv-${{ matrix.python-version }} - source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt - name: Check files using the black formatter run: | - source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate black --version black --check desc/ tests/ || black_return_code=$? echo "BLACK_RETURN_CODE=$black_return_code" >> $GITHUB_ENV diff --git a/.github/workflows/cache_dependencies.yml b/.github/workflows/cache_dependencies.yml index 7bef543c67..9f72682261 100644 --- a/.github/workflows/cache_dependencies.yml +++ b/.github/workflows/cache_dependencies.yml @@ -24,12 +24,16 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Extract Python Minor Version + id: extract_version + run: echo "PYTHON_MINOR_VERSION=$(echo '${{ matrix.python_version }}' | cut -d'.' -f2)" >> $GITHUB_ENV + - name: Delete old cached file with same python version run: | echo "Current Cached files list" gh cache list - echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${{ matrix.python-version | split('.')[1] }}-" - for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${{ matrix.python-version | split('.')[1] }}-\")) | .key"); do + echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${{ env.PYTHON_MINOR_VERSION }}-" + for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${{ env.PYTHON_MINOR_VERSION }}-\")) | .key"); do echo "Deleting cache with key: $cache_key" gh cache delete "$cache_key" done @@ -37,8 +41,8 @@ jobs: # Update the matplotlib version if needed later - name: Set up virtual environment run: | - python -m venv .venv-${{ matrix.python-version | split('.')[1] }} - source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate + python -m venv .venv-${{ env.PYTHON_MINOR_VERSION }} + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -47,12 +51,12 @@ jobs: id: cache-env uses: actions/cache@v4 with: - path: .venv-${{ matrix.python-version | split('.')[1] }} - key: ${{ runner.os }}-venv-${{ matrix.python-version | split('.')[1] }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ env.PYTHON_MINOR_VERSION }} + key: ${{ runner.os }}-venv-${{ env.PYTHON_MINOR_VERSION }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Verify virtual environment activation run: | - source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate python --version pip --version pip list diff --git a/.github/workflows/notebook_tests.yml b/.github/workflows/notebook_tests.yml index 27cab48a41..5309365542 100644 --- a/.github/workflows/notebook_tests.yml +++ b/.github/workflows/notebook_tests.yml @@ -64,7 +64,7 @@ jobs: run: | gh cache list python -m venv .venv-${{ matrix.python-version }} - source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -72,7 +72,7 @@ jobs: - name: Test notebooks with pytest and nbmake if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate pwd lscpu pip list diff --git a/.github/workflows/regression_tests.yml b/.github/workflows/regression_tests.yml index 2b7f4b44d7..cd71796160 100644 --- a/.github/workflows/regression_tests.yml +++ b/.github/workflows/regression_tests.yml @@ -50,20 +50,24 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Extract Python Minor Version + id: extract_version + run: echo "PYTHON_MINOR_VERSION=$(echo '${{ matrix.python_version }}' | cut -d'.' -f2)" >> $GITHUB_ENV + - name: Restore Python environment cache if: env.has_changes == 'true' id: restore-env uses: actions/cache/restore@v4 with: - path: .venv-${{ matrix.python-version | split('.')[1] }} - key: ${{ runner.os }}-venv-${{ matrix.python-version | split('.')[1] }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ env.PYTHON_MINOR_VERSION }} + key: ${{ runner.os }}-venv-${{ env.PYTHON_MINOR_VERSION }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Set up virtual environment if not restored from cache if: steps.restore-env.outputs.cache-hit != 'true' && env.has_changes == 'true' run: | gh cache list - python -m venv .venv-${{ matrix.python-version | split('.')[1] }} - source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate + python -m venv .venv-${{ env.PYTHON_MINOR_VERSION }} + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -77,7 +81,7 @@ jobs: - name: Test with pytest if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version | split('.')[1] }}/bin/activate + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate pwd lscpu pip list diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index e719c01813..d4cef5d97b 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -51,25 +51,29 @@ jobs: id: check_changes run: echo "has_changes=${{ steps.changes.outputs.has_changes }}" >> $GITHUB_ENV - - name: Set up Python ${{ matrix.combos.python_version }} + - name: Set up Python ${{ env.PYTHON_MINOR_VERSION }} uses: actions/setup-python@v5 with: - python-version: ${{ matrix.combos.python_version }} + python-version: ${{ env.PYTHON_MINOR_VERSION }} + + - name: Extract Python Minor Version + id: extract_version + run: echo "PYTHON_MINOR_VERSION=$(echo '${{ env.PYTHON_MINOR_VERSION }}' | cut -d'.' -f2)" >> $GITHUB_ENV - name: Restore Python environment cache if: env.has_changes == 'true' id: restore-env uses: actions/cache/restore@v4 with: - path: .venv-${{ matrix.combos.python_version }} - key: ${{ runner.os }}-venv-${{ matrix.combos.python_version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ env.PYTHON_MINOR_VERSION }} + key: ${{ runner.os }}-venv-${{ env.PYTHON_MINOR_VERSION }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Set up virtual environment if not restored from cache if: steps.restore-env.outputs.cache-hit != 'true' && env.has_changes == 'true' run: | gh cache list - python -m venv .venv-${{ matrix.combos.python_version }} - source .venv-${{ matrix.combos.python_version }}/bin/activate + python -m venv .venv-${{ env.PYTHON_MINOR_VERSION }} + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -84,17 +88,17 @@ jobs: if: env.has_changes == 'true' run: | echo "Checking virtual environment directory" - ls -la .venv-${{ matrix.combos.python_version }}/bin + ls -la .venv-${{ env.PYTHON_MINOR_VERSION }}/bin echo "Trying to activate virtual environment" - source .venv-${{ matrix.combos.python_version }}/bin/activate + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate which python python --version pwd ls -a - ls -a .venv-${{ matrix.combos.python_version }}/bin + ls -a .venv-${{ env.PYTHON_MINOR_VERSION }}/bin lscpu - source .venv-${{ matrix.combos.python_version }}/bin/activate - ls -a .venv-${{ matrix.combos.python_version }}/bin + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + ls -a .venv-${{ env.PYTHON_MINOR_VERSION }}/bin python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip list @@ -102,7 +106,7 @@ jobs: - name: Test with pytest if: env.has_changes == 'true' run: | - source .venv-${{ matrix.combos.python_version }}/bin/activate + source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate python -m pytest -v -m unit \ --durations=0 \ --cov-report xml:cov.xml \ diff --git a/.github/workflows/weekly_tests.yml b/.github/workflows/weekly_tests.yml index b9ca2b9163..ef79f90aa2 100644 --- a/.github/workflows/weekly_tests.yml +++ b/.github/workflows/weekly_tests.yml @@ -18,10 +18,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.combos.python_version }} + - name: Set up Python ${{ env.PYTHON_MINOR_VERSION }} uses: actions/setup-python@v5 with: - python-version: ${{ matrix.combos.python_version }} + python-version: ${{ env.PYTHON_MINOR_VERSION }} - name: Install dependencies run: | python -m pip install --upgrade pip From d261f5db0582d8976ae2bb08ba6a2fa0497cf243 Mon Sep 17 00:00:00 2001 From: YigitElma Date: Wed, 11 Dec 2024 23:13:00 -0500 Subject: [PATCH 11/24] try renaming, revert some other files --- .github/workflows/benchmark.yml | 10 +++--- .github/workflows/black.yml | 4 +-- .github/workflows/cache_dependencies.yml | 28 +++++++-------- .github/workflows/notebook_tests.yml | 4 +-- .github/workflows/regression_tests.yml | 14 +++----- .github/workflows/unit_tests.yml | 44 +++++++++++------------- 6 files changed, 48 insertions(+), 56 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index d757f4ddd6..9f13a85de7 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -71,7 +71,7 @@ jobs: run: | gh cache list python -m venv .venv-${{ matrix.python-version }} - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + source .venv-${{ matrix.python-version }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -79,7 +79,7 @@ jobs: - name: Benchmark with pytest-benchmark (PR) if: env.has_changes == 'true' run: | - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + source .venv-${{ matrix.python-version }}/bin/activate pwd lscpu pip list @@ -106,7 +106,7 @@ jobs: - name: Benchmark with pytest-benchmark (MASTER) if: env.has_changes == 'true' run: | - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + source .venv-${{ matrix.python-version }}/bin/activate pwd lscpu pip list @@ -122,7 +122,7 @@ jobs: - name: Put benchmark results in same folder if: env.has_changes == 'true' run: | - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + source .venv-${{ matrix.python-version }}/bin/activate pwd cd tests/benchmarks find .benchmarks/ -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2- | tail -n 1 > temp1 @@ -143,7 +143,7 @@ jobs: - name: Compare latest commit results to the master branch results if: env.has_changes == 'true' run: | - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + source .venv-${{ matrix.python-version }}/bin/activate cd tests/benchmarks pwd python compare_bench_results.py diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 58f2c90ad0..ae0be3dbb7 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -31,13 +31,13 @@ jobs: run: | gh cache list python -m venv .venv-${{ matrix.python-version }} - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + source .venv-${{ matrix.python-version }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt - name: Check files using the black formatter run: | - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + source .venv-${{ matrix.python-version }}/bin/activate black --version black --check desc/ tests/ || black_return_code=$? echo "BLACK_RETURN_CODE=$black_return_code" >> $GITHUB_ENV diff --git a/.github/workflows/cache_dependencies.yml b/.github/workflows/cache_dependencies.yml index 9f72682261..8763c1a179 100644 --- a/.github/workflows/cache_dependencies.yml +++ b/.github/workflows/cache_dependencies.yml @@ -14,26 +14,26 @@ jobs: GH_TOKEN: ${{ github.token }} strategy: matrix: - python-version: ['3.9', '3.10', '3.11', '3.12'] + combos: + - { python_version: '3.9', venv_suffix: '9' } + - { python_version: '3.10', venv_suffix: '10' } + - { python_version: '3.11', venv_suffix: '11' } + - { python_version: '3.12', venv_suffix: '12' } steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.combos.python_version }} uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} - - - name: Extract Python Minor Version - id: extract_version - run: echo "PYTHON_MINOR_VERSION=$(echo '${{ matrix.python_version }}' | cut -d'.' -f2)" >> $GITHUB_ENV + python-version: ${{ matrix.combos.python_version }} - name: Delete old cached file with same python version run: | echo "Current Cached files list" gh cache list - echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${{ env.PYTHON_MINOR_VERSION }}-" - for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${{ env.PYTHON_MINOR_VERSION }}-\")) | .key"); do + echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-" + for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-\")) | .key"); do echo "Deleting cache with key: $cache_key" gh cache delete "$cache_key" done @@ -41,8 +41,8 @@ jobs: # Update the matplotlib version if needed later - name: Set up virtual environment run: | - python -m venv .venv-${{ env.PYTHON_MINOR_VERSION }} - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + python -m venv .venv-${{ matrix.combos.venv_suffix }} + source .venv-${{ matrix.combos.venv_suffix }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -51,12 +51,12 @@ jobs: id: cache-env uses: actions/cache@v4 with: - path: .venv-${{ env.PYTHON_MINOR_VERSION }} - key: ${{ runner.os }}-venv-${{ env.PYTHON_MINOR_VERSION }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ matrix.combos.venv_suffix }} + key: ${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Verify virtual environment activation run: | - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + source .venv-${{ matrix.combos.venv_suffix }}/bin/activate python --version pip --version pip list diff --git a/.github/workflows/notebook_tests.yml b/.github/workflows/notebook_tests.yml index 5309365542..1d1dc1473c 100644 --- a/.github/workflows/notebook_tests.yml +++ b/.github/workflows/notebook_tests.yml @@ -64,7 +64,7 @@ jobs: run: | gh cache list python -m venv .venv-${{ matrix.python-version }} - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + source .venv-${{ matrix.python-version }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -72,7 +72,7 @@ jobs: - name: Test notebooks with pytest and nbmake if: env.has_changes == 'true' run: | - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + source .venv-${{ matrix.python-version }}/bin/activate pwd lscpu pip list diff --git a/.github/workflows/regression_tests.yml b/.github/workflows/regression_tests.yml index cd71796160..9e648d3ec1 100644 --- a/.github/workflows/regression_tests.yml +++ b/.github/workflows/regression_tests.yml @@ -50,24 +50,20 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Extract Python Minor Version - id: extract_version - run: echo "PYTHON_MINOR_VERSION=$(echo '${{ matrix.python_version }}' | cut -d'.' -f2)" >> $GITHUB_ENV - - name: Restore Python environment cache if: env.has_changes == 'true' id: restore-env uses: actions/cache/restore@v4 with: - path: .venv-${{ env.PYTHON_MINOR_VERSION }} - key: ${{ runner.os }}-venv-${{ env.PYTHON_MINOR_VERSION }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ matrix.python-version }} + key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Set up virtual environment if not restored from cache if: steps.restore-env.outputs.cache-hit != 'true' && env.has_changes == 'true' run: | gh cache list - python -m venv .venv-${{ env.PYTHON_MINOR_VERSION }} - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + python -m venv .venv-${{ matrix.python-version }} + source .venv-${{ matrix.python-version }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -81,7 +77,7 @@ jobs: - name: Test with pytest if: env.has_changes == 'true' run: | - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + source .venv-${{ matrix.python-version }}/bin/activate pwd lscpu pip list diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index d4cef5d97b..6158c6a462 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -22,14 +22,14 @@ jobs: GH_TOKEN: ${{ github.token }} strategy: matrix: - combos: [{group: 1, python_version: '3.9'}, - {group: 2, python_version: '3.10'}, - {group: 3, python_version: '3.11'}, - {group: 4, python_version: '3.12'}, - {group: 5, python_version: '3.12'}, - {group: 6, python_version: '3.12'}, - {group: 7, python_version: '3.12'}, - {group: 8, python_version: '3.12'}] + combos: [{group: 1, python_version: '3.9', venv_suffix: '9'}, + {group: 2, python_version: '3.10', venv_suffix: '10'}, + {group: 3, python_version: '3.11', venv_suffix: '11'}, + {group: 4, python_version: '3.12', venv_suffix: '12'}, + {group: 5, python_version: '3.12', venv_suffix: '12'}, + {group: 6, python_version: '3.12', venv_suffix: '12'}, + {group: 7, python_version: '3.12', venv_suffix: '12'}, + {group: 8, python_version: '3.12', venv_suffix: '12'}] steps: - uses: actions/checkout@v4 @@ -51,29 +51,25 @@ jobs: id: check_changes run: echo "has_changes=${{ steps.changes.outputs.has_changes }}" >> $GITHUB_ENV - - name: Set up Python ${{ env.PYTHON_MINOR_VERSION }} + - name: Set up Python ${{ matrix.combos.python_version }} uses: actions/setup-python@v5 with: - python-version: ${{ env.PYTHON_MINOR_VERSION }} - - - name: Extract Python Minor Version - id: extract_version - run: echo "PYTHON_MINOR_VERSION=$(echo '${{ env.PYTHON_MINOR_VERSION }}' | cut -d'.' -f2)" >> $GITHUB_ENV + python-version: ${{ matrix.combos.python_version }} - name: Restore Python environment cache if: env.has_changes == 'true' id: restore-env uses: actions/cache/restore@v4 with: - path: .venv-${{ env.PYTHON_MINOR_VERSION }} - key: ${{ runner.os }}-venv-${{ env.PYTHON_MINOR_VERSION }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ matrix.combos.venv_suffix }} + key: ${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Set up virtual environment if not restored from cache if: steps.restore-env.outputs.cache-hit != 'true' && env.has_changes == 'true' run: | gh cache list - python -m venv .venv-${{ env.PYTHON_MINOR_VERSION }} - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + python -m venv .venv-${{ matrix.combos.venv_suffix }} + source .venv-${{ matrix.combos.venv_suffix }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -88,17 +84,17 @@ jobs: if: env.has_changes == 'true' run: | echo "Checking virtual environment directory" - ls -la .venv-${{ env.PYTHON_MINOR_VERSION }}/bin + ls -la .venv-${{ matrix.combos.venv_suffix }}/bin echo "Trying to activate virtual environment" - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + source .venv-${{ matrix.combos.venv_suffix }}/bin/activate which python python --version pwd ls -a - ls -a .venv-${{ env.PYTHON_MINOR_VERSION }}/bin + ls -a .venv-${{ matrix.combos.venv_suffix }}/bin lscpu - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate - ls -a .venv-${{ env.PYTHON_MINOR_VERSION }}/bin + source .venv-${{ matrix.combos.venv_suffix }}/bin/activate + ls -a .venv-${{ matrix.combos.venv_suffix }}/bin python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip list @@ -106,7 +102,7 @@ jobs: - name: Test with pytest if: env.has_changes == 'true' run: | - source .venv-${{ env.PYTHON_MINOR_VERSION }}/bin/activate + source .venv-${{ matrix.combos.venv_suffix }}/bin/activate python -m pytest -v -m unit \ --durations=0 \ --cov-report xml:cov.xml \ From 5e210bc3d69e79a6ed9aa25a25ed1f20033186e7 Mon Sep 17 00:00:00 2001 From: YigitElma Date: Wed, 11 Dec 2024 23:22:36 -0500 Subject: [PATCH 12/24] some minor changes --- .github/workflows/unit_tests.yml | 9 --------- .github/workflows/weekly_tests.yml | 4 ++-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 6158c6a462..220262e3ce 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -83,20 +83,11 @@ jobs: - name: Action Details if: env.has_changes == 'true' run: | - echo "Checking virtual environment directory" - ls -la .venv-${{ matrix.combos.venv_suffix }}/bin - echo "Trying to activate virtual environment" source .venv-${{ matrix.combos.venv_suffix }}/bin/activate which python python --version pwd - ls -a - ls -a .venv-${{ matrix.combos.venv_suffix }}/bin lscpu - source .venv-${{ matrix.combos.venv_suffix }}/bin/activate - ls -a .venv-${{ matrix.combos.venv_suffix }}/bin - python -m pip install --upgrade pip - pip install -r devtools/dev-requirements.txt pip list - name: Test with pytest diff --git a/.github/workflows/weekly_tests.yml b/.github/workflows/weekly_tests.yml index ef79f90aa2..b9ca2b9163 100644 --- a/.github/workflows/weekly_tests.yml +++ b/.github/workflows/weekly_tests.yml @@ -18,10 +18,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ env.PYTHON_MINOR_VERSION }} + - name: Set up Python ${{ matrix.combos.python_version }} uses: actions/setup-python@v5 with: - python-version: ${{ env.PYTHON_MINOR_VERSION }} + python-version: ${{ matrix.combos.python_version }} - name: Install dependencies run: | python -m pip install --upgrade pip From d785c8ba97e885238d8ea0c74c8fcca8cecd9058 Mon Sep 17 00:00:00 2001 From: YigitElma Date: Wed, 11 Dec 2024 23:53:46 -0500 Subject: [PATCH 13/24] test with regression to see if it works --- .github/workflows/cache_dependencies.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cache_dependencies.yml b/.github/workflows/cache_dependencies.yml index 8763c1a179..67f57e6d24 100644 --- a/.github/workflows/cache_dependencies.yml +++ b/.github/workflows/cache_dependencies.yml @@ -15,10 +15,10 @@ jobs: strategy: matrix: combos: - - { python_version: '3.9', venv_suffix: '9' } - - { python_version: '3.10', venv_suffix: '10' } - - { python_version: '3.11', venv_suffix: '11' } - - { python_version: '3.12', venv_suffix: '12' } + - {python_version: '3.9', venv_suffix: '9'} + - {python_version: '3.10', venv_suffix: '10'} + - {python_version: '3.11', venv_suffix: '11'} + - {python_version: '3.12', venv_suffix: '12'} steps: - uses: actions/checkout@v4 From c168cdb45ba65ee5a44a998e06c8fc3a4667bff1 Mon Sep 17 00:00:00 2001 From: YigitElma Date: Wed, 11 Dec 2024 23:55:06 -0500 Subject: [PATCH 14/24] test with regression to see if it works --- .github/workflows/regression_tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/regression_tests.yml b/.github/workflows/regression_tests.yml index 9e648d3ec1..866a6abe8f 100644 --- a/.github/workflows/regression_tests.yml +++ b/.github/workflows/regression_tests.yml @@ -55,15 +55,15 @@ jobs: id: restore-env uses: actions/cache/restore@v4 with: - path: .venv-${{ matrix.python-version }} - key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-10 + key: ${{ runner.os }}-venv-10-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Set up virtual environment if not restored from cache if: steps.restore-env.outputs.cache-hit != 'true' && env.has_changes == 'true' run: | gh cache list - python -m venv .venv-${{ matrix.python-version }} - source .venv-${{ matrix.python-version }}/bin/activate + python -m venv .venv-10 + source .venv-10/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -77,7 +77,7 @@ jobs: - name: Test with pytest if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-10/bin/activate pwd lscpu pip list From e70e0af09bfb34392761fc8f0a5d1832b94e5f6a Mon Sep 17 00:00:00 2001 From: YigitElma Date: Thu, 12 Dec 2024 00:17:25 -0500 Subject: [PATCH 15/24] some minor changes --- .github/workflows/cache_dependencies.yml | 1 + .github/workflows/regression_tests.yml | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cache_dependencies.yml b/.github/workflows/cache_dependencies.yml index 67f57e6d24..11ef0fbe39 100644 --- a/.github/workflows/cache_dependencies.yml +++ b/.github/workflows/cache_dependencies.yml @@ -57,6 +57,7 @@ jobs: - name: Verify virtual environment activation run: | source .venv-${{ matrix.combos.venv_suffix }}/bin/activate + which python python --version pip --version pip list diff --git a/.github/workflows/regression_tests.yml b/.github/workflows/regression_tests.yml index 866a6abe8f..9ae47d1f10 100644 --- a/.github/workflows/regression_tests.yml +++ b/.github/workflows/regression_tests.yml @@ -22,7 +22,6 @@ jobs: GH_TOKEN: ${{ github.token }} strategy: matrix: - python-version: ['3.10'] group: [1, 2, 3, 4, 5, 6] steps: @@ -45,10 +44,10 @@ jobs: id: check_changes run: echo "has_changes=${{ steps.changes.outputs.has_changes }}" >> $GITHUB_ENV - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: '3.10' - name: Restore Python environment cache if: env.has_changes == 'true' @@ -98,7 +97,7 @@ jobs: if: always() && env.has_changes == 'true' uses: actions/upload-artifact@v4 with: - name: regression_test_artifact-${{ matrix.python-version }}-${{ matrix.group }} + name: regression_test_artifact-3.10-${{ matrix.group }} path: | ./cov.xml ./mpl_results.html From e0005dce60c7f7e4194cfacabd70911082b5f900 Mon Sep 17 00:00:00 2001 From: YigitElma Date: Thu, 12 Dec 2024 00:50:21 -0500 Subject: [PATCH 16/24] specify python patch too for actions --- .github/workflows/cache_dependencies.yml | 4 ++-- .github/workflows/unit_tests.yml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cache_dependencies.yml b/.github/workflows/cache_dependencies.yml index 11ef0fbe39..ddabe6560a 100644 --- a/.github/workflows/cache_dependencies.yml +++ b/.github/workflows/cache_dependencies.yml @@ -17,8 +17,8 @@ jobs: combos: - {python_version: '3.9', venv_suffix: '9'} - {python_version: '3.10', venv_suffix: '10'} - - {python_version: '3.11', venv_suffix: '11'} - - {python_version: '3.12', venv_suffix: '12'} + - {python_version: '3.11.11', venv_suffix: '11'} + - {python_version: '3.12.8', venv_suffix: '12'} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 220262e3ce..4392c1ed3e 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -24,12 +24,12 @@ jobs: matrix: combos: [{group: 1, python_version: '3.9', venv_suffix: '9'}, {group: 2, python_version: '3.10', venv_suffix: '10'}, - {group: 3, python_version: '3.11', venv_suffix: '11'}, - {group: 4, python_version: '3.12', venv_suffix: '12'}, - {group: 5, python_version: '3.12', venv_suffix: '12'}, - {group: 6, python_version: '3.12', venv_suffix: '12'}, - {group: 7, python_version: '3.12', venv_suffix: '12'}, - {group: 8, python_version: '3.12', venv_suffix: '12'}] + {group: 3, python_version: '3.11.11', venv_suffix: '11'}, + {group: 4, python_version: '3.12.8', venv_suffix: '12'}, + {group: 5, python_version: '3.12.8', venv_suffix: '12'}, + {group: 6, python_version: '3.12.8', venv_suffix: '12'}, + {group: 7, python_version: '3.12.8', venv_suffix: '12'}, + {group: 8, python_version: '3.12.8', venv_suffix: '12'}] steps: - uses: actions/checkout@v4 From 21a19831c676f5e8840d489017ece25bc80b98ed Mon Sep 17 00:00:00 2001 From: YigitElma Date: Thu, 12 Dec 2024 00:58:29 -0500 Subject: [PATCH 17/24] update script to see new cache work with other prs --- .github/workflows/cache_dependencies.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cache_dependencies.yml b/.github/workflows/cache_dependencies.yml index ddabe6560a..8d5166e1d6 100644 --- a/.github/workflows/cache_dependencies.yml +++ b/.github/workflows/cache_dependencies.yml @@ -32,8 +32,8 @@ jobs: run: | echo "Current Cached files list" gh cache list - echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-" - for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-\")) | .key"); do + echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${{ matrix.combos.python_version }}-" + for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${{ matrix.combos.python_version }}-\")) | .key"); do echo "Deleting cache with key: $cache_key" gh cache delete "$cache_key" done @@ -41,8 +41,8 @@ jobs: # Update the matplotlib version if needed later - name: Set up virtual environment run: | - python -m venv .venv-${{ matrix.combos.venv_suffix }} - source .venv-${{ matrix.combos.venv_suffix }}/bin/activate + python -m venv .venv-${{ matrix.combos.python_version }} + source .venv-${{ matrix.combos.python_version }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -51,12 +51,12 @@ jobs: id: cache-env uses: actions/cache@v4 with: - path: .venv-${{ matrix.combos.venv_suffix }} - key: ${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ matrix.combos.python_version }} + key: ${{ runner.os }}-venv-${{ matrix.combos.python_version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Verify virtual environment activation run: | - source .venv-${{ matrix.combos.venv_suffix }}/bin/activate + source .venv-${{ matrix.combos.python_version }}/bin/activate which python python --version pip --version From 455a9184e633684d8b6365d0fac9ccd48e6f1638 Mon Sep 17 00:00:00 2001 From: YigitElma Date: Thu, 12 Dec 2024 01:05:33 -0500 Subject: [PATCH 18/24] revert the change --- .github/workflows/cache_dependencies.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cache_dependencies.yml b/.github/workflows/cache_dependencies.yml index 8d5166e1d6..ddabe6560a 100644 --- a/.github/workflows/cache_dependencies.yml +++ b/.github/workflows/cache_dependencies.yml @@ -32,8 +32,8 @@ jobs: run: | echo "Current Cached files list" gh cache list - echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${{ matrix.combos.python_version }}-" - for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${{ matrix.combos.python_version }}-\")) | .key"); do + echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-" + for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-\")) | .key"); do echo "Deleting cache with key: $cache_key" gh cache delete "$cache_key" done @@ -41,8 +41,8 @@ jobs: # Update the matplotlib version if needed later - name: Set up virtual environment run: | - python -m venv .venv-${{ matrix.combos.python_version }} - source .venv-${{ matrix.combos.python_version }}/bin/activate + python -m venv .venv-${{ matrix.combos.venv_suffix }} + source .venv-${{ matrix.combos.venv_suffix }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -51,12 +51,12 @@ jobs: id: cache-env uses: actions/cache@v4 with: - path: .venv-${{ matrix.combos.python_version }} - key: ${{ runner.os }}-venv-${{ matrix.combos.python_version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ matrix.combos.venv_suffix }} + key: ${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Verify virtual environment activation run: | - source .venv-${{ matrix.combos.python_version }}/bin/activate + source .venv-${{ matrix.combos.venv_suffix }}/bin/activate which python python --version pip --version From 9770c2494b61d956ef4bcdb9414aa96f6a01aaab Mon Sep 17 00:00:00 2001 From: YigitElma Date: Thu, 12 Dec 2024 10:53:04 -0500 Subject: [PATCH 19/24] try new method --- .github/workflows/cache_dependencies.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cache_dependencies.yml b/.github/workflows/cache_dependencies.yml index ddabe6560a..e61b8c536d 100644 --- a/.github/workflows/cache_dependencies.yml +++ b/.github/workflows/cache_dependencies.yml @@ -28,12 +28,17 @@ jobs: with: python-version: ${{ matrix.combos.python_version }} + - name: Check full Python version + run: | + python --version + python_version=$(python --version) + - name: Delete old cached file with same python version run: | echo "Current Cached files list" gh cache list - echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-" - for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-\")) | .key"); do + echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${python_version}-" + for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${python_version}-\")) | .key"); do echo "Deleting cache with key: $cache_key" gh cache delete "$cache_key" done @@ -41,8 +46,8 @@ jobs: # Update the matplotlib version if needed later - name: Set up virtual environment run: | - python -m venv .venv-${{ matrix.combos.venv_suffix }} - source .venv-${{ matrix.combos.venv_suffix }}/bin/activate + python -m venv .venv-${python_version} + source .venv-${python_version}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -51,12 +56,12 @@ jobs: id: cache-env uses: actions/cache@v4 with: - path: .venv-${{ matrix.combos.venv_suffix }} - key: ${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${python_version} + key: ${{ runner.os }}-venv-${python_version}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Verify virtual environment activation run: | - source .venv-${{ matrix.combos.venv_suffix }}/bin/activate + source .venv-${python_version}/bin/activate which python python --version pip --version From 5fdf157ef450cee92f32e6f9b7ac0831c5e4582d Mon Sep 17 00:00:00 2001 From: YigitElma Date: Thu, 12 Dec 2024 10:58:15 -0500 Subject: [PATCH 20/24] try new method --- .github/workflows/cache_dependencies.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cache_dependencies.yml b/.github/workflows/cache_dependencies.yml index e61b8c536d..5b0cd7b8d0 100644 --- a/.github/workflows/cache_dependencies.yml +++ b/.github/workflows/cache_dependencies.yml @@ -37,8 +37,8 @@ jobs: run: | echo "Current Cached files list" gh cache list - echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${python_version}-" - for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${python_version}-\")) | .key"); do + echo "Deleting cached files with pattern: ${{ runner.os }}-venv-$python_version-" + for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-$python_version-\")) | .key"); do echo "Deleting cache with key: $cache_key" gh cache delete "$cache_key" done @@ -46,8 +46,8 @@ jobs: # Update the matplotlib version if needed later - name: Set up virtual environment run: | - python -m venv .venv-${python_version} - source .venv-${python_version}/bin/activate + python -m venv .venv-$python_version + source .venv-$python_version/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -56,12 +56,12 @@ jobs: id: cache-env uses: actions/cache@v4 with: - path: .venv-${python_version} - key: ${{ runner.os }}-venv-${python_version}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-$python_version + key: ${{ runner.os }}-venv-$python_version-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Verify virtual environment activation run: | - source .venv-${python_version}/bin/activate + source .venv-$python_version/bin/activate which python python --version pip --version From 1a54ac38813f25eadab2eeafa4fb5d69ee8df207 Mon Sep 17 00:00:00 2001 From: YigitElma Date: Thu, 12 Dec 2024 11:01:43 -0500 Subject: [PATCH 21/24] still trying --- .github/workflows/cache_dependencies.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cache_dependencies.yml b/.github/workflows/cache_dependencies.yml index 5b0cd7b8d0..1d29e837eb 100644 --- a/.github/workflows/cache_dependencies.yml +++ b/.github/workflows/cache_dependencies.yml @@ -31,7 +31,8 @@ jobs: - name: Check full Python version run: | python --version - python_version=$(python --version) + python_version=$(python --version 2>&1 | cut -d' ' -f2) + echo $python_version - name: Delete old cached file with same python version run: | From 487782e454dd8add1b5aa39e6d015d47e66107e4 Mon Sep 17 00:00:00 2001 From: YigitElma Date: Thu, 12 Dec 2024 11:06:06 -0500 Subject: [PATCH 22/24] ? --- .github/workflows/cache_dependencies.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cache_dependencies.yml b/.github/workflows/cache_dependencies.yml index 1d29e837eb..8919a1123d 100644 --- a/.github/workflows/cache_dependencies.yml +++ b/.github/workflows/cache_dependencies.yml @@ -32,14 +32,15 @@ jobs: run: | python --version python_version=$(python --version 2>&1 | cut -d' ' -f2) - echo $python_version + echo "Python version: $python_version" + echo "version=$python_version" >> $GITHUB_ENV - name: Delete old cached file with same python version run: | echo "Current Cached files list" gh cache list - echo "Deleting cached files with pattern: ${{ runner.os }}-venv-$python_version-" - for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-$python_version-\")) | .key"); do + echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${{ env.version }}-" + for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${{ env.version }}-\")) | .key"); do echo "Deleting cache with key: $cache_key" gh cache delete "$cache_key" done @@ -47,8 +48,8 @@ jobs: # Update the matplotlib version if needed later - name: Set up virtual environment run: | - python -m venv .venv-$python_version - source .venv-$python_version/bin/activate + python -m venv .venv-${{ env.version }} + source .venv-${{ env.version }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -57,12 +58,12 @@ jobs: id: cache-env uses: actions/cache@v4 with: - path: .venv-$python_version - key: ${{ runner.os }}-venv-$python_version-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ env.version }} + key: ${{ runner.os }}-venv-${{ env.version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Verify virtual environment activation run: | - source .venv-$python_version/bin/activate + source .venv-${{ env.version }}/bin/activate which python python --version pip --version From 5768eef67e224e61bcf6d20494b6b04fcb1dfe1b Mon Sep 17 00:00:00 2001 From: YigitElma Date: Thu, 12 Dec 2024 11:16:13 -0500 Subject: [PATCH 23/24] apply --- .github/workflows/cache_dependencies.yml | 10 ++----- .github/workflows/regression_tests.yml | 24 ++++++++++------ .github/workflows/unit_tests.yml | 35 ++++++++++++++---------- 3 files changed, 40 insertions(+), 29 deletions(-) diff --git a/.github/workflows/cache_dependencies.yml b/.github/workflows/cache_dependencies.yml index 8919a1123d..8b8fdc9edb 100644 --- a/.github/workflows/cache_dependencies.yml +++ b/.github/workflows/cache_dependencies.yml @@ -14,19 +14,15 @@ jobs: GH_TOKEN: ${{ github.token }} strategy: matrix: - combos: - - {python_version: '3.9', venv_suffix: '9'} - - {python_version: '3.10', venv_suffix: '10'} - - {python_version: '3.11.11', venv_suffix: '11'} - - {python_version: '3.12.8', venv_suffix: '12'} + python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.combos.python_version }} + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: - python-version: ${{ matrix.combos.python_version }} + python-version: ${{ matrix.python-version }} - name: Check full Python version run: | diff --git a/.github/workflows/regression_tests.yml b/.github/workflows/regression_tests.yml index 9ae47d1f10..19122267c3 100644 --- a/.github/workflows/regression_tests.yml +++ b/.github/workflows/regression_tests.yml @@ -22,6 +22,7 @@ jobs: GH_TOKEN: ${{ github.token }} strategy: matrix: + python-version: ['3.10'] group: [1, 2, 3, 4, 5, 6] steps: @@ -44,25 +45,32 @@ jobs: id: check_changes run: echo "has_changes=${{ steps.changes.outputs.has_changes }}" >> $GITHUB_ENV - - name: Set up Python 3.10 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: ${{ matrix.python-version }} + + - name: Check full Python version + run: | + python --version + python_version=$(python --version 2>&1 | cut -d' ' -f2) + echo "Python version: $python_version" + echo "version=$python_version" >> $GITHUB_ENV - name: Restore Python environment cache if: env.has_changes == 'true' id: restore-env uses: actions/cache/restore@v4 with: - path: .venv-10 - key: ${{ runner.os }}-venv-10-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ env.version }} + key: ${{ runner.os }}-venv-${{ env.version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Set up virtual environment if not restored from cache if: steps.restore-env.outputs.cache-hit != 'true' && env.has_changes == 'true' run: | gh cache list - python -m venv .venv-10 - source .venv-10/bin/activate + python -m venv .venv-${{ env.version }} + source .venv-${{ env.version }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -76,7 +84,7 @@ jobs: - name: Test with pytest if: env.has_changes == 'true' run: | - source .venv-10/bin/activate + source .venv-${{ env.version }}/bin/activate pwd lscpu pip list @@ -97,7 +105,7 @@ jobs: if: always() && env.has_changes == 'true' uses: actions/upload-artifact@v4 with: - name: regression_test_artifact-3.10-${{ matrix.group }} + name: regression_test_artifact-${{ matrix.python-version }}-${{ matrix.group }} path: | ./cov.xml ./mpl_results.html diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 4392c1ed3e..023e6503b3 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -22,14 +22,14 @@ jobs: GH_TOKEN: ${{ github.token }} strategy: matrix: - combos: [{group: 1, python_version: '3.9', venv_suffix: '9'}, - {group: 2, python_version: '3.10', venv_suffix: '10'}, - {group: 3, python_version: '3.11.11', venv_suffix: '11'}, - {group: 4, python_version: '3.12.8', venv_suffix: '12'}, - {group: 5, python_version: '3.12.8', venv_suffix: '12'}, - {group: 6, python_version: '3.12.8', venv_suffix: '12'}, - {group: 7, python_version: '3.12.8', venv_suffix: '12'}, - {group: 8, python_version: '3.12.8', venv_suffix: '12'}] + combos: [{group: 1, python_version: '3.9'}, + {group: 2, python_version: '3.10'}, + {group: 3, python_version: '3.11'}, + {group: 4, python_version: '3.12'}, + {group: 5, python_version: '3.12'}, + {group: 6, python_version: '3.12'}, + {group: 7, python_version: '3.12'}, + {group: 8, python_version: '3.12'}] steps: - uses: actions/checkout@v4 @@ -56,20 +56,27 @@ jobs: with: python-version: ${{ matrix.combos.python_version }} + - name: Check full Python version + run: | + python --version + python_version=$(python --version 2>&1 | cut -d' ' -f2) + echo "Python version: $python_version" + echo "version=$python_version" >> $GITHUB_ENV + - name: Restore Python environment cache if: env.has_changes == 'true' id: restore-env uses: actions/cache/restore@v4 with: - path: .venv-${{ matrix.combos.venv_suffix }} - key: ${{ runner.os }}-venv-${{ matrix.combos.venv_suffix }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ env.version }} + key: ${{ runner.os }}-venv-${{ env.version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Set up virtual environment if not restored from cache if: steps.restore-env.outputs.cache-hit != 'true' && env.has_changes == 'true' run: | gh cache list - python -m venv .venv-${{ matrix.combos.venv_suffix }} - source .venv-${{ matrix.combos.venv_suffix }}/bin/activate + python -m venv .venv-${{ env.version }} + source .venv-${{ env.version }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -83,7 +90,7 @@ jobs: - name: Action Details if: env.has_changes == 'true' run: | - source .venv-${{ matrix.combos.venv_suffix }}/bin/activate + source .venv-${{ env.version }}/bin/activate which python python --version pwd @@ -93,7 +100,7 @@ jobs: - name: Test with pytest if: env.has_changes == 'true' run: | - source .venv-${{ matrix.combos.venv_suffix }}/bin/activate + source .venv-${{ env.version }}/bin/activate python -m pytest -v -m unit \ --durations=0 \ --cov-report xml:cov.xml \ From cd6cf02e7de192fbd69dc4f2d102a1dbb86b560e Mon Sep 17 00:00:00 2001 From: YigitElma Date: Thu, 12 Dec 2024 11:37:07 -0500 Subject: [PATCH 24/24] apply changes to all the actions --- .github/workflows/benchmark.yml | 23 +++++++++++++++-------- .github/workflows/black.yml | 17 ++++++++++++----- .github/workflows/notebook_tests.yml | 17 ++++++++++++----- 3 files changed, 39 insertions(+), 18 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 9f13a85de7..73257e7a6f 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -58,20 +58,27 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Check full Python version + run: | + python --version + python_version=$(python --version 2>&1 | cut -d' ' -f2) + echo "Python version: $python_version" + echo "version=$python_version" >> $GITHUB_ENV + - name: Restore Python environment cache if: env.has_changes == 'true' id: restore-env uses: actions/cache/restore@v4 with: - path: .venv-${{ matrix.python-version }} - key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ env.version }} + key: ${{ runner.os }}-venv-${{ env.version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Set up virtual environment if not restored from cache if: steps.restore-env.outputs.cache-hit != 'true' && env.has_changes == 'true' run: | gh cache list - python -m venv .venv-${{ matrix.python-version }} - source .venv-${{ matrix.python-version }}/bin/activate + python -m venv .venv-${{ env.version }} + source .venv-${{ env.version }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -79,7 +86,7 @@ jobs: - name: Benchmark with pytest-benchmark (PR) if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ env.version }}/bin/activate pwd lscpu pip list @@ -106,7 +113,7 @@ jobs: - name: Benchmark with pytest-benchmark (MASTER) if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ env.version }}/bin/activate pwd lscpu pip list @@ -122,7 +129,7 @@ jobs: - name: Put benchmark results in same folder if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ env.version }}/bin/activate pwd cd tests/benchmarks find .benchmarks/ -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2- | tail -n 1 > temp1 @@ -143,7 +150,7 @@ jobs: - name: Compare latest commit results to the master branch results if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ env.version }}/bin/activate cd tests/benchmarks pwd python compare_bench_results.py diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index ae0be3dbb7..70ee94290e 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -19,25 +19,32 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Check full Python version + run: | + python --version + python_version=$(python --version 2>&1 | cut -d' ' -f2) + echo "Python version: $python_version" + echo "version=$python_version" >> $GITHUB_ENV + - name: Restore Python environment cache id: restore-env uses: actions/cache/restore@v4 with: - path: .venv-${{ matrix.python-version }} - key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ env.version }} + key: ${{ runner.os }}-venv-${{ env.version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Set up virtual environment if not restored from cache if: steps.restore-env.outputs.cache-hit != 'true' run: | gh cache list - python -m venv .venv-${{ matrix.python-version }} - source .venv-${{ matrix.python-version }}/bin/activate + python -m venv .venv-${{ env.version }} + source .venv-${{ env.version }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt - name: Check files using the black formatter run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ env.version }}/bin/activate black --version black --check desc/ tests/ || black_return_code=$? echo "BLACK_RETURN_CODE=$black_return_code" >> $GITHUB_ENV diff --git a/.github/workflows/notebook_tests.yml b/.github/workflows/notebook_tests.yml index 1d1dc1473c..35613aae53 100644 --- a/.github/workflows/notebook_tests.yml +++ b/.github/workflows/notebook_tests.yml @@ -51,20 +51,27 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Check full Python version + run: | + python --version + python_version=$(python --version 2>&1 | cut -d' ' -f2) + echo "Python version: $python_version" + echo "version=$python_version" >> $GITHUB_ENV + - name: Restore Python environment cache if: env.has_changes == 'true' id: restore-env uses: actions/cache/restore@v4 with: - path: .venv-${{ matrix.python-version }} - key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} + path: .venv-${{ env.version }} + key: ${{ runner.os }}-venv-${{ env.version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} - name: Set up virtual environment if not restored from cache if: steps.restore-env.outputs.cache-hit != 'true' && env.has_changes == 'true' run: | gh cache list - python -m venv .venv-${{ matrix.python-version }} - source .venv-${{ matrix.python-version }}/bin/activate + python -m venv .venv-${{ env.version }} + source .venv-${{ env.version }}/bin/activate python -m pip install --upgrade pip pip install -r devtools/dev-requirements.txt pip install matplotlib==3.9.2 @@ -72,7 +79,7 @@ jobs: - name: Test notebooks with pytest and nbmake if: env.has_changes == 'true' run: | - source .venv-${{ matrix.python-version }}/bin/activate + source .venv-${{ env.version }}/bin/activate pwd lscpu pip list