-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtox.ini
More file actions
177 lines (159 loc) · 14.3 KB
/
Copy pathtox.ini
File metadata and controls
177 lines (159 loc) · 14.3 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
[tox]
envlist = python310
[testenv:python311]
[testenv:python312]
[testenv:python313]
[testenv:python314]
[testenv]
usedevelop = true
extras = dev
passenv =
USE_TOX_LOCK
PYTEST_WORKERS
allowlist_externals = sh, bandit
setenv =
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:2}; else pytest -n {env:PYTEST_WORKERS:2}; fi"
ruff format --check --line-length 120 .
ruff check .
mypy --strict --ignore-missing-imports .
bandit -c pyproject.toml -r -q .
[testenv:testing]
description = Run only mloda-testing tests
usedevelop = true
commands =
pytest mloda/testing/tests/ -v -n 2
[testenv:community-example]
description = Run only mloda-community-example tests
usedevelop = true
commands =
pytest mloda/community/feature_groups/example/tests/ -v -n 2
[testenv:community-example-a]
description = Run only mloda-community-example-a tests
usedevelop = true
commands =
pytest mloda/community/feature_groups/example/example_a/tests/ -v -n 2
[testenv:community-example-b]
description = Run only mloda-community-example-b tests
usedevelop = true
commands =
pytest mloda/community/feature_groups/example/example_b/tests/ -v -n 2
[testenv:registry]
description = Run only mloda-registry tests
usedevelop = true
commands =
pytest mloda/registry/tests/ -v -n 2
[testenv:enterprise-example]
description = Run only mloda-enterprise-example tests
usedevelop = true
commands =
pytest mloda/enterprise/ -v -n 2
[testenv:lint-docs]
description = Check docs for broken links and internal imports
skip_install = true
commands =
python scripts/lint_docs.py
[testenv:verify-builds]
description = Verify all packages build with correct versions
usedevelop = true
extras = dev
deps = setuptools
allowlist_externals = uv
commands =
python scripts/verify_builds.py
[testenv:check-generated]
description = Check pyproject.toml files are up-to-date with config
usedevelop = true
extras = dev
commands =
python scripts/generate_pyproject.py --check
[testenv:verify-published]
description = Verify published packages install and import correctly
skip_install = true
allowlist_externals = sh, uv, rm
commands =
sh -c 'uv cache clean'
sh -c 'rm -rf /tmp/mloda-verify && uv venv /tmp/mloda-verify'
sh -c 'VIRTUAL_ENV=/tmp/mloda-verify uv pip install mloda-registry=={env:MLODA_REGISTRY_VERSION} mloda-testing=={env:MLODA_REGISTRY_VERSION} mloda-community=={env:MLODA_REGISTRY_VERSION} mloda-enterprise=={env:MLODA_REGISTRY_VERSION} mloda-community-example=={env:MLODA_REGISTRY_VERSION} mloda-community-example-a=={env:MLODA_REGISTRY_VERSION} mloda-community-data-operations=={env:MLODA_REGISTRY_VERSION} mloda-community-aggregation=={env:MLODA_REGISTRY_VERSION} mloda-community-rank=={env:MLODA_REGISTRY_VERSION} mloda-community-offset=={env:MLODA_REGISTRY_VERSION} mloda-community-window-aggregation=={env:MLODA_REGISTRY_VERSION} mloda-community-frame-aggregate=={env:MLODA_REGISTRY_VERSION} mloda-community-scalar-aggregate=={env:MLODA_REGISTRY_VERSION} mloda-community-scalar-arithmetic=={env:MLODA_REGISTRY_VERSION} mloda-community-point-arithmetic=={env:MLODA_REGISTRY_VERSION} mloda-community-datetime=={env:MLODA_REGISTRY_VERSION} mloda-community-string=={env:MLODA_REGISTRY_VERSION} mloda-community-binning=={env:MLODA_REGISTRY_VERSION} mloda-community-percentile=={env:MLODA_REGISTRY_VERSION} mloda-community-time-bucketization=={env:MLODA_REGISTRY_VERSION} mloda-community-ffill=={env:MLODA_REGISTRY_VERSION} mloda-community-ema=={env:MLODA_REGISTRY_VERSION} mloda-community-sessionization=={env:MLODA_REGISTRY_VERSION} mloda-community-resample=={env:MLODA_REGISTRY_VERSION}'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "from mloda.registry import discover, search; print(\"mloda.registry OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "from mloda.testing import FeatureGroupTestBase; print(\"mloda.testing OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "from mloda.community.feature_groups.example import CommunityExampleFeatureGroup; print(\"mloda.community.example OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "from mloda.community.feature_groups.example.example_a import ExampleAFeatureGroup; print(\"mloda.community.example_a OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "from mloda.enterprise.feature_groups.example import EnterpriseExampleFeatureGroup; print(\"mloda.enterprise.example OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "from mloda.community.compute_frameworks.example import CommunityExampleComputeFramework; print(\"mloda.community.compute_frameworks.example OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "from mloda.community.extenders.example import CommunityExampleExtender; print(\"mloda.community.extenders.example OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "from mloda.enterprise.compute_frameworks.example import EnterpriseExampleComputeFramework; print(\"mloda.enterprise.compute_frameworks.example OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "from mloda.enterprise.extenders.example import EnterpriseExampleExtender; print(\"mloda.enterprise.extenders.example OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations; print(\"mloda.community.data_operations OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.aggregation; print(\"mloda.community.aggregation OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.row_preserving.rank; print(\"mloda.community.rank OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.row_preserving.offset; print(\"mloda.community.offset OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.row_preserving.window_aggregation; print(\"mloda.community.window_aggregation OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.row_preserving.frame_aggregate; print(\"mloda.community.frame_aggregate OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.row_preserving.scalar_aggregate; print(\"mloda.community.scalar_aggregate OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.row_preserving.scalar_arithmetic; print(\"mloda.community.scalar_arithmetic OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.row_preserving.point_arithmetic; print(\"mloda.community.point_arithmetic OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.row_preserving.datetime; print(\"mloda.community.datetime OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.string; print(\"mloda.community.string OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.row_preserving.binning; print(\"mloda.community.binning OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.row_preserving.percentile; print(\"mloda.community.percentile OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.row_preserving.time_bucketization; print(\"mloda.community.time_bucketization OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.row_preserving.ffill; print(\"mloda.community.ffill OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.row_preserving.ema; print(\"mloda.community.ema OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.row_preserving.sessionization; print(\"mloda.community.sessionization OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify/bin/python -c "import mloda.community.feature_groups.data_operations.row_changing.resample; print(\"mloda.community.resample OK\")"'
sh -c 'echo "=== All packages verified ==="'
[testenv:verify-extras]
description = Verify optional dependencies install correctly
skip_install = true
allowlist_externals = sh, uv, rm
commands =
; Test mloda-community-example base package (without extras)
sh -c 'rm -rf /tmp/mloda-verify-base && uv venv /tmp/mloda-verify-base'
sh -c 'VIRTUAL_ENV=/tmp/mloda-verify-base uv pip install mloda-community-example=={env:MLODA_REGISTRY_VERSION}'
sh -c 'cd /tmp && /tmp/mloda-verify-base/bin/python -c "from mloda.community.feature_groups.example import CommunityExampleFeatureGroup; print(\"base package OK\")"'
; Verify example_a is NOT installed with base (requires [all] extra)
sh -c 'cd /tmp && /tmp/mloda-verify-base/bin/python -c "from mloda.community.feature_groups.example.example_a import ExampleAFeatureGroup" 2>/dev/null && { echo "ERROR: example_a should NOT be installed with base"; exit 1; } || echo "example_a correctly NOT installed with base"'
; Test mloda-community-example[all] installs example_a and example_b
sh -c 'rm -rf /tmp/mloda-verify-all && uv venv /tmp/mloda-verify-all'
sh -c 'VIRTUAL_ENV=/tmp/mloda-verify-all uv pip install "mloda-community-example[all]=={env:MLODA_REGISTRY_VERSION}"'
sh -c 'cd /tmp && /tmp/mloda-verify-all/bin/python -c "from mloda.community.feature_groups.example import CommunityExampleFeatureGroup; print(\"base with [all] OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify-all/bin/python -c "from mloda.community.feature_groups.example.example_a import ExampleAFeatureGroup; print(\"example_a with [all] OK\")"'
sh -c 'cd /tmp && /tmp/mloda-verify-all/bin/python -c "from mloda.community.feature_groups.example.example_b import ExampleBFeatureGroup; print(\"example_b with [all] OK\")"'
sh -c 'echo "=== Optional dependencies verified ==="'
[testenv:verify-published-independent]
description = Verify each package installs and imports independently
skip_install = true
allowlist_externals = sh, uv, rm
commands =
; Test mloda-registry independently
sh -c 'rm -rf /tmp/mloda-verify-registry && uv venv /tmp/mloda-verify-registry'
sh -c 'VIRTUAL_ENV=/tmp/mloda-verify-registry uv pip install mloda-registry=={env:MLODA_REGISTRY_VERSION}'
sh -c 'cd /tmp && /tmp/mloda-verify-registry/bin/python -c "from mloda.registry import discover, search; print(\"mloda-registry independent OK\")"'
; Test mloda-testing independently
sh -c 'rm -rf /tmp/mloda-verify-testing && uv venv /tmp/mloda-verify-testing'
sh -c 'VIRTUAL_ENV=/tmp/mloda-verify-testing uv pip install mloda-testing=={env:MLODA_REGISTRY_VERSION}'
sh -c 'cd /tmp && /tmp/mloda-verify-testing/bin/python -c "from mloda.testing import FeatureGroupTestBase; print(\"mloda-testing independent OK\")"'
; Test mloda-community independently (without enterprise)
sh -c 'rm -rf /tmp/mloda-verify-community && uv venv /tmp/mloda-verify-community'
sh -c 'VIRTUAL_ENV=/tmp/mloda-verify-community uv pip install mloda-community=={env:MLODA_REGISTRY_VERSION}'
sh -c 'cd /tmp && /tmp/mloda-verify-community/bin/python -c "from mloda.community.feature_groups.example import CommunityExampleFeatureGroup; print(\"mloda-community independent OK\")"'
; Test mloda-enterprise independently (without community)
sh -c 'rm -rf /tmp/mloda-verify-enterprise && uv venv /tmp/mloda-verify-enterprise'
sh -c 'VIRTUAL_ENV=/tmp/mloda-verify-enterprise uv pip install mloda-enterprise=={env:MLODA_REGISTRY_VERSION}'
sh -c 'cd /tmp && /tmp/mloda-verify-enterprise/bin/python -c "from mloda.enterprise.feature_groups.example import EnterpriseExampleFeatureGroup; print(\"mloda-enterprise independent OK\")"'
sh -c 'echo "=== All packages verified independently ==="'
[testenv:security]
description = CVE scanning of published packages
skip_install = true
deps =
pip-audit
allowlist_externals = sh, mkdir, uv
commands =
mkdir -p security-reports
sh -c "uv pip uninstall mloda-registry mloda-testing mloda-community mloda-enterprise mloda-community-example mloda-community-example-a mloda-community-data-operations mloda-community-aggregation mloda-community-rank mloda-community-offset mloda-community-window-aggregation mloda-community-frame-aggregate mloda-community-scalar-aggregate mloda-community-scalar-arithmetic mloda-community-point-arithmetic mloda-community-datetime mloda-community-string mloda-community-binning mloda-community-percentile mloda-community-time-bucketization mloda-community-ffill mloda-community-ema mloda-community-sessionization mloda-community-resample 2>/dev/null || true"
uv pip install mloda-registry=={env:MLODA_REGISTRY_VERSION} mloda-testing=={env:MLODA_REGISTRY_VERSION} mloda-community=={env:MLODA_REGISTRY_VERSION} mloda-enterprise=={env:MLODA_REGISTRY_VERSION} mloda-community-example=={env:MLODA_REGISTRY_VERSION} mloda-community-example-a=={env:MLODA_REGISTRY_VERSION} mloda-community-data-operations=={env:MLODA_REGISTRY_VERSION} mloda-community-aggregation=={env:MLODA_REGISTRY_VERSION} mloda-community-rank=={env:MLODA_REGISTRY_VERSION} mloda-community-offset=={env:MLODA_REGISTRY_VERSION} mloda-community-window-aggregation=={env:MLODA_REGISTRY_VERSION} mloda-community-frame-aggregate=={env:MLODA_REGISTRY_VERSION} mloda-community-scalar-aggregate=={env:MLODA_REGISTRY_VERSION} mloda-community-scalar-arithmetic=={env:MLODA_REGISTRY_VERSION} mloda-community-point-arithmetic=={env:MLODA_REGISTRY_VERSION} mloda-community-datetime=={env:MLODA_REGISTRY_VERSION} mloda-community-string=={env:MLODA_REGISTRY_VERSION} mloda-community-binning=={env:MLODA_REGISTRY_VERSION} mloda-community-percentile=={env:MLODA_REGISTRY_VERSION} mloda-community-time-bucketization=={env:MLODA_REGISTRY_VERSION} mloda-community-ffill=={env:MLODA_REGISTRY_VERSION} mloda-community-ema=={env:MLODA_REGISTRY_VERSION} mloda-community-sessionization=={env:MLODA_REGISTRY_VERSION} mloda-community-resample=={env:MLODA_REGISTRY_VERSION}
sh -c "pip-audit --desc --format=json --output=security-reports/pip-audit.json || pip-audit --desc"
sh -c "echo '=== CVE Scan Complete ==='"
sh -c "echo 'Report: security-reports/pip-audit.json'"