-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnoxfile.py
38 lines (28 loc) · 1.07 KB
/
noxfile.py
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
32
33
34
35
36
37
38
import nox
nox.options.reuse_existing_virtualenvs = True
nox.options.sessions = ["build"] # default session
nox.options.stop_on_first_error = True
BUILD_CFG = "pelicanconf.py"
PUBLISH_CFG = "publishconf.py"
@nox.session
def build(session):
"""Build local version of site"""
session.install("-r", "requirements.txt")
session.run("pelican", "-s", BUILD_CFG, *session.posargs)
@nox.session
def rebuild(session):
"""`build` with the delete switch"""
session.install("-r", "requirements.txt")
session.run("pelican", "-d", "-s", BUILD_CFG, *session.posargs)
@nox.session
def serve(session):
"""Build the site and then serve it locally, watching for changes"""
session.install("-r", "requirements.txt")
# It appears that -r causes a build implicitly
# session.run('pelican', '-s', BUILD_CFG, *session.posargs)
session.run("pelican", "-lr", "-s", BUILD_CFG)
@nox.session
def publish(session):
"""Build published version of site"""
session.install("-r", "requirements.txt")
session.run("pelican", "-s", PUBLISH_CFG, *session.posargs)