-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
46 lines (35 loc) · 1.51 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
import nox
PROJECT = 'steps'
VERSIONS = [f"3.{x}" for x in range(7, 12)]
@nox.session(reuse_venv=True)
def tests(session):
"""Run unit tests in current Python environment."""
session.install('pytest', 'pytest-cov', 'pandas')
session.install('.')
session.run('pytest')
# @nox.session(venv_backend="conda", python=VERSIONS, reuse_venv=True)
# def test_multiple(session):
# """Run unit tests in multiple Python environments."""
# session.install('pytest', 'pytest-cov')
# session.install('.')
# session.run('pytest')
@nox.session(python=False)
def lint(session):
"""Lint source code using Pylint, Flake8 and Mypy."""
session.run('pylint', PROJECT, '--verbose')
session.run('flake8', PROJECT, '--count', '--statistics', '--select=E9,F63,F7,F82', '--show-source') # these fail
session.run('flake8', PROJECT, '--count', '--statistics', '--exit-zero') # these warn
session.run('mypy', '-p', PROJECT)
@nox.session(python=False)
def docs(session):
"""Build package documentation."""
session.run('sphinx-apidoc', PROJECT, '-o', 'docs/source/')
session.run('sphinx-build', '-b', 'html', 'docs/source/', 'docs/build/html')
@nox.session(python=False)
def qa(session):
"""Run QA code checks."""
session.run('check-manifest')
session.run('isort', '.')
session.run('pre-commit', 'run', 'trailing-whitespace', '--files', '*.py')
session.run('pre-commit', 'run', 'end-of-file-fixer', '--files', '*.py')
session.run('pre-commit', 'run', 'check-yaml', '--all-files')