forked from pypa/packaging.python.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnoxfile.py
More file actions
29 lines (21 loc) · 712 Bytes
/
noxfile.py
File metadata and controls
29 lines (21 loc) · 712 Bytes
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
# Copyright 2017, PyPA
# The Python Packaging User Guide is licensed under a Creative Commons
# Attribution-ShareAlike license:
# http://creativecommons.org/licenses/by-sa/3.0.
import shutil
import nox
@nox.session(py="3")
def build(session, autobuild=False):
session.install("-r", "requirements.txt")
# Treat warnings as errors.
session.env["SPHINXOPTS"] = "-W"
shutil.rmtree("build", ignore_errors=True)
if autobuild:
command = "sphinx-autobuild"
else:
command = "sphinx-build"
session.run(command, "-W", "-b", "html", "source", "build")
@nox.session(py="3")
def preview(session):
session.install("sphinx-autobuild")
build(session, autobuild=True)