-
Notifications
You must be signed in to change notification settings - Fork 11
/
tox.ini
75 lines (65 loc) · 2.01 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
[tox]
minversion = 3.21
# relies on the correct version of Python installed
envlist = ruff,tests,mypy-core,mypy-misc
# https://github.com/tox-dev/tox/issues/20#issuecomment-247788333
# hack to prevent .tox from crapping to the project directory
toxworkdir = {env:TOXWORKDIR_BASE:}{toxinidir}/.tox
[testenv]
# TODO how to get package name from setuptools?
package_name = "orger"
passenv =
# useful for tests to know they are running under ci
CI
CI_*
# respect user's cache dirs to prevent tox from crapping into project dir
PYTHONPYCACHEPREFIX
MYPY_CACHE_DIR
RUFF_CACHE_DIR
usedevelop = true # for some reason tox seems to ignore "-e ." in deps section??
setenv =
HPI_MODULE_INSTALL_USE_UV=true
uv_seed = true # seems necessary so uv creates separate venvs per tox env?
[testenv:ruff]
deps =
-e .[testing]
commands =
{envpython} -m ruff check src/
[testenv:tests]
deps =
-e .[testing]
commands =
{envpython} -m pytest \
--pyargs {[testenv]package_name} \
--ignore-glob='src/orger/modules/*' \
{posargs}
[testenv:mypy-core]
deps =
-e .[testing,optional]
commands =
{envpython} -m mypy --install-types --non-interactive \
# note: modules are tested separately, below
-p {[testenv]package_name} \
--exclude 'orger.modules' \
# txt report is a bit more convenient to view on CI
--txt-report .coverage.mypy-core \
--html-report .coverage.mypy-core \
{posargs}
[testenv:mypy-misc]
deps =
-e .[testing,optional]
HPI
uv # for hpi module install
commands =
{envpython} -m my.core module install \
my.pocket \
my.reddit.rexport \
my.instapaper \
my.pinboard \
my.kobo
{envpython} -m mypy --install-types --non-interactive \
-p {[testenv]package_name}.modules \
# txt report is a bit more convenient to view on CI
--txt-report .coverage.mypy-misc \
--html-report .coverage.mypy-misc \
{posargs}