-
Notifications
You must be signed in to change notification settings - Fork 3
/
noxfile.py
32 lines (25 loc) · 1.04 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
import nox
from pathlib import Path
ROOT = Path('.')
PYTHON_VERSIONS = ['3.9', '3.10', '3.11'][::-1]
DJANGO_VERSIONS = ['3.2', '4.0', '4.1', '4.2'][::-1]
DEMO_APP_DIR = ROOT / 'demo'
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',
'pytest', 'pytest-django',
'ipdb', 'freezegun',
'psycopg2-binary',
'-e', '.[apple_in_app,google_in_app,default_plan]',
)
session.run('pytest', '-W', 'ignore::DeprecationWarning', '-s', '-vv', str(DEMO_APP_DIR / 'demo' / 'tests'), *session.posargs, env={'DJANGO_SETTINGS_MODULE': 'demo.settings'})