-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtox.ini
More file actions
62 lines (56 loc) · 1.62 KB
/
Copy pathtox.ini
File metadata and controls
62 lines (56 loc) · 1.62 KB
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
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
skipsdist = True
envlist = py310, py311, py312, py313, py314, ruff
[testenv]
#
# Run the tests
#
deps =
-e {tox_root}[test]
setenv = TMPDIR={envtmpdir}
commands =
pytest --basetemp="{envtmpdir}" {posargs}
[testenv:ruff]
#
# Format the code according to convention
#
deps = ruff
skip_install = True
commands =
ruff format
ruff check --fix
[testenv:build]
#
# Build the distribution files
#
deps = build
skip_install = True
commands =
python -m build .
[testenv:exe]
#
# Create an executable and run the tests with it.
# Works on Windows (dist/ics-query.exe) and Linux (dist/ics-query).
#
skip_install = True
deps =
pyinstaller
-e .[test]
commands =
pyinstaller ics-query.py --onefile --paths "{env_site_packages_dir}" --recursive-copy-metadata ics-query
python -c "import subprocess,sys,sysconfig; sys.exit(subprocess.run([sys.executable,'-m','pytest','--binary','dist/ics-query'+(sysconfig.get_config_var('EXE') or '')]).returncode)"
python -c "import os,platform,sysconfig; ext=sysconfig.get_config_var('EXE') or ''; src='dist/ics-query'+ext; dst='dist/ics-query-linux-'+platform.machine() if not ext else src; os.rename(src,dst) if src!=dst else None"
[testenv:docs]
#
# Build the documentation
#
skip_install = True
deps =
-r {tox_root}/docs/requirements.txt
-e {tox_root}
commands =
sphinx-build -W {tox_root}/docs {tox_root}/docs/_build/html