-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoxfile.py
142 lines (120 loc) · 4.39 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import nox
import os
from pathlib import Path
import shutil
module_name = "shazzam"
nox.options.reuse_existing_virtualenvs = True
version = os.getenv("version_number", "0.0.1")
"""
This session will install the library
"""
@nox.session(python=False)
def install(session):
"""Install the library."""
session.run("pip", "install", ".")
"""
This session will run the unit tests.
"""
@nox.session(python=["3.8"])
def tests(session):
"""Run the tests and coverage."""
session.install("-r", "deployments/requirements_run.txt")
session.install("-r", "deployments/requirements_test.txt")
session.run("pytest", "-rs", "tests/")
coverage_run_params = [
"run", "-m", "pytest", '-W', 'ignore::UserWarning', "--html", "docs/reports/pytest/pytest.html", "-s"
]
session.run("coverage", "report")
session.run("coverage", "html", "-d", "docs/reports/coverage")
"""
This session will generate the docs.
"""
@nox.session(python=["3.8"])
def docs(session):
"""Generate the docs."""
session.install("-r", "deployments/requirements_run.txt")
session.install("-r", "deployments/requirements_docs.txt")
shutil.rmtree('docs/html', ignore_errors=True)
session.run("pdoc3", "-o", "docs/html", "--html", "shazzam", "examples")
"""
This session will install the 3rd party tools.
"""
@nox.session(python=False)
def install_3rd_party(session):
# check deps
session.run("make", "--version")
session.run("cargo", "--version")
session.run("wget", "--version")
session.run("tar", "--version")
session.run("unzip", "-h")
session.run("gcc", "--version")
session.run("npm", "--version")
shutil.rmtree('third_party', ignore_errors=True)
os.makedirs("third_party", exist_ok = True)
session.cd("third_party")
# install python libraries not available on pip
session.run("pip", "install", "-r", "deployment/requirements_run/txt")
# exomizer
os.makedirs("exomizer", exist_ok = True)
session.cd("exomizer")
session.run("wget", "https://bitbucket.org/magli143/exomizer/wiki/downloads/exomizer-3.1.0.zip")
session.run("unzip", "exomizer-3.1.0.zip")
session.cd("src")
session.run("make")
session.run("cp", "exomizer", "..")
session.cd("..")
session.run("rm", "exomizer-3.1.0.zip")
session.cd("..")
# apultra
session.run("git", "clone", "https://github.com/emmanuel-marty/apultra.git")
session.cd("apultra")
session.run("make", "all")
session.cd("..")
# lzsa
session.run("git", "clone", "https://github.com/emmanuel-marty/lzsa.git")
session.cd("lzsa")
session.run("make", "all")
session.cd("..")
# pucrunch
session.run("git", "clone", "https://github.com/mist64/pucrunch.git")
session.cd("pucrunch")
session.run("make", "all")
session.cd("..")
# pucrunch
session.run("git", "clone", "https://github.com/shazz/c64f.git")
session.cd("c64f")
session.run("make")
session.cd("..")
# nucrunch
session.run("wget", "https://csdb.dk/release/download.php?id=206619", "-O", "nucrunch.tgz")
session.run("tar", "-xvzf", "nucrunch.tgz")
session.run("mv", "nucrunch-1.0.1", "nucrunch")
session.cd("nucrunch")
session.run("make")
session.run("cp", "target/release/nucrunch", ".")
session.cd("..")
session.run("rm", "nucrunch.tgz")
# doynamite
session.run("wget", "https://csdb.dk/release/download.php?id=160764", "-O", "doynamite.tar.gz")
session.run("tar", "-xvzf", "doynamite.tar.gz")
session.run("mv", "doynamite1.1", "doynamite")
session.cd("doynamite")
session.run("gcc", "lz.c", "-o", "lz")
session.cd("..")
session.run("rm", "doynamite.tar.gz")
# Sparkle
session.run("wget", "https://csdb.dk/release/download.php?id=241780", "-O", "sparkle.zip")
session.run("unzip", "sparkle.zip", "-d", "sparkle")
session.run("rm", "sparkle.zip")
# c64jasm
session.run("git", "clone", "https://github.com/nurpax/c64jasm.git")
session.cd("c64jasm")
session.run("npm", "install", ".")
session.run("npm", "run-script", "dist")
session.run("ln", "-s", "dist/src/cli.js", "c64jasm")
session.cd("..")
# cc65
session.run("git", "clone", "https://github.com/cc65/cc65.git")
session.cd("cc65")
session.run("make", "all")
session.cd("..")