pyFroniusReg/noxfile.py

33 lines
801 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-09 17:08:43 +11:00
@nox.session
def lint(session):
session.install('ruff')
session.run('ruff', 'check', '--exclude', 'examples')
2024-10-09 18:18:24 +11:00
@nox.session
def build_and_check_dists(session):
session.install("build", "check-manifest >= 0.42", "twine")
# session.run("check-manifest", "--ignore", "noxfile.py,tests/**,examples/**")
session.run("python", "-m", "build")
session.run("python", "-m", "twine", "check", "dist/*")
2024-10-11 14:58:36 +11:00
@nox.session
def build(session):
lint(session)
build_and_check_dists(session)
2024-10-09 16:48:52 +11:00
@nox.session
def tests(session):
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
session.run('pytest')