/
ubuild.py
44 lines (34 loc) · 1.16 KB
/
ubuild.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
import subprocess
def main(build):
build.packages.install(".", develop=True)
def test(build):
main(build)
build.packages.install("jedi")
build.packages.install("pytest")
build.packages.install("pytest-cov")
build.packages.install("pytest-aiohttp")
pytest = os.path.join(build.root, "bin", "py.test")
subprocess.call([
pytest, "--cov", "aiohttp_transmute",
"aiohttp_transmute/tests",
"--cov-report", "term-missing"
] + build.options.args)
def publish(build):
""" distribute the uranium package """
build.packages.install("wheel")
build.executables.run([
"python", "setup.py",
"sdist", "bdist_wheel", "--universal", "upload", "--release"
])
def stamp(build):
""" after a distribution, stamp the current build. """
build.packages.install("gitchangelog")
changelog_text = subprocess.check_output(["gitchangelog"])
with open(os.path.join(build.root, "CHANGELOG"), "wb+") as fh:
fh.write(changelog_text)
def build_docs(build):
build.packages.install("sphinx")
return subprocess.call(
["make", "html"], cwd=os.path.join(build.root, "docs")
)