-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtox.ini
More file actions
88 lines (75 loc) · 4.5 KB
/
tox.ini
File metadata and controls
88 lines (75 loc) · 4.5 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
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
[tox]
requires = tox-uv
envlist = python310 #python310, python311, python312, python313
[testenv:python311]
basepython = python3.11
[testenv:python312]
basepython = python3.12
[testenv:python313]
basepython = python3.13
[testenv]
package = uv-editable
extras = test,pandas,polars,duckdb,iceberg,otel,sklearn,text-cleaning
allowlist_externals = sh, bandit
setenv =
PYTHONWARNINGS=ignore::UserWarning:piplicenses.spdx
WRITE_THIRD_PARTY_LICENSES={env:TOX_WRITE_THIRD_PARTY_LICENSES:false}
SKIP_POLARS_INSTALLATION_TEST={env:SKIP_POLARS_INSTALLATION_TEST:false}
EXPECTED_SKIP_COUNT = {env:EXPECTED_SKIP_COUNT:147}
CHECK_SKIP_COUNT = {env:CHECK_SKIP_COUNT:1}
USE_TOX_LOCK = {env:USE_TOX_LOCK:}
commands = sh -c "if [ -n \"$USE_TOX_LOCK\" ]; then flock /shared/tox.lock pytest -n {env:PYTEST_WORKERS:8} --timeout=10 {env:DEACTIVATE_NOTEBOOK_AND_DOC_TESTS:''}; else pytest -n {env:PYTEST_WORKERS:8} --timeout=10 {env:DEACTIVATE_NOTEBOOK_AND_DOC_TESTS:''}; fi"
ruff format --check --line-length 120 .
ruff check --line-length 120 .
sh -c "if [ \"$WRITE_THIRD_PARTY_LICENSES\" = \"true\" ]; then pip-licenses --format=plain-vertical --with-urls --with-license-file | sed '/\/home\//d' > attribution/THIRD_PARTY_LICENSES.md; fi"
sh -c "if [ -z \"${NO_WRITE_ATTRIBUTION_MD}\" ]; then pip-licenses --format=markdown > attribution/ATTRIBUTION.md; fi"
sh -c "pip-licenses --ignore-packages matplotlib-inline --allow-only='MPL-2.0 AND MIT; Apache-2.0 AND BSD-2-Clause; Apache-2.0 AND CNRI-Python; BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0; 3-Clause BSD License;BSD-2-Clause;BSD-3-Clause;Apache-2.0;Apache Software License;MIT;The Unlicense (Unlicense);PSF-2.0;MIT License;Python Software Foundation License;BSD License;GNU Lesser General Public License v2 or later (LGPLv2+);ISC License (ISCL);Mozilla Public License 2.0 (MPL 2.0);Apache License, Version 2.0;Apache 2.0;Apache Software License 2.0;' > /dev/null"
mypy --strict --ignore-missing-imports .
bandit -c pyproject.toml -r -q .
[testenv: core]
extras = test,pandas
setenv =
CHECK_SKIP_COUNT = {env:CHECK_SKIP_COUNT:0}
commands = pytest -n {env:PYTEST_WORKERS:8} --ignore=mloda_plugins/ --ignore=tests/test_documentation/ --ignore=tests/test_plugins/ --ignore=tests/test_examples/ --timeout=10
[testenv: installed]
package = sdist
extras = test,pandas,otel
setenv =
MLODA_INSTALLED_TEST=1
SKIP_POLARS_INSTALLATION_TEST={env:SKIP_POLARS_INSTALLATION_TEST:true}
SKIP_DUCKDB_INSTALLATION_TEST={env:SKIP_DUCKDB_INSTALLATION_TEST:true}
SKIP_TEXT_CLEANING_INSTALLATION_TEST={env:SKIP_TEXT_CLEANING_INSTALLATION_TEST:true}
CHECK_SKIP_COUNT = {env:CHECK_SKIP_COUNT:0}
commands =
pytest --import-mode append --timeout=10 -n {env:PYTEST_WORKERS:8}
python -c "import importlib.util, os, sys; packages = [('mloda.core', 'mloda/core'), ('mloda.provider', 'mloda/provider'), ('mloda.steward', 'mloda/steward'), ('mloda.user', 'mloda/user'), ('mloda_plugins', 'mloda_plugins')]; missing = [name for mod, name in packages if not os.path.exists(os.path.join(os.path.dirname(importlib.util.find_spec(mod).origin), 'py.typed'))]; sys.exit(f'Missing py.typed in: {missing}') if missing else print('All py.typed files present')"
[testenv: spark]
# This test suite is not tested in CI
# You need to setup JAVA_HOME and spark installation correctly.
extras = test,pandas,spark
setenv =
SKIP_POLARS_INSTALLATION_TEST={env:SKIP_POLARS_INSTALLATION_TEST:true}
SKIP_DUCKDB_INSTALLATION_TEST={env:SKIP_DUCKDB_INSTALLATION_TEST:true}
SKIP_TEXT_CLEANING_INSTALLATION_TEST={env:SKIP_TEXT_CLEANING_INSTALLATION_TEST:true}
JAVA_HOME={env:JAVA_HOME:/usr/lib/jvm/java-17-openjdk-amd64}
CHECK_SKIP_COUNT = {env:CHECK_SKIP_COUNT:0}
commands =
pytest -n {env:PYTEST_WORKERS:1} tests/test_plugins/compute_framework/base_implementations/spark/ -v
[testenv:security]
# CVE scanning environment - downloads specific version of published package
skip_install = False
usedevelop = False
deps =
pip-audit
allowlist_externals = sh, rm, mkdir
commands =
mkdir -p security-reports
sh -c "pip uninstall -y mloda || true"
sh -c "pip install mloda=={env:MLODA_VERSION:0.4.1}"
sh -c "pip list"
# Run CVE scan
sh -c "pip-audit --desc --format=json --output=security-reports/pip-audit-version.json || pip-audit --desc"
# Display summary
sh -c "echo '=== CVE Scan Summary ==='"
sh -c "echo 'Tool: pip-audit (Apache 2.0 licensed)'"
sh -c "echo 'Report: security-reports/pip-audit-version.json'"