pyFroniusReg/noxfile.py

37 lines
911 B
Python
Raw Normal View History

2024-10-09 16:48:52 +11:00
import nox
2024-10-09 18:18:24 +11:00
import os
2024-10-09 16:48:52 +11:00
2024-10-14 17:02:50 +11:00
2024-10-09 17:08:43 +11:00
@nox.session
def lint(session):
2024-10-14 17:02:50 +11:00
session.install("ruff")
session.run("ruff", "check", "--exclude", "examples", "--exclude", "tools")
2024-10-14 20:19:38 +11:00
session.run("ruff", "check", "--extend-select", "N", "src/pyfroniusreg/froniusreg.py")
2024-10-14 17:02:50 +11:00
2024-10-09 17:08:43 +11:00
2024-10-09 18:18:24 +11:00
@nox.session
def build_and_check_dists(session):
session.install("build", "check-manifest >= 0.42", "twine")
2024-11-05 15:20:43 +11:00
session.run("check-manifest", "--ignore", "noxfile.py,tests/**,examples/**")
2024-10-09 18:18:24 +11:00
session.run("python", "-m", "build")
session.run("python", "-m", "twine", "check", "dist/*")
2024-10-14 17:02:50 +11:00
2024-10-11 14:58:36 +11:00
@nox.session
def build(session):
lint(session)
build_and_check_dists(session)
2024-10-14 17:02:50 +11:00
2024-10-09 16:48:52 +11:00
@nox.session
def tests(session):
2024-10-14 17:02:50 +11:00
session.install("pytest")
2024-10-09 18:18:24 +11:00
build_and_check_dists(session)
generated_files = os.listdir("dist/")
generated_sdist = os.path.join("dist/", generated_files[1])
session.install(generated_sdist)
2024-10-09 16:48:52 +11:00
2024-10-14 17:02:50 +11:00
session.run("pytest")