chore: improvements to the noxfile
This commit is contained in:
@@ -54,7 +54,7 @@ repos:
|
|||||||
- types-toml
|
- types-toml
|
||||||
- id: mypy
|
- id: mypy
|
||||||
name: mypy 3.7+ on bin/
|
name: mypy 3.7+ on bin/
|
||||||
files: ^(bin|docs)/.*py$
|
files: ^((bin|docs)/.*py|noxfile.py)$
|
||||||
args: ["--python-version=3.7", "--scripts-are-modules"]
|
args: ["--python-version=3.7", "--scripts-are-modules"]
|
||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
- packaging>=21.0
|
- packaging>=21.0
|
||||||
|
|||||||
+16
-10
@@ -12,7 +12,7 @@ DIR = Path(__file__).parent.resolve()
|
|||||||
|
|
||||||
|
|
||||||
@nox.session
|
@nox.session
|
||||||
def tests(session):
|
def tests(session: nox.Session) -> None:
|
||||||
"""
|
"""
|
||||||
Run the unit and regular tests.
|
Run the unit and regular tests.
|
||||||
"""
|
"""
|
||||||
@@ -26,16 +26,16 @@ def tests(session):
|
|||||||
|
|
||||||
|
|
||||||
@nox.session
|
@nox.session
|
||||||
def lint(session):
|
def lint(session: nox.Session) -> None:
|
||||||
"""
|
"""
|
||||||
Run the linter.
|
Run the linter.
|
||||||
"""
|
"""
|
||||||
session.install("pre-commit")
|
session.install("pre-commit")
|
||||||
session.run("pre-commit", "run", "--all-files")
|
session.run("pre-commit", "run", "--all-files", *session.posargs)
|
||||||
|
|
||||||
|
|
||||||
@nox.session(python=PYTHON_ALL_VERSIONS)
|
@nox.session(python=PYTHON_ALL_VERSIONS)
|
||||||
def update_constraints(session):
|
def update_constraints(session: nox.Session) -> None:
|
||||||
"""
|
"""
|
||||||
Update the dependencies inplace.
|
Update the dependencies inplace.
|
||||||
"""
|
"""
|
||||||
@@ -44,7 +44,7 @@ def update_constraints(session):
|
|||||||
|
|
||||||
|
|
||||||
@nox.session
|
@nox.session
|
||||||
def update_pins(session):
|
def update_pins(session: nox.Session) -> None:
|
||||||
"""
|
"""
|
||||||
Update the python and docker pins version inplace.
|
Update the python and docker pins version inplace.
|
||||||
"""
|
"""
|
||||||
@@ -54,16 +54,22 @@ def update_pins(session):
|
|||||||
|
|
||||||
|
|
||||||
@nox.session
|
@nox.session
|
||||||
def update_proj(session):
|
def update_proj(session: nox.Session) -> None:
|
||||||
"""
|
"""
|
||||||
Update the README inplace.
|
Update the README inplace.
|
||||||
"""
|
"""
|
||||||
session.install("-e", ".[bin]")
|
session.install("-e", ".[bin]")
|
||||||
session.run("python", "bin/projects.py", "docs/data/projects.yml", "--readme=README.md")
|
session.run(
|
||||||
|
"python",
|
||||||
|
"bin/projects.py",
|
||||||
|
"docs/data/projects.yml",
|
||||||
|
"--readme=README.md",
|
||||||
|
*session.posargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@nox.session
|
@nox.session
|
||||||
def docs(session):
|
def docs(session: nox.Session) -> None:
|
||||||
"""
|
"""
|
||||||
Build the docs.
|
Build the docs.
|
||||||
"""
|
"""
|
||||||
@@ -73,13 +79,13 @@ def docs(session):
|
|||||||
if "serve" in session.posargs:
|
if "serve" in session.posargs:
|
||||||
session.run("mkdocs", "serve")
|
session.run("mkdocs", "serve")
|
||||||
else:
|
else:
|
||||||
print("Unrecognized args, use 'serve'")
|
session.error("Unrecognized args, use 'serve'")
|
||||||
else:
|
else:
|
||||||
session.run("mkdocs", "build")
|
session.run("mkdocs", "build")
|
||||||
|
|
||||||
|
|
||||||
@nox.session
|
@nox.session
|
||||||
def build(session):
|
def build(session: nox.Session) -> None:
|
||||||
"""
|
"""
|
||||||
Build an SDist and wheel.
|
Build an SDist and wheel.
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user