Feat: start using nox
This commit is contained in:
parent
931e55c35e
commit
9c25142a4b
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,5 +4,7 @@ dist/
|
|||||||
build/
|
build/
|
||||||
*.egg-info/
|
*.egg-info/
|
||||||
documentation/build/
|
documentation/build/
|
||||||
|
documentation/source/_build/
|
||||||
cache/
|
cache/
|
||||||
venv/
|
venv/
|
||||||
|
.nox
|
||||||
|
35
noxfile.py
Normal file
35
noxfile.py
Normal 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…
Reference in New Issue
Block a user