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
31 lines (23 loc) · 786 Bytes
/
Copy pathnoxfile.py
File metadata and controls
31 lines (23 loc) · 786 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
30
31
# 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"
extra_args = "-H", "0.0.0.0"
else:
command = "sphinx-build"
extra_args = ()
session.run(command, *extra_args, "-W", "-b", "html", "source", "build")
@nox.session(py="3")
def preview(session):
session.install("sphinx-autobuild")
build(session, autobuild=True)