forked from reef-technologies/django-fingerprint-rt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoxfile.py
33 lines (26 loc) · 1.02 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
import nox
from pathlib import Path
ROOT = Path('.')
PYTHON_VERSIONS = ['3.9', '3.10'][::-1]
DJANGO_VERSIONS = ['3.2', '4.0', '4.1', '4.2'][::-1]
DEMO_APP_DIR = ROOT / 'demo'
TEST_REQUIREMENTS = [
'.',
'pytest', 'pytest-django',
'ipdb', 'freezegun',
'psycopg2-binary',
'django-debug-toolbar',
]
nox.options.default_venv_backend = 'venv'
nox.options.stop_on_first_error = True
nox.options.reuse_existing_virtualenvs = True
@nox.session(python=PYTHON_VERSIONS)
def lint(session):
session.install('flake8', 'mypy', 'django-stubs', 'types-requests', '.')
session.run('flake8', '--ignore', 'E501', str(DEMO_APP_DIR))
session.run('mypy', str(DEMO_APP_DIR))
@nox.session(python=PYTHON_VERSIONS)
@nox.parametrize('django', DJANGO_VERSIONS)
def test(session, django: str):
session.install(f'django~={django}.0', *TEST_REQUIREMENTS)
session.run('pytest', '-W', 'ignore::DeprecationWarning', '-s', '-vv', str(DEMO_APP_DIR / 'demo' / 'tests'), *session.posargs, env={'DJANGO_SETTINGS_MODULE': 'demo.settings'})