-
Notifications
You must be signed in to change notification settings - Fork 11
/
noxfile.py
60 lines (49 loc) · 1.62 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
import nox
nox.options.sessions = ["pre_commit", "tests"]
@nox.session
def pre_commit(session):
"""pre-commit checks"""
session.install("pre-commit")
session.run("pre-commit", "run", "-a")
@nox.session(python=["pypy3", "3.6", "3.7", "3.8"])
def tests(session):
"""Run unit test over different python env with code coverage"""
session.install("pytest", "pytest-cov", "ruamel.yaml", "-e", ".")
session.run(
"py.test",
"--cov=linkstatus",
"--cov-report",
"term-missing",
"--cov-branch",
"--color=yes",
"-s",
"-v",
)
@nox.session()
def ci_tests(session):
"""This is only to run test on ci"""
session.install("pytest", "pytest-cov", "coverage", "ruamel.yaml", "-e", ".")
session.run(
"py.test",
"--cov=linkstatus",
"--cov-report=xml",
"--cov-branch",
"--color=yes",
"-s",
"-v",
)
session.run("coverage", "report")
@nox.session()
def package(session):
"""Build and verify package"""
session.install("twine", "setuptools", "wheel")
session.run("python", "setup.py", "sdist", "bdist_wheel")
session.run("ls", "-l", "dist")
session.run("python", "-m", "twine", "check", "dist/*")
@nox.session()
def dev_setup(session):
"""Ensure development environment works everywhere. mainly with ci on different platform"""
session.run("python", "-m", "pip", "install", "-e", ".[dev]")
session.run("python", "-c", "import linkstatus; print(linkstatus.__spec__)")
session.install("pytest", "ruamel.yaml")
session.run("py.test", "-v", "tests/test_linkstatus.py")