yoga/noxfile.py

65 lines
1.3 KiB
Python
Raw Normal View History

import nox
2021-03-29 13:46:56 +02:00
PYTHON_FILES = [
"yoga",
"test",
"setup.py",
"noxfile.py",
]
2024-01-06 16:44:25 +01:00
PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"]
2021-03-29 13:46:56 +02:00
2021-04-06 15:58:23 +02:00
@nox.session(reuse_venv=True)
def lint(session):
2022-10-15 11:12:10 +02:00
session.install("flake8", "black", "codespell")
2021-03-29 13:46:56 +02:00
session.run("flake8", *PYTHON_FILES)
2021-04-12 18:07:05 +02:00
session.run(
"black",
"--line-length=79",
"--check",
"--diff",
"--color",
*PYTHON_FILES,
)
2022-10-15 11:12:10 +02:00
session.run(
"codespell",
"-L",
2023-08-28 10:13:12 +02:00
"ans,alph,ccompiler",
2022-10-15 11:12:10 +02:00
"doc/",
"scripts/",
"test/",
"winbuild/",
"yoga/",
"noxfile.py",
"README.rst",
"setup.py",
)
2021-04-16 11:40:03 +02:00
@nox.session(reuse_venv=True)
def black_fix(session):
session.install("black")
session.run("black", *PYTHON_FILES)
2024-01-06 16:44:25 +01:00
@nox.session(python=PYTHON_VERSIONS, reuse_venv=True)
def test(session):
session.install("pytest")
session.install(".")
session.run("pytest", "-v", "test")
2021-01-18 15:25:50 +01:00
2024-01-06 16:44:25 +01:00
@nox.session(reuse_venv=False)
def test_build_wheel(session):
session.install("build")
session.run("python", "-m", "build")
2021-04-06 15:58:23 +02:00
@nox.session(reuse_venv=True)
2021-01-18 15:25:50 +01:00
def gendoc(session):
session.install("sphinx", "sphinx-rtd-theme")
session.install(".")
2021-01-18 15:25:50 +01:00
session.run("sphinx-build", "-M", "html", "doc", "build")