Skip to content
Snippets Groups Projects
Commit 1f52da23 authored by Frederik Hennig's avatar Frederik Hennig
Browse files

fix python versions in nox sessions

parent 14f14723
No related branches found
No related tags found
1 merge request!10Introduce Nox for Test Automation
Pipeline #71550 passed
...@@ -36,7 +36,7 @@ testsuite: ...@@ -36,7 +36,7 @@ testsuite:
- docker - docker
before_script: before_script:
- pip install "git+https://i10git.cs.fau.de/pycodegen/pystencils.git@v2.0-dev" - pip install "git+https://i10git.cs.fau.de/pycodegen/pystencils.git@v2.0-dev"
- pip install -e .[tests] - pip install -e .[testsuite]
script: script:
- pytest -v --cov=src/pystencilssfg --cov-report=term --cov-config=pyproject.toml - pytest -v --cov=src/pystencilssfg --cov-report=term --cov-config=pyproject.toml
- coverage html - coverage html
......
...@@ -18,7 +18,7 @@ def add_pystencils_git(session: nox.Session): ...@@ -18,7 +18,7 @@ def add_pystencils_git(session: nox.Session):
"--branch", "--branch",
"v2.0-dev", "v2.0-dev",
"--single-branch", "--single-branch",
"git@i10git.cs.fau.de:pycodegen/pystencils.git", "https://i10git.cs.fau.de/pycodegen/pystencils.git",
pystencils_dir, pystencils_dir,
external=True, external=True,
) )
...@@ -29,10 +29,12 @@ def editable_install(session: nox.Session, opts: Sequence[str] = ()): ...@@ -29,10 +29,12 @@ def editable_install(session: nox.Session, opts: Sequence[str] = ()):
add_pystencils_git(session) add_pystencils_git(session)
if opts: if opts:
opts_str = "[" + ",".join(opts) + "]" opts_str = "[" + ",".join(opts) + "]"
else:
opts_str = ""
session.install("-e", f".{opts_str}") session.install("-e", f".{opts_str}")
@nox.session(tags=["qa", "code-quality"]) @nox.session(python="3.10", tags=["qa", "code-quality"])
def lint(session: nox.Session): def lint(session: nox.Session):
"""Lint code using flake8""" """Lint code using flake8"""
...@@ -40,7 +42,7 @@ def lint(session: nox.Session): ...@@ -40,7 +42,7 @@ def lint(session: nox.Session):
session.run("flake8", "src/pystencilssfg") session.run("flake8", "src/pystencilssfg")
@nox.session(tags=["qa", "code-quality"]) @nox.session(python="3.10", tags=["qa", "code-quality"])
def typecheck(session: nox.Session): def typecheck(session: nox.Session):
"""Run MyPy for static type checking""" """Run MyPy for static type checking"""
editable_install(session) editable_install(session)
...@@ -48,7 +50,7 @@ def typecheck(session: nox.Session): ...@@ -48,7 +50,7 @@ def typecheck(session: nox.Session):
session.run("mypy", "src/pystencilssfg") session.run("mypy", "src/pystencilssfg")
@nox.session(tags=["tests"]) @nox.session(python=["3.10"], tags=["tests"])
def testsuite(session: nox.Session): def testsuite(session: nox.Session):
"""Run the testsuite and measure coverage.""" """Run the testsuite and measure coverage."""
editable_install(session, ["testsuite"]) editable_install(session, ["testsuite"])
...@@ -69,7 +71,7 @@ def report_coverage(session: nox.Session): ...@@ -69,7 +71,7 @@ def report_coverage(session: nox.Session):
session.run("coverage", "xml") session.run("coverage", "xml")
@nox.session(tags=["docs"]) @nox.session(python=["3.10"], tags=["docs"])
def docs(session: nox.Session): def docs(session: nox.Session):
"""Build the documentation pages""" """Build the documentation pages"""
editable_install(session, ["docs"]) editable_install(session, ["docs"])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment