forked from jrkerns/pylinac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoxfile.py
44 lines (35 loc) · 1.18 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
39
40
41
42
43
44
import os
from pathlib import Path
import nox
@nox.session(python=["3.6", "3.9"], reuse_venv=False)
def run_tests(session):
session.install("-r", "requirements-dev.txt")
session.run("pytest", "-n", "5")
@nox.session(python=False)
def serve_docs(session):
session.run(
"sphinx-autobuild",
"docs/source",
"docs/build",
"--port",
"8777",
"--open-browser",
)
@nox.session(python=False)
def build_docs(session):
session.run("sphinx-build", "docs/source", "docs/build")
@nox.session(python=False)
def update_dev_kraken(session):
"""Run the Kraken build to update it with new pylinac changes"""
if Path("GCP_creds.json").exists():
os.environ["GCP_BUILD_CREDS"] = Path("gcp_build_creds.json").open().read()
key_info = os.environ["GCP_BUILD_CREDS"]
with open("service_key.json", "w") as key_file:
key_file.write(key_info)
session.run(
"gcloud", "auth", "activate-service-account", "--key-file", "service_key.json"
)
session.run("gcloud", "config", "set", "project", "radmachine")
session.run(
"gcloud", "builds", "triggers", "run", "kraken-build", "--branch=master"
)