forked from pypa/packaging.python.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnox.py
More file actions
25 lines (20 loc) · 699 Bytes
/
nox.py
File metadata and controls
25 lines (20 loc) · 699 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
# 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
def build(session):
session.interpreter = 'python3.6'
session.install('-r', 'requirements.txt')
# Treat warnings as errors.
session.env['SPHINXOPTS'] = '-W'
session.run(shutil.rmtree, 'build', ignore_errors=True)
session.run('sphinx-build', '-W', '-b', 'html', 'source', 'build')
@nox.session
def preview(session):
session.reuse_existing_virtualenv = True
build(session)
session.chdir('build')
session.run('python', '-m', 'http.server')