forked from thebigmunch/audio-metadata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
73 lines (56 loc) · 1.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
import os
import shutil
import nox
ON_GITHUB = 'GITHUB_ACTIONS' in os.environ
py36 = '3.6'
py37 = '3.7'
py38 = '3.8'
py39 = '3.9'
nox.options.reuse_existing_virtualenvs = True
nox.options.sessions = [
'lint',
'doc',
'test'
]
@nox.session
def lint(session):
session.install('-U', '.[lint]')
session.run('flake8', 'src/', 'tests/')
@nox.session
def doc(session):
shutil.rmtree('docs/_build', ignore_errors=True)
session.install('-U', '.[doc]')
session.cd('docs')
session.run(
'sphinx-build',
'-b',
'html',
'-W',
'-d',
'_build/doctrees',
'.',
'_build/html'
)
@nox.session(python=[py36, py37, py38, py39])
def test(session):
session.install('-U', '.[test]')
session.run('coverage', 'run', '-m', 'ward', *session.posargs)
session.notify('report')
@nox.session(python=[py36, py37, py38, py39])
def integration(session):
session.install('-U', '.[test]')
session.run('coverage', 'run', '-m', 'ward', '--tags', 'integration', *session.posargs)
session.notify('report')
@nox.session(python=[py36, py37, py38, py39])
def unit(session):
session.install('-U', '.[test]')
session.run('coverage', 'run', '-m', 'ward', '--tags', 'unit', *session.posargs)
session.notify('report')
@nox.session
def report(session):
session.install('-U', 'coverage[toml]')
if ON_GITHUB:
session.run('coverage', 'xml')
else:
session.run('coverage', 'report', '-m')
session.run('coverage', 'erase')