From a4d2d28e17eea16873b9a0b5472a079a490cdbfb Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 13 Aug 2024 14:36:48 +0200 Subject: [PATCH] Do not test installation with python3.9 on macOS There are problems with the package tables that can not be resolved. Checks work fine with another python version or OS. --- noxfile.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/noxfile.py b/noxfile.py index 998766b9..a161d0ca 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,5 +1,6 @@ from pathlib import Path from pprint import pformat +import platform import nox @@ -65,6 +66,15 @@ 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 = session.python if session.python else "unknown" + 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": + session.skip("Skipping tests for Python 3.9 on macOS") + setdefaults(session) session.install("twine") session.run("python", "setup.py", "bdist", "bdist_wheel") @@ -74,6 +84,15 @@ 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 = session.python if session.python else "unknown" + 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": + 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")