From 7033baf8e534c30c572ea1f20e79fe72c0255b00 Mon Sep 17 00:00:00 2001
From: Frederik Hennig <frederik.hennig@fau.de>
Date: Thu, 30 Jan 2025 08:26:31 +0100
Subject: [PATCH] Adapt noxfile and CI

 - Pull pystencils before every testsuite run
 - Permit all Python versions since 3.10
 - Add python 3.13 testsuite run to CI
---
 .gitlab-ci.yml | 14 +++++++++++---
 noxfile.py     | 11 +++++++++--
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b89453e..41e3a70 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -23,12 +23,10 @@ typechecker:
   script:
     - nox --session typecheck
 
-testsuite:
+.testsuite-base:
   extends: .nox-base
   stage: "Tests"
   needs: []
-  script:
-    - nox --session testsuite
   coverage: '/TOTAL.*\s+(\d+%)$/'
   artifacts:
     when: always
@@ -40,6 +38,16 @@ testsuite:
         coverage_format: cobertura
         path: coverage.xml
 
+"testsuite-py3.10":
+  extends: .testsuite-base
+  script:
+    - nox --session testsuite-3.10
+
+"testsuite-py3.13":
+  extends: .testsuite-base
+  script:
+    - nox --session testsuite-3.13
+
 build-documentation:
   extends: .nox-base
   stage: "Documentation"
diff --git a/noxfile.py b/noxfile.py
index 915ab84..a725b7b 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -11,7 +11,14 @@ def add_pystencils_git(session: nox.Session):
     cache_dir = session.cache_dir
 
     pystencils_dir = cache_dir / "pystencils"
-    if not pystencils_dir.exists():
+    if pystencils_dir.exists():
+        with session.chdir(pystencils_dir):
+            session.run_install(
+                "git",
+                "pull",
+                external=True
+            )
+    else:
         session.run_install(
             "git",
             "clone",
@@ -50,7 +57,7 @@ def typecheck(session: nox.Session):
     session.run("mypy", "src/pystencilssfg")
 
 
-@nox.session(python=["3.10"], tags=["tests"])
+@nox.session(python=["3.10", "3.11", "3.12", "3.13"], tags=["tests"])
 def testsuite(session: nox.Session):
     """Run the testsuite and measure coverage."""
     editable_install(session, ["testsuite"])
-- 
GitLab