From 5521ec5d5f144f3a5ff3dac343a8fe777759742e Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 10:54:03 +0200 Subject: [PATCH 01/17] Drop upper version limit for tables package The limit was needed when using python3.8, which is not supported anymore. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f108aad3..caeedec8 100755 --- a/setup.py +++ b/setup.py @@ -62,7 +62,7 @@ def read(*names, **kwargs): "setuptools >= 54.2.0", "shapely", "sqlalchemy < 2", - "tables < 3.9", + "tables", "tilemapbase == 0.4.5", "tsam", ], From 2755d00ee85bda1aa587623a68a5efc1444bc376 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 12:06:48 +0200 Subject: [PATCH 02/17] Exclude python3.9 for macOS from CI tests --- .github/workflows/ci.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fe3de817..dcb40f9b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,7 +4,7 @@ on: {push: {branches: ['**']}, pull_request: {branches: [dev, master]}} jobs: build: - name: ${{ matrix.os.name }} + name: ${{ matrix.os.name }} - Python ${{ matrix.python-version }} runs-on: ${{ matrix.os.image }} strategy: @@ -13,6 +13,10 @@ jobs: - {image: ubuntu-latest, name: Linux} - {image: windows-latest, name: Windows} - {image: macos-latest, name: macOS} + python-version: [3, 3.9, 3.10, 3.11] + exclude: + - os: {image: macos-latest, name: macOS} + python-version: 3.9 max-parallel: 4 fail-fast: false @@ -20,11 +24,7 @@ jobs: - uses: "actions/checkout@main" - uses: "actions/setup-python@main" with: - python-version: | - 3 - 3.9 - 3.10 - 3.11 + python-version: ${{ matrix.python-version }} - name: "Install dependencies" run: | python -mpip install --progress-bar=off nox From 529e4758376859e4057812ca88cf3121f8f1d399 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 12:08:20 +0200 Subject: [PATCH 03/17] Drop python version 3.1 --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dcb40f9b..5400dce5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ jobs: - {image: ubuntu-latest, name: Linux} - {image: windows-latest, name: Windows} - {image: macos-latest, name: macOS} - python-version: [3, 3.9, 3.10, 3.11] + python-version: [3.9, 3.10, 3.11] exclude: - os: {image: macos-latest, name: macOS} python-version: 3.9 From 5ee430106e85aaa8d1b46337816bec17a4bb4385 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 12:09:39 +0200 Subject: [PATCH 04/17] Really remove python version 3.1 --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5400dce5..28f36b9b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ jobs: - {image: ubuntu-latest, name: Linux} - {image: windows-latest, name: Windows} - {image: macos-latest, name: macOS} - python-version: [3.9, 3.10, 3.11] + python-version: [3, 3.9, "3.10", 3.11] exclude: - os: {image: macos-latest, name: macOS} python-version: 3.9 From 3058f71d85da7d49bb49ba2a542e360ab82f4c29 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 12:24:30 +0200 Subject: [PATCH 05/17] Run noxfile tests only for activa python versions --- noxfile.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/noxfile.py b/noxfile.py index 998766b9..200fcb4d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -65,6 +65,10 @@ def flake8(session): @nox.session(python=["3", "3.9", "3.10", "3.11"]) def build(session): """Build the package and check for packaging errors.""" + current_version = f"{sys.version_info.major}.{sys.version_info.minor}" + # Skip the session if it doesn't match the current CI Python version + if session.python and session.python != current_version: + session.skip(f"Skipping tests for Python {session.python} since the current Python version is {current_version}.") setdefaults(session) session.install("twine") session.run("python", "setup.py", "bdist", "bdist_wheel") @@ -74,6 +78,10 @@ def build(session): @nox.session(python=["3", "3.9", "3.10", "3.11"]) def install(session): """Install the package.""" + current_version = f"{sys.version_info.major}.{sys.version_info.minor}" + # Skip the session if it doesn't match the current CI Python version + if session.python and session.python != current_version: + session.skip(f"Skipping tests for Python {session.python} since the current Python version is {current_version}.") setdefaults(session) session.env["SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL"] = "False" session.run("python", "-mpip", "install", "--upgrade", "pip") From 5663a9e25435a0bc621cc71e970c298ced80032d Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 12:24:53 +0200 Subject: [PATCH 06/17] Group checks per os --- .github/workflows/ci.yaml | 97 +++++++++++++++++++++++++++++---------- 1 file changed, 72 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 28f36b9b..ea3c3a6f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,24 +1,19 @@ name: "CI" -on: {push: {branches: ['**']}, pull_request: {branches: [dev, master]}} +on: + push: + branches: ['**'] + pull_request: + branches: [dev, master] jobs: - build: - name: ${{ matrix.os.name }} - Python ${{ matrix.python-version }} - runs-on: ${{ matrix.os.image }} + linux: + name: Linux + runs-on: ubuntu-latest strategy: matrix: - os: - - {image: ubuntu-latest, name: Linux} - - {image: windows-latest, name: Windows} - - {image: macos-latest, name: macOS} python-version: [3, 3.9, "3.10", 3.11] - exclude: - - os: {image: macos-latest, name: macOS} - python-version: 3.9 - max-parallel: 4 - fail-fast: false steps: - uses: "actions/checkout@main" @@ -33,25 +28,77 @@ jobs: nox --version - name: "Run custom checks" run: "python -m nox -s check" - env: - PLATFORM: ${{ matrix.os.image }} - name: "Check with `black`" run: "python -m nox -s black" - env: - PLATFORM: ${{ matrix.os.image }} - name: "Check with `flake8`" run: "python -m nox -s flake8" - env: - PLATFORM: ${{ matrix.os.image }} - name: "Check with `isort`" run: "python -m nox -s isort" - env: - PLATFORM: ${{ matrix.os.image }} - name: "Build and check for packaging errors" run: "python -m nox -s build" - env: - PLATFORM: ${{ matrix.os.image }} - name: "Install the package" run: "python -m nox -s install" - env: - PLATFORM: ${{ matrix.os.image }} + + windows: + name: Windows + runs-on: windows-latest + + strategy: + matrix: + python-version: [3, 3.9, "3.10", 3.11] + + steps: + - uses: "actions/checkout@main" + - uses: "actions/setup-python@main" + with: + python-version: ${{ matrix.python-version }} + - name: "Install dependencies" + run: | + python -mpip install --progress-bar=off nox + python --version + pip --version + nox --version + - name: "Run custom checks" + run: "python -m nox -s check" + - name: "Check with `black`" + run: "python -m nox -s black" + - name: "Check with `flake8`" + run: "python -m nox -s flake8" + - name: "Check with `isort`" + run: "python -m nox -s isort" + - name: "Build and check for packaging errors" + run: "python -m nox -s build" + - name: "Install the package" + run: "python -m nox -s install" + + macos: + name: macOS + runs-on: macos-latest + + strategy: + matrix: + python-version: [3, "3.10", 3.11] # Exclude Python 3.9 here + + steps: + - uses: "actions/checkout@main" + - uses: "actions/setup-python@main" + with: + python-version: ${{ matrix.python-version }} + - name: "Install dependencies" + run: | + python -mpip install --progress-bar=off nox + python --version + pip --version + nox --version + - name: "Run custom checks" + run: "python -m nox -s check" + - name: "Check with `black`" + run: "python -m nox -s black" + - name: "Check with `flake8`" + run: "python -m nox -s flake8" + - name: "Check with `isort`" + run: "python -m nox -s isort" + - name: "Build and check for packaging errors" + run: "python -m nox -s build" + - name: "Install the package" + run: "python -m nox -s install" From 6a65fe83851cf04c9b5fad896d21a9d5bcd01f35 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 12:28:07 +0200 Subject: [PATCH 07/17] Apply black --- noxfile.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 200fcb4d..bdcacb9f 100644 --- a/noxfile.py +++ b/noxfile.py @@ -68,7 +68,9 @@ def build(session): current_version = f"{sys.version_info.major}.{sys.version_info.minor}" # Skip the session if it doesn't match the current CI Python version if session.python and session.python != current_version: - session.skip(f"Skipping tests for Python {session.python} since the current Python version is {current_version}.") + session.skip( + f"Skipping tests for Python {session.python} since the current Python version is {current_version}." + ) setdefaults(session) session.install("twine") session.run("python", "setup.py", "bdist", "bdist_wheel") @@ -81,7 +83,9 @@ def install(session): current_version = f"{sys.version_info.major}.{sys.version_info.minor}" # Skip the session if it doesn't match the current CI Python version if session.python and session.python != current_version: - session.skip(f"Skipping tests for Python {session.python} since the current Python version is {current_version}.") + session.skip( + f"Skipping tests for Python {session.python} since the current Python version is {current_version}." + ) setdefaults(session) session.env["SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL"] = "False" session.run("python", "-mpip", "install", "--upgrade", "pip") From b34da9e89bc8d49e8e994fc194f122b8a3065a65 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 12:47:04 +0200 Subject: [PATCH 08/17] Import sys package --- noxfile.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index bdcacb9f..d3320797 100644 --- a/noxfile.py +++ b/noxfile.py @@ -2,6 +2,7 @@ from pprint import pformat import nox +import sys cleaned = [ "etrago/cluster/disaggregation.py", @@ -69,7 +70,8 @@ def build(session): # Skip the session if it doesn't match the current CI Python version if session.python and session.python != current_version: session.skip( - f"Skipping tests for Python {session.python} since the current Python version is {current_version}." + f"""Skipping tests for Python {session.python} since the + current Python version is {current_version}.""" ) setdefaults(session) session.install("twine") @@ -84,7 +86,8 @@ def install(session): # Skip the session if it doesn't match the current CI Python version if session.python and session.python != current_version: session.skip( - f"Skipping tests for Python {session.python} since the current Python version is {current_version}." + f"""Skipping tests for Python {session.python} since the + current Python version is {current_version}.""" ) setdefaults(session) session.env["SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL"] = "False" From e5e7542d7edcea86ca9e033d90cd42ee500f1e33 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 12:53:32 +0200 Subject: [PATCH 09/17] Apply isort --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index d3320797..a224384d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,8 +1,8 @@ from pathlib import Path from pprint import pformat +import sys import nox -import sys cleaned = [ "etrago/cluster/disaggregation.py", From 392cdb187afa833e62f7db5701a5ff8077527632 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 12:53:52 +0200 Subject: [PATCH 10/17] Tryout other grouping option --- .github/workflows/ci.yaml | 91 +++++++++++---------------------------- 1 file changed, 24 insertions(+), 67 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ea3c3a6f..047ea4e2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,13 +7,22 @@ on: branches: [dev, master] jobs: - linux: - name: Linux - runs-on: ubuntu-latest + build: + name: ${{ matrix.os.name }} + runs-on: ${{ matrix.os.image }} strategy: matrix: + os: + - {image: ubuntu-latest, name: Linux} + - {image: windows-latest, name: Windows} + - {image: macos-latest, name: macOS} python-version: [3, 3.9, "3.10", 3.11] + exclude: + - os: {image: macos-latest, name: macOS} + python-version: 3.9 + max-parallel: 4 + fail-fast: false steps: - uses: "actions/checkout@main" @@ -28,77 +37,25 @@ jobs: nox --version - name: "Run custom checks" run: "python -m nox -s check" + env: + PLATFORM: ${{ matrix.os.image }} - name: "Check with `black`" run: "python -m nox -s black" + env: + PLATFORM: ${{ matrix.os.image }} - name: "Check with `flake8`" run: "python -m nox -s flake8" + env: + PLATFORM: ${{ matrix.os.image }} - name: "Check with `isort`" run: "python -m nox -s isort" + env: + PLATFORM: ${{ matrix.os.image }} - name: "Build and check for packaging errors" run: "python -m nox -s build" + env: + PLATFORM: ${{ matrix.os.image }} - name: "Install the package" run: "python -m nox -s install" - - windows: - name: Windows - runs-on: windows-latest - - strategy: - matrix: - python-version: [3, 3.9, "3.10", 3.11] - - steps: - - uses: "actions/checkout@main" - - uses: "actions/setup-python@main" - with: - python-version: ${{ matrix.python-version }} - - name: "Install dependencies" - run: | - python -mpip install --progress-bar=off nox - python --version - pip --version - nox --version - - name: "Run custom checks" - run: "python -m nox -s check" - - name: "Check with `black`" - run: "python -m nox -s black" - - name: "Check with `flake8`" - run: "python -m nox -s flake8" - - name: "Check with `isort`" - run: "python -m nox -s isort" - - name: "Build and check for packaging errors" - run: "python -m nox -s build" - - name: "Install the package" - run: "python -m nox -s install" - - macos: - name: macOS - runs-on: macos-latest - - strategy: - matrix: - python-version: [3, "3.10", 3.11] # Exclude Python 3.9 here - - steps: - - uses: "actions/checkout@main" - - uses: "actions/setup-python@main" - with: - python-version: ${{ matrix.python-version }} - - name: "Install dependencies" - run: | - python -mpip install --progress-bar=off nox - python --version - pip --version - nox --version - - name: "Run custom checks" - run: "python -m nox -s check" - - name: "Check with `black`" - run: "python -m nox -s black" - - name: "Check with `flake8`" - run: "python -m nox -s flake8" - - name: "Check with `isort`" - run: "python -m nox -s isort" - - name: "Build and check for packaging errors" - run: "python -m nox -s build" - - name: "Install the package" - run: "python -m nox -s install" + env: + PLATFORM: ${{ matrix.os.image }} From b05f9588697166217098d0b49dec0546a3a81176 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 12:56:13 +0200 Subject: [PATCH 11/17] Revert "Tryout other grouping option" This reverts commit 392cdb187afa833e62f7db5701a5ff8077527632. --- .github/workflows/ci.yaml | 91 ++++++++++++++++++++++++++++----------- 1 file changed, 67 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 047ea4e2..ea3c3a6f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,22 +7,13 @@ on: branches: [dev, master] jobs: - build: - name: ${{ matrix.os.name }} - runs-on: ${{ matrix.os.image }} + linux: + name: Linux + runs-on: ubuntu-latest strategy: matrix: - os: - - {image: ubuntu-latest, name: Linux} - - {image: windows-latest, name: Windows} - - {image: macos-latest, name: macOS} python-version: [3, 3.9, "3.10", 3.11] - exclude: - - os: {image: macos-latest, name: macOS} - python-version: 3.9 - max-parallel: 4 - fail-fast: false steps: - uses: "actions/checkout@main" @@ -37,25 +28,77 @@ jobs: nox --version - name: "Run custom checks" run: "python -m nox -s check" - env: - PLATFORM: ${{ matrix.os.image }} - name: "Check with `black`" run: "python -m nox -s black" - env: - PLATFORM: ${{ matrix.os.image }} - name: "Check with `flake8`" run: "python -m nox -s flake8" - env: - PLATFORM: ${{ matrix.os.image }} - name: "Check with `isort`" run: "python -m nox -s isort" - env: - PLATFORM: ${{ matrix.os.image }} - name: "Build and check for packaging errors" run: "python -m nox -s build" - env: - PLATFORM: ${{ matrix.os.image }} - name: "Install the package" run: "python -m nox -s install" - env: - PLATFORM: ${{ matrix.os.image }} + + windows: + name: Windows + runs-on: windows-latest + + strategy: + matrix: + python-version: [3, 3.9, "3.10", 3.11] + + steps: + - uses: "actions/checkout@main" + - uses: "actions/setup-python@main" + with: + python-version: ${{ matrix.python-version }} + - name: "Install dependencies" + run: | + python -mpip install --progress-bar=off nox + python --version + pip --version + nox --version + - name: "Run custom checks" + run: "python -m nox -s check" + - name: "Check with `black`" + run: "python -m nox -s black" + - name: "Check with `flake8`" + run: "python -m nox -s flake8" + - name: "Check with `isort`" + run: "python -m nox -s isort" + - name: "Build and check for packaging errors" + run: "python -m nox -s build" + - name: "Install the package" + run: "python -m nox -s install" + + macos: + name: macOS + runs-on: macos-latest + + strategy: + matrix: + python-version: [3, "3.10", 3.11] # Exclude Python 3.9 here + + steps: + - uses: "actions/checkout@main" + - uses: "actions/setup-python@main" + with: + python-version: ${{ matrix.python-version }} + - name: "Install dependencies" + run: | + python -mpip install --progress-bar=off nox + python --version + pip --version + nox --version + - name: "Run custom checks" + run: "python -m nox -s check" + - name: "Check with `black`" + run: "python -m nox -s black" + - name: "Check with `flake8`" + run: "python -m nox -s flake8" + - name: "Check with `isort`" + run: "python -m nox -s isort" + - name: "Build and check for packaging errors" + run: "python -m nox -s build" + - name: "Install the package" + run: "python -m nox -s install" From 43261d55e5dbc665e3379387b017e3d4b2a21e17 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 13:10:59 +0200 Subject: [PATCH 12/17] Undo changes in ci file --- .github/workflows/ci.yaml | 101 ++++++++++---------------------------- 1 file changed, 27 insertions(+), 74 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ea3c3a6f..fe3de817 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,89 +1,30 @@ name: "CI" -on: - push: - branches: ['**'] - pull_request: - branches: [dev, master] +on: {push: {branches: ['**']}, pull_request: {branches: [dev, master]}} jobs: - linux: - name: Linux - runs-on: ubuntu-latest + build: + name: ${{ matrix.os.name }} + runs-on: ${{ matrix.os.image }} strategy: matrix: - python-version: [3, 3.9, "3.10", 3.11] + os: + - {image: ubuntu-latest, name: Linux} + - {image: windows-latest, name: Windows} + - {image: macos-latest, name: macOS} + max-parallel: 4 + fail-fast: false steps: - uses: "actions/checkout@main" - uses: "actions/setup-python@main" with: - python-version: ${{ matrix.python-version }} - - name: "Install dependencies" - run: | - python -mpip install --progress-bar=off nox - python --version - pip --version - nox --version - - name: "Run custom checks" - run: "python -m nox -s check" - - name: "Check with `black`" - run: "python -m nox -s black" - - name: "Check with `flake8`" - run: "python -m nox -s flake8" - - name: "Check with `isort`" - run: "python -m nox -s isort" - - name: "Build and check for packaging errors" - run: "python -m nox -s build" - - name: "Install the package" - run: "python -m nox -s install" - - windows: - name: Windows - runs-on: windows-latest - - strategy: - matrix: - python-version: [3, 3.9, "3.10", 3.11] - - steps: - - uses: "actions/checkout@main" - - uses: "actions/setup-python@main" - with: - python-version: ${{ matrix.python-version }} - - name: "Install dependencies" - run: | - python -mpip install --progress-bar=off nox - python --version - pip --version - nox --version - - name: "Run custom checks" - run: "python -m nox -s check" - - name: "Check with `black`" - run: "python -m nox -s black" - - name: "Check with `flake8`" - run: "python -m nox -s flake8" - - name: "Check with `isort`" - run: "python -m nox -s isort" - - name: "Build and check for packaging errors" - run: "python -m nox -s build" - - name: "Install the package" - run: "python -m nox -s install" - - macos: - name: macOS - runs-on: macos-latest - - strategy: - matrix: - python-version: [3, "3.10", 3.11] # Exclude Python 3.9 here - - steps: - - uses: "actions/checkout@main" - - uses: "actions/setup-python@main" - with: - python-version: ${{ matrix.python-version }} + python-version: | + 3 + 3.9 + 3.10 + 3.11 - name: "Install dependencies" run: | python -mpip install --progress-bar=off nox @@ -92,13 +33,25 @@ jobs: nox --version - name: "Run custom checks" run: "python -m nox -s check" + env: + PLATFORM: ${{ matrix.os.image }} - name: "Check with `black`" run: "python -m nox -s black" + env: + PLATFORM: ${{ matrix.os.image }} - name: "Check with `flake8`" run: "python -m nox -s flake8" + env: + PLATFORM: ${{ matrix.os.image }} - name: "Check with `isort`" run: "python -m nox -s isort" + env: + PLATFORM: ${{ matrix.os.image }} - name: "Build and check for packaging errors" run: "python -m nox -s build" + env: + PLATFORM: ${{ matrix.os.image }} - name: "Install the package" run: "python -m nox -s install" + env: + PLATFORM: ${{ matrix.os.image }} From de205762a68eac2957441020fa08d54d4ad8139f Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 13:12:19 +0200 Subject: [PATCH 13/17] Exclude python3.9 on macOS in noxfile --- noxfile.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/noxfile.py b/noxfile.py index a224384d..49710f46 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,5 +1,6 @@ from pathlib import Path from pprint import pformat +import platform import sys import nox @@ -66,13 +67,14 @@ def flake8(session): @nox.session(python=["3", "3.9", "3.10", "3.11"]) def build(session): """Build the package and check for packaging errors.""" + # Get the current Python version and OS current_version = f"{sys.version_info.major}.{sys.version_info.minor}" - # Skip the session if it doesn't match the current CI Python version - if session.python and session.python != current_version: - session.skip( - f"""Skipping tests for Python {session.python} since the - current Python version is {current_version}.""" - ) + current_os = platform.system() + + # Check if the current session is Python 3.9 on macOS and skip + if current_version == "3.9" and current_os == "Darwin": + session.skip("Skipping tests for Python 3.9 on macOS") + setdefaults(session) session.install("twine") session.run("python", "setup.py", "bdist", "bdist_wheel") @@ -82,13 +84,14 @@ def build(session): @nox.session(python=["3", "3.9", "3.10", "3.11"]) def install(session): """Install the package.""" + # Get the current Python version and OS current_version = f"{sys.version_info.major}.{sys.version_info.minor}" - # Skip the session if it doesn't match the current CI Python version - if session.python and session.python != current_version: - session.skip( - f"""Skipping tests for Python {session.python} since the - current Python version is {current_version}.""" - ) + current_os = platform.system() + + # Check if the current session is Python 3.9 on macOS and skip + if current_version == "3.9" and current_os == "Darwin": + session.skip("Skipping tests for Python 3.9 on macOS") + setdefaults(session) session.env["SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL"] = "False" session.run("python", "-mpip", "install", "--upgrade", "pip") From 5451844d9961491b816dd19a07537eb9df7b2513 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 13:23:28 +0200 Subject: [PATCH 14/17] Add print statements to find problems --- noxfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/noxfile.py b/noxfile.py index 49710f46..af9a24e8 100644 --- a/noxfile.py +++ b/noxfile.py @@ -70,6 +70,7 @@ def build(session): # Get the current Python version and OS current_version = f"{sys.version_info.major}.{sys.version_info.minor}" current_os = platform.system() + print(f"Running install on Python {current_version} and OS {current_os}") # Check if the current session is Python 3.9 on macOS and skip if current_version == "3.9" and current_os == "Darwin": @@ -87,6 +88,7 @@ def install(session): # Get the current Python version and OS current_version = f"{sys.version_info.major}.{sys.version_info.minor}" current_os = platform.system() + print(f"Running install on Python {current_version} and OS {current_os}") # Check if the current session is Python 3.9 on macOS and skip if current_version == "3.9" and current_os == "Darwin": From ca38f12ef62ce2583c9337b11412ef106067dd76 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 13:57:51 +0200 Subject: [PATCH 15/17] Add option to see print statements --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fe3de817..bd99f6c9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -54,4 +54,5 @@ jobs: - name: "Install the package" run: "python -m nox -s install" env: + PYTHONUNBUFFERED: "1" # Ensure Python output is unbuffered PLATFORM: ${{ matrix.os.image }} From 72018332a577544653bf5b9bdad4c44708f0557f Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 14:03:17 +0200 Subject: [PATCH 16/17] Check python version of nox session --- noxfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index af9a24e8..2c2636b2 100644 --- a/noxfile.py +++ b/noxfile.py @@ -68,7 +68,7 @@ def flake8(session): def build(session): """Build the package and check for packaging errors.""" # Get the current Python version and OS - current_version = f"{sys.version_info.major}.{sys.version_info.minor}" + current_version = session.python if session.python else "unknown" current_os = platform.system() print(f"Running install on Python {current_version} and OS {current_os}") @@ -86,7 +86,7 @@ def build(session): def install(session): """Install the package.""" # Get the current Python version and OS - current_version = f"{sys.version_info.major}.{sys.version_info.minor}" + current_version = session.python if session.python else "unknown" current_os = platform.system() print(f"Running install on Python {current_version} and OS {current_os}") From 119cf6876bbde20a80349bb08aacf27752503d3b Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 14:07:46 +0200 Subject: [PATCH 17/17] Delete unused package import --- noxfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 2c2636b2..a161d0ca 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,7 +1,6 @@ from pathlib import Path from pprint import pformat import platform -import sys import nox