Browse Source

Feat: start using nox

master
Bertrand Benjamin 1 year ago
parent
commit
1a4e8ffb19
2 changed files with 37 additions and 0 deletions
  1. +2
    -0
      .gitignore
  2. +35
    -0
      noxfile.py

+ 2
- 0
.gitignore View File

@ -4,5 +4,7 @@ dist/
build/
*.egg-info/
documentation/build/
documentation/source/_build/
cache/
venv/
.nox

+ 35
- 0
noxfile.py View File

@ -0,0 +1,35 @@
#!/usr/bin/env python
import nox
@nox.session
def lint(session):
session.install("black")
session.run("black", "mapytex", "noxfile.py", "setup.py")
@nox.session
def test(session):
session.install("-r", "requirements.txt")
session.install("pytest")
session.run("pytest", "mapytex")
@nox.session
def docs(session):
"""Build the documentation."""
session.run("rm", "-rf", "documentation/_build", external=True)
session.install("sphinx", "sphinx-autobuild", "sphinx_rtd_theme")
session.install(".")
session.cd("documentation/source")
sphinx_args = ["-b", "html", "-W", "-d", "_build/doctrees", ".", "_build/html"]
if not session.interactive:
sphinx_cmd = "sphinx-build"
else:
sphinx_cmd = "sphinx-autobuild"
sphinx_args.insert(0, "--open-browser")
session.run(sphinx_cmd, *sphinx_args)

Loading…
Cancel
Save