-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
48 lines (37 loc) · 1.2 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
import nox
nox.options.sessions = ["pre_commit", "tests", "coverage"]
@nox.session
def pre_commit(session):
"""pre-commit checks"""
session.install("pre-commit")
session.run("pre-commit", "run", "-a")
@nox.session
def tests(session):
"""Run unit test over different python env with code coverage"""
session.install("pytest", "pytest-cov", "-e", ".")
session.run(
"py.test",
"--cov=xrectsel",
"--cov-report=xml",
"--cov-branch",
"--color=yes",
"-s",
"-v",
)
@nox.session
def coverage(session):
"""This is only to run test on ci"""
session.install("coverage")
session.run("coverage", "report")
@nox.session
def package(session):
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/*")
session.run("rm", "-rf", "build", "dist", external=True)
@nox.session
def dev_setup(session):
"""Ensure development environment works"""
session.run("python", "-m", "pip", "install", "-e", ".[dev]")
session.run("python", "-c", "from xrectsel import XRectSel; XRectSel()")