File: noxfile.py

package info (click to toggle)
sphinx-favicon 1.0.1-4
  • links: PTS
  • area: main
  • in suites: sid, trixie
  • size: 268 kB
  • sloc: python: 448; makefile: 4
file content (42 lines) | stat: -rw-r--r-- 1,103 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""Test process to run in isolated environments."""

import nox


@nox.session(reuse_venv=True)
def test(session):
    """Apply the tests on the lib."""
    session.install(".[test]")
    test_files = session.posargs or ["tests"]
    session.run("pytest", "--color=yes", "--cov", "--cov-report=html", *test_files)


@nox.session(name="mypy", reuse_venv=True)
def mypy(session):
    """Run the mypy evaluation of the lib."""
    session.install(".")
    session.install("mypy")
    test_files = session.posargs or ["sphinx_favicon"]
    session.run(
        "mypy",
        "--ignore-missing-imports",
        "--install-types",
        "--non-interactive",
        *test_files,
    )


@nox.session(name="docs", reuse_venv=True)
def docs(session):
    """Build the docs."""
    session.install(".[doc]")
    session.run(
        "sphinx-build", "-b=html", *session.posargs, "docs/source", "docs/build/html"
    )


@nox.session(reuse_venv=True)
def lint(session):
    """Run pre-commit linting checks."""
    session.install(".[test]")
    session.run("pre-commit", "run", "--all-files", external=True)