From 4f5ebf5fc4f9c3c7dbf4bda0e5ae45f674fc0c2c Mon Sep 17 00:00:00 2001 From: Maciej Urbanski Date: Sat, 27 Jan 2024 10:13:22 +0100 Subject: [PATCH] autodetect CI python --- noxfile.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/noxfile.py b/noxfile.py index dbc25683..e89b7c77 100644 --- a/noxfile.py +++ b/noxfile.py @@ -13,6 +13,7 @@ import pathlib import re import subprocess +import sys import nox @@ -22,6 +23,13 @@ CI = os.environ.get('CI') is not None NOX_PYTHONS = os.environ.get('NOX_PYTHONS') +if CI and not NOX_PYTHONS: + interpreter_version = f"{sys.version_info.major}.{sys.version_info.minor}" + print( + f"CI job mode; using provided interpreter only; equivalent to NOX_PYTHONS={interpreter_version}" + ) + NOX_PYTHONS = interpreter_version + PYTHON_VERSIONS = [ 'pypy3.9', 'pypy3.10',