-
Notifications
You must be signed in to change notification settings - Fork 7
/
tox.ini
95 lines (93 loc) · 3.69 KB
/
tox.ini
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
[tox]
envlist = tests
skipsdist = true
requires =
tox>=3.25.0,<4
tox-envfile
tox-faster
tox-run-command
[testenv]
skip_install = true
setenv =
PYTHONUNBUFFERED = 1
OBJC_DISABLE_INITIALIZE_FORK_SAFETY = YES
dev: DEV = {env:DEV:true}
dev: SENTRY_ENVIRONMENT = {env:SENTRY_ENVIRONMENT:dev}
dev: NEW_RELIC_APP_NAME = {env:NEW_RELIC_APP_NAME:via}
dev: NEW_RELIC_ENVIRONMENT = {env:NEW_RELIC_ENVIRONMENT:dev}
dev,tests,functests: PYTHONDEVMODE = {env:PYTHONDEVMODE:1}
tests: COVERAGE_FILE = {env:COVERAGE_FILE:.coverage.{envname}}
dev: ALEMBIC_CONFIG = {env:ALEMBIC_CONFIG:conf/alembic.ini}
dev: DATABASE_URL = {env:DATABASE_URL:postgresql://postgres@localhost:4433/postgres}
tests: DATABASE_URL = {env:UNITTESTS_DATABASE_URL:postgresql://postgres@localhost:4433/via_tests}
functests: DATABASE_URL = {env:FUNCTESTS_DATABASE_URL:postgresql://postgres@localhost:4433/via_functests}
# Make `import via` work in `make shell`.
dev: PYTHONPATH = .
dev: WEB_CONCURRENCY = {env:WEB_CONCURRENCY:2}
dev: CHECKMATE_URL = http://localhost:9099
dev: CHECKMATE_IGNORE_REASONS = {env:CHECKMATE_IGNORE_REASONS:publisher-blocked}
dev: CHECKMATE_ALLOW_ALL = {env:CHECKMATE_ALLOW_ALL:true}
dev: NGINX_SECURE_LINK_SECRET = not_a_secret
dev: VIA_SECRET = not_a_secret
dev: CHECKMATE_API_KEY = dev_api_key
dev: ENABLE_FRONT_PAGE = {env:ENABLE_FRONT_PAGE:true}
dev: DATA_DIRECTORY = .devdata/
dev: YOUTUBE_TRANSCRIPTS = {env:YOUTUBE_TRANSCRIPTS:true}
dev: API_JWT_SECRET = secret
passenv =
HOME
PYTEST_ADDOPTS
dev: DEBUG
dev: SENTRY_DSN
dev: NEW_RELIC_LICENSE_KEY
GUNICORN_CERTFILE
GUNICORN_KEYFILE
dev: CHROME_EXTENSION_ID
dev: NGINX_SERVER
dev: CLIENT_EMBED_URL
dev: SIGNED_URLS_REQUIRED
dev: YOUTUBE_API_KEY
deps =
pip-tools
pip-sync-faster
depends =
coverage: tests
allowlist_externals =
tests,functests: sh
updatepdfjs: sh
commands_pre =
pip-sync-faster requirements/{env:TOX_ENV_NAME}.txt --pip-args '--disable-pip-version-check'
commands =
tests: sh bin/create-db via_tests
functests: sh bin/create-db via_functests
dev: {posargs:supervisord -c conf/supervisord-dev.conf}
format: black via tests bin
format: isort --atomic via tests bin
checkformatting: black --check via tests bin
checkformatting: isort --quiet --check-only via tests bin
lint: pylint via bin
lint: pylint --rcfile=tests/pyproject.toml tests
lint: pydocstyle via tests bin
lint: pycodestyle via tests bin
{tests,functests}: python3 -m via.scripts.init_db --delete --create
tests: python -m pytest --cov --cov-report= --cov-fail-under=0 --failed-first --new-first --no-header --quiet {posargs:tests/unit/}
functests: python -m pytest --failed-first --new-first --no-header --quiet {posargs:tests/functional/}
coverage: coverage combine
coverage: coverage report
typecheck: mypy via
template: python3 bin/make_template {posargs}
updatepdfjs: sh bin/update-pdfjs
build: python bin/minify_assets.py -c conf/minify_assets.json
build: python -m whitenoise.compress --no-brotli via/static
[testenv:dev]
# By default when you Ctrl-c the `make dev` command tox is too aggressive about
# killing supervisor. tox kills supervisor before supervisor has had time to
# stop or kill its child processes, resulting in detached child processes being
# left running and other problems.
#
# Fix this by configuring tox to wait a long time before sending any further
# SIGINTs (after the first one) or SIGTERMs or SIGKILLs to supervisor.
# Just trust supervisor to clean up all its child processes and stop.
suicide_timeout = 60.0
interrupt_timeout = 60.0
terminate_timeout = 60.0