cuvis-ai-dataloader 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cuvis_ai_dataloader-0.1.0/.gitattributes +4 -0
- cuvis_ai_dataloader-0.1.0/.githooks/pre-commit +34 -0
- cuvis_ai_dataloader-0.1.0/.githooks/pre-push +46 -0
- cuvis_ai_dataloader-0.1.0/.github/dependabot.yml +28 -0
- cuvis_ai_dataloader-0.1.0/.github/workflows/ci.yml +200 -0
- cuvis_ai_dataloader-0.1.0/.github/workflows/cuvis_ai_compat.yml +52 -0
- cuvis_ai_dataloader-0.1.0/.github/workflows/pypi-release.yml +173 -0
- cuvis_ai_dataloader-0.1.0/.gitignore +9 -0
- cuvis_ai_dataloader-0.1.0/.secrets.baseline +127 -0
- cuvis_ai_dataloader-0.1.0/CHANGELOG.md +41 -0
- cuvis_ai_dataloader-0.1.0/LICENSE +190 -0
- cuvis_ai_dataloader-0.1.0/PKG-INFO +233 -0
- cuvis_ai_dataloader-0.1.0/README.md +174 -0
- cuvis_ai_dataloader-0.1.0/configs/plugins/cuvis_ai_dataloader.yaml +12 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader/__init__.py +17 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader/data/__init__.py +22 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader/data/_extras.py +110 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader/data/datamodule_cu3s.py +287 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader/data/datamodule_cu3s_multi.py +278 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader/data/datamodule_tiff_paired.py +191 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader/data/labelers/__init__.py +1 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader/data/labelers/coco_labeler.py +386 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader/data/labelers/paired_png_labeler.py +70 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader/data/readers/__init__.py +1 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader/data/readers/cu3s_reader.py +130 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader/data/readers/tiff_reader.py +82 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader/data/resolvers.py +203 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader/scripts/__init__.py +1 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader/scripts/resolve_splits.py +105 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader.egg-info/PKG-INFO +233 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader.egg-info/SOURCES.txt +47 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader.egg-info/dependency_links.txt +1 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader.egg-info/entry_points.txt +2 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader.egg-info/requires.txt +37 -0
- cuvis_ai_dataloader-0.1.0/cuvis_ai_dataloader.egg-info/top_level.txt +1 -0
- cuvis_ai_dataloader-0.1.0/pyproject.toml +128 -0
- cuvis_ai_dataloader-0.1.0/setup.cfg +4 -0
- cuvis_ai_dataloader-0.1.0/tests/__init__.py +0 -0
- cuvis_ai_dataloader-0.1.0/tests/conftest.py +114 -0
- cuvis_ai_dataloader-0.1.0/tests/cuvis_ai_dataloader/__init__.py +0 -0
- cuvis_ai_dataloader-0.1.0/tests/cuvis_ai_dataloader/data/__init__.py +0 -0
- cuvis_ai_dataloader-0.1.0/tests/cuvis_ai_dataloader/data/test_coco_labeler.py +363 -0
- cuvis_ai_dataloader-0.1.0/tests/cuvis_ai_dataloader/data/test_cu3s_datamodule.py +223 -0
- cuvis_ai_dataloader-0.1.0/tests/cuvis_ai_dataloader/data/test_cu3s_multi.py +157 -0
- cuvis_ai_dataloader-0.1.0/tests/cuvis_ai_dataloader/data/test_extras.py +36 -0
- cuvis_ai_dataloader-0.1.0/tests/cuvis_ai_dataloader/data/test_resolvers.py +137 -0
- cuvis_ai_dataloader-0.1.0/tests/cuvis_ai_dataloader/data/test_tiff_paired.py +125 -0
- cuvis_ai_dataloader-0.1.0/tests/cuvis_ai_dataloader/fixtures/__init__.py +0 -0
- cuvis_ai_dataloader-0.1.0/uv.lock +2482 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Pre-commit hook: fast checks (format + lint-fix on staged Python, then re-stage).
|
|
3
|
+
# Skip with: git commit --no-verify
|
|
4
|
+
#
|
|
5
|
+
# Enable once per clone: git config core.hooksPath .githooks
|
|
6
|
+
set -e
|
|
7
|
+
|
|
8
|
+
# Unset GIT_DIR/GIT_WORK_TREE so uv's internal git fetches don't inherit the hook's
|
|
9
|
+
# git context, and VIRTUAL_ENV so uv reconciles THIS repo's venv (not a sibling's).
|
|
10
|
+
unset GIT_DIR GIT_WORK_TREE VIRTUAL_ENV
|
|
11
|
+
|
|
12
|
+
STAGED=$(git diff --name-only --cached --diff-filter=ACM)
|
|
13
|
+
STAGED_PY=$(echo "$STAGED" | grep -E '\.py$' || true)
|
|
14
|
+
[ -z "$STAGED_PY" ] && exit 0
|
|
15
|
+
|
|
16
|
+
echo "→ Ruff format..."
|
|
17
|
+
if ! uv run --no-sync ruff format cuvis_ai_dataloader/ tests/; then
|
|
18
|
+
echo "✗ Ruff format failed (is the env set up? run: uv sync --extra dev)."
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
echo "→ Ruff check --fix..."
|
|
23
|
+
if ! uv run --no-sync ruff check --fix cuvis_ai_dataloader/ tests/; then
|
|
24
|
+
echo "✗ Ruff lint failed. Fix the errors above and re-commit."
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
# Re-stage only the files that were originally staged (ruff may have reformatted them).
|
|
29
|
+
echo "$STAGED_PY" | while read -r f; do
|
|
30
|
+
[ -f "$f" ] && git add "$f"
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
echo "✓ Pre-commit checks passed."
|
|
34
|
+
exit 0
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Pre-push hook: format + lint + docstring coverage + tests on the committed code.
|
|
3
|
+
# Skip with: git push --no-verify
|
|
4
|
+
#
|
|
5
|
+
# Enable once per clone: git config core.hooksPath .githooks
|
|
6
|
+
# Assumes the dev env is installed (uv sync --extra dev). Unlike cuvis-ai this hook does
|
|
7
|
+
# not run `uv sync --all-extras`: the `cu3s` extra has no macOS wheel, so a blanket sync
|
|
8
|
+
# would block pushes on macOS. The mock-SDK tests don't need the real `cuvis` binding.
|
|
9
|
+
set -e
|
|
10
|
+
|
|
11
|
+
unset GIT_DIR GIT_WORK_TREE VIRTUAL_ENV
|
|
12
|
+
|
|
13
|
+
echo "→ Ruff format check..."
|
|
14
|
+
if ! uv run --no-sync ruff format --check cuvis_ai_dataloader/ tests/; then
|
|
15
|
+
echo "✗ Code is not formatted. Run: uv run ruff format cuvis_ai_dataloader/ tests/"
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
echo "→ Ruff lint..."
|
|
20
|
+
if ! uv run --no-sync ruff check cuvis_ai_dataloader/ tests/; then
|
|
21
|
+
echo "✗ Ruff lint failed. Fix the errors above and re-commit."
|
|
22
|
+
exit 1
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
echo "→ Docstring coverage (interrogate, ≥95%)..."
|
|
26
|
+
# Prefer the cached tool so the gate runs offline; fetch only when it isn't cached yet.
|
|
27
|
+
if uvx --offline interrogate --version >/dev/null 2>&1; then
|
|
28
|
+
_interrogate="uvx --offline interrogate"
|
|
29
|
+
else
|
|
30
|
+
_interrogate="uvx interrogate"
|
|
31
|
+
fi
|
|
32
|
+
if ! $_interrogate cuvis_ai_dataloader/; then
|
|
33
|
+
echo ""
|
|
34
|
+
echo "✗ Docstring coverage below 95%. See misses: uvx interrogate -vv cuvis_ai_dataloader/"
|
|
35
|
+
echo " (config in pyproject.toml [tool.interrogate])"
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
echo "→ pytest (excluding slow/gpu)..."
|
|
40
|
+
if ! uv run --no-sync python -m pytest tests/ --tb=line -m "not slow and not gpu"; then
|
|
41
|
+
echo "✗ Tests failed. Fix them and re-commit before pushing."
|
|
42
|
+
exit 1
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
echo "✓ All pre-push checks passed."
|
|
46
|
+
exit 0
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
# Python dependencies
|
|
4
|
+
- package-ecosystem: "pip"
|
|
5
|
+
directory: "/"
|
|
6
|
+
schedule:
|
|
7
|
+
interval: "weekly"
|
|
8
|
+
day: "monday"
|
|
9
|
+
time: "09:00"
|
|
10
|
+
timezone: "Europe/Berlin"
|
|
11
|
+
open-pull-requests-limit: 10
|
|
12
|
+
groups:
|
|
13
|
+
python-minor-patch:
|
|
14
|
+
patterns:
|
|
15
|
+
- "*"
|
|
16
|
+
update-types:
|
|
17
|
+
- "minor"
|
|
18
|
+
- "patch"
|
|
19
|
+
|
|
20
|
+
# GitHub Actions
|
|
21
|
+
- package-ecosystem: "github-actions"
|
|
22
|
+
directory: "/"
|
|
23
|
+
schedule:
|
|
24
|
+
interval: "weekly"
|
|
25
|
+
day: "monday"
|
|
26
|
+
time: "09:00"
|
|
27
|
+
timezone: "Europe/Berlin"
|
|
28
|
+
open-pull-requests-limit: 5
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, staging]
|
|
6
|
+
tags-ignore:
|
|
7
|
+
- 'v*.*.*'
|
|
8
|
+
pull_request:
|
|
9
|
+
branches: [main, staging]
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ci-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
# Unlike the model plugins, this plugin's defining heavy dep is the cuvis SDK
|
|
19
|
+
# (the `cu3s` extra), so every job runs inside the cuvis pyil image where the
|
|
20
|
+
# SDK is present and `uv sync --all-extras` resolves cleanly.
|
|
21
|
+
jobs:
|
|
22
|
+
test:
|
|
23
|
+
name: Run tests with coverage
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
container:
|
|
26
|
+
image: cubertgmbh/cuvis_pyil:3.5.0-ubuntu24.04
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v6
|
|
29
|
+
with:
|
|
30
|
+
fetch-depth: 0
|
|
31
|
+
|
|
32
|
+
- name: Mark workspace as safe for git
|
|
33
|
+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
34
|
+
|
|
35
|
+
- name: Install system dependencies
|
|
36
|
+
run: |
|
|
37
|
+
apt-get update && apt-get install -y --no-install-recommends libgl1
|
|
38
|
+
|
|
39
|
+
- name: Install uv
|
|
40
|
+
uses: astral-sh/setup-uv@v7
|
|
41
|
+
with:
|
|
42
|
+
enable-cache: true
|
|
43
|
+
|
|
44
|
+
- name: Set up Python
|
|
45
|
+
uses: actions/setup-python@v6
|
|
46
|
+
with:
|
|
47
|
+
python-version: "3.11"
|
|
48
|
+
|
|
49
|
+
- name: Install dependencies
|
|
50
|
+
run: uv sync --all-extras
|
|
51
|
+
|
|
52
|
+
- name: Run tests with coverage
|
|
53
|
+
run: |
|
|
54
|
+
uv run pytest tests/ \
|
|
55
|
+
-m "not gpu" \
|
|
56
|
+
--cov=cuvis_ai_dataloader \
|
|
57
|
+
--cov-report=xml \
|
|
58
|
+
--cov-report=term-missing \
|
|
59
|
+
-v
|
|
60
|
+
|
|
61
|
+
- name: Upload coverage to Codecov
|
|
62
|
+
uses: codecov/codecov-action@v5
|
|
63
|
+
with:
|
|
64
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
65
|
+
files: ./coverage.xml
|
|
66
|
+
flags: unittests
|
|
67
|
+
name: codecov-umbrella
|
|
68
|
+
fail_ci_if_error: false
|
|
69
|
+
|
|
70
|
+
typecheck:
|
|
71
|
+
name: Type checking
|
|
72
|
+
runs-on: ubuntu-latest
|
|
73
|
+
container:
|
|
74
|
+
image: cubertgmbh/cuvis_pyil:3.5.0-ubuntu24.04
|
|
75
|
+
steps:
|
|
76
|
+
- uses: actions/checkout@v6
|
|
77
|
+
|
|
78
|
+
- name: Mark workspace as safe for git
|
|
79
|
+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
80
|
+
|
|
81
|
+
- name: Install uv
|
|
82
|
+
uses: astral-sh/setup-uv@v7
|
|
83
|
+
with:
|
|
84
|
+
enable-cache: true
|
|
85
|
+
|
|
86
|
+
- name: Set up Python
|
|
87
|
+
uses: actions/setup-python@v6
|
|
88
|
+
with:
|
|
89
|
+
python-version: "3.11"
|
|
90
|
+
|
|
91
|
+
- name: Install dependencies
|
|
92
|
+
run: uv sync --all-extras
|
|
93
|
+
|
|
94
|
+
- name: Run mypy
|
|
95
|
+
run: uv run mypy cuvis_ai_dataloader/ || true
|
|
96
|
+
|
|
97
|
+
lint:
|
|
98
|
+
name: Linting and formatting
|
|
99
|
+
runs-on: ubuntu-latest
|
|
100
|
+
container:
|
|
101
|
+
image: cubertgmbh/cuvis_pyil:3.5.0-ubuntu24.04
|
|
102
|
+
steps:
|
|
103
|
+
- uses: actions/checkout@v6
|
|
104
|
+
|
|
105
|
+
- name: Mark workspace as safe for git
|
|
106
|
+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
107
|
+
|
|
108
|
+
- name: Install uv
|
|
109
|
+
uses: astral-sh/setup-uv@v7
|
|
110
|
+
with:
|
|
111
|
+
enable-cache: true
|
|
112
|
+
|
|
113
|
+
- name: Set up Python
|
|
114
|
+
uses: actions/setup-python@v6
|
|
115
|
+
with:
|
|
116
|
+
python-version: "3.11"
|
|
117
|
+
|
|
118
|
+
- name: Install dependencies
|
|
119
|
+
run: uv sync --all-extras
|
|
120
|
+
|
|
121
|
+
- name: Run ruff check
|
|
122
|
+
run: uv run ruff check cuvis_ai_dataloader/
|
|
123
|
+
|
|
124
|
+
- name: Run ruff format check
|
|
125
|
+
run: uv run ruff format --check cuvis_ai_dataloader/
|
|
126
|
+
|
|
127
|
+
security:
|
|
128
|
+
name: Security scanning
|
|
129
|
+
runs-on: ubuntu-latest
|
|
130
|
+
container:
|
|
131
|
+
image: cubertgmbh/cuvis_pyil:3.5.0-ubuntu24.04
|
|
132
|
+
steps:
|
|
133
|
+
- uses: actions/checkout@v6
|
|
134
|
+
|
|
135
|
+
- name: Mark workspace as safe for git
|
|
136
|
+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
137
|
+
|
|
138
|
+
- name: Install uv
|
|
139
|
+
uses: astral-sh/setup-uv@v7
|
|
140
|
+
with:
|
|
141
|
+
enable-cache: true
|
|
142
|
+
|
|
143
|
+
- name: Set up Python
|
|
144
|
+
uses: actions/setup-python@v6
|
|
145
|
+
with:
|
|
146
|
+
python-version: "3.11"
|
|
147
|
+
|
|
148
|
+
- name: Install dependencies
|
|
149
|
+
run: uv sync --all-extras
|
|
150
|
+
|
|
151
|
+
- name: Run pip-audit
|
|
152
|
+
run: uv run pip-audit --strict --desc on || true
|
|
153
|
+
|
|
154
|
+
- name: Run detect-secrets
|
|
155
|
+
run: uv run detect-secrets scan --baseline .secrets.baseline
|
|
156
|
+
|
|
157
|
+
- name: Run bandit
|
|
158
|
+
run: uv run bandit -r cuvis_ai_dataloader/ -c pyproject.toml || true
|
|
159
|
+
|
|
160
|
+
build-and-validate:
|
|
161
|
+
name: Build and validate package
|
|
162
|
+
needs: [test, typecheck, lint, security]
|
|
163
|
+
runs-on: ubuntu-latest
|
|
164
|
+
container:
|
|
165
|
+
image: cubertgmbh/cuvis_pyil:3.5.0-ubuntu24.04
|
|
166
|
+
steps:
|
|
167
|
+
- uses: actions/checkout@v6
|
|
168
|
+
with:
|
|
169
|
+
fetch-depth: 0
|
|
170
|
+
|
|
171
|
+
- name: Mark workspace as safe for git
|
|
172
|
+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
173
|
+
|
|
174
|
+
- name: Install uv
|
|
175
|
+
uses: astral-sh/setup-uv@v7
|
|
176
|
+
with:
|
|
177
|
+
enable-cache: true
|
|
178
|
+
|
|
179
|
+
- name: Set up Python
|
|
180
|
+
uses: actions/setup-python@v6
|
|
181
|
+
with:
|
|
182
|
+
python-version: "3.11"
|
|
183
|
+
|
|
184
|
+
- name: Install dependencies
|
|
185
|
+
run: uv sync --all-extras
|
|
186
|
+
|
|
187
|
+
- name: Build package
|
|
188
|
+
run: uv build
|
|
189
|
+
|
|
190
|
+
- name: Validate package
|
|
191
|
+
run: uv run twine check dist/*
|
|
192
|
+
|
|
193
|
+
- name: Show package version
|
|
194
|
+
run: ls dist/
|
|
195
|
+
|
|
196
|
+
- name: Generate SBOM
|
|
197
|
+
run: uv run cyclonedx-py -o sbom.cdx.json || true
|
|
198
|
+
|
|
199
|
+
- name: Generate license report
|
|
200
|
+
run: uv run pip-licenses --format=markdown --with-authors > licenses.md || true
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: cuvis-ai compatibility
|
|
2
|
+
|
|
3
|
+
# Plugin-vs-core dependency compatibility gate. Verifies this plugin's
|
|
4
|
+
# dependency specifiers still admit the versions cuvis-ai-core locks for the
|
|
5
|
+
# release the plugin targets. Catches upstream constraint drift at PR time, and
|
|
6
|
+
# on a weekly cron, so a new core release that tightens a shared dependency turns
|
|
7
|
+
# this red as a "core moved, react" signal rather than surfacing at a user's
|
|
8
|
+
# first pipeline run.
|
|
9
|
+
|
|
10
|
+
on:
|
|
11
|
+
pull_request:
|
|
12
|
+
paths: ["pyproject.toml", "uv.lock"]
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
schedule:
|
|
15
|
+
- cron: "0 6 * * 1" # weekly, Monday 06:00 UTC
|
|
16
|
+
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
|
|
20
|
+
env:
|
|
21
|
+
# cuvis-ai-core ref to audit against. Pin to the release tag this plugin
|
|
22
|
+
# targets (its pyproject `cuvis-ai-core>=X`); `main` tracks the latest.
|
|
23
|
+
CORE_REF: main
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
compat:
|
|
27
|
+
name: Audit plugin deps against core lock
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
steps:
|
|
30
|
+
- name: Checkout code
|
|
31
|
+
uses: actions/checkout@v6
|
|
32
|
+
|
|
33
|
+
- name: Install uv
|
|
34
|
+
uses: astral-sh/setup-uv@v7
|
|
35
|
+
|
|
36
|
+
- name: Fetch audit script + core lock from cuvis-ai-core
|
|
37
|
+
run: |
|
|
38
|
+
base="https://raw.githubusercontent.com/cubert-hyperspectral/cuvis-ai-core/${CORE_REF}"
|
|
39
|
+
mkdir -p core
|
|
40
|
+
curl -fsSL "${base}/scripts/audit_plugin_deps.py" -o audit_plugin_deps.py
|
|
41
|
+
curl -fsSL "${base}/uv.lock" -o core/uv.lock
|
|
42
|
+
|
|
43
|
+
# The audit only reads pyproject.toml + uv.lock, so run it in a tiny
|
|
44
|
+
# ephemeral environment instead of installing cuvis-ai-core in full.
|
|
45
|
+
- name: Audit this plugin against the core lock
|
|
46
|
+
run: >
|
|
47
|
+
uv run --no-project --python 3.11 --with click --with packaging
|
|
48
|
+
python audit_plugin_deps.py
|
|
49
|
+
--check plugins
|
|
50
|
+
--plugin-pyproject ./pyproject.toml
|
|
51
|
+
--against-core core
|
|
52
|
+
--strict
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
name: PyPI Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*.*.*'
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
# The cu3s extra pulls the cuvis SDK binding, so the build job runs inside the
|
|
13
|
+
# cuvis pyil image (matching CI). The publish/release jobs only move already-built
|
|
14
|
+
# artifacts, so they run on plain ubuntu.
|
|
15
|
+
jobs:
|
|
16
|
+
build-and-validate:
|
|
17
|
+
name: Build and validate package
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
container:
|
|
20
|
+
image: cubertgmbh/cuvis_pyil:3.5.0-ubuntu24.04
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v6
|
|
23
|
+
with:
|
|
24
|
+
fetch-depth: 0
|
|
25
|
+
|
|
26
|
+
- name: Mark workspace as safe for git
|
|
27
|
+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
28
|
+
|
|
29
|
+
- name: Install system dependencies
|
|
30
|
+
run: apt-get update && apt-get install -y --no-install-recommends libgl1
|
|
31
|
+
|
|
32
|
+
- name: Install uv
|
|
33
|
+
uses: astral-sh/setup-uv@v7
|
|
34
|
+
with:
|
|
35
|
+
enable-cache: true
|
|
36
|
+
|
|
37
|
+
- name: Set up Python
|
|
38
|
+
uses: actions/setup-python@v6
|
|
39
|
+
with:
|
|
40
|
+
python-version: "3.11"
|
|
41
|
+
|
|
42
|
+
- name: Install dependencies
|
|
43
|
+
run: uv sync --all-extras
|
|
44
|
+
|
|
45
|
+
- name: Verify changelog entry exists
|
|
46
|
+
run: |
|
|
47
|
+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
|
|
48
|
+
if ! grep -q "^## ${TAG_VERSION}" CHANGELOG.md; then
|
|
49
|
+
echo "::error::No CHANGELOG.md entry found for version ${TAG_VERSION}"
|
|
50
|
+
echo "Add a '## ${TAG_VERSION}' section to CHANGELOG.md before releasing."
|
|
51
|
+
exit 1
|
|
52
|
+
fi
|
|
53
|
+
echo "Found changelog entry for ${TAG_VERSION}"
|
|
54
|
+
|
|
55
|
+
- name: Build package
|
|
56
|
+
run: uv build
|
|
57
|
+
|
|
58
|
+
- name: Validate package
|
|
59
|
+
run: uv run twine check dist/*
|
|
60
|
+
|
|
61
|
+
- name: Verify version matches tag
|
|
62
|
+
run: |
|
|
63
|
+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
|
|
64
|
+
PKG_VERSION=$(ls dist/*.tar.gz | sed 's/.*cuvis_ai_dataloader-\(.*\)\.tar\.gz/\1/')
|
|
65
|
+
echo "Tag version: $TAG_VERSION"
|
|
66
|
+
echo "Package version: $PKG_VERSION"
|
|
67
|
+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
|
|
68
|
+
echo "::error::Tag version ($TAG_VERSION) does not match package version ($PKG_VERSION)"
|
|
69
|
+
exit 1
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
- name: Generate SBOM
|
|
73
|
+
run: uv run cyclonedx-py -o sbom.cdx.json || true
|
|
74
|
+
|
|
75
|
+
- name: Generate license report
|
|
76
|
+
run: uv run pip-licenses --format=markdown --with-authors > licenses.md || true
|
|
77
|
+
|
|
78
|
+
- name: Upload dist
|
|
79
|
+
uses: actions/upload-artifact@v7
|
|
80
|
+
with:
|
|
81
|
+
name: dist
|
|
82
|
+
path: dist/
|
|
83
|
+
|
|
84
|
+
- name: Upload reports
|
|
85
|
+
uses: actions/upload-artifact@v7
|
|
86
|
+
with:
|
|
87
|
+
name: reports
|
|
88
|
+
path: |
|
|
89
|
+
sbom.cdx.json
|
|
90
|
+
licenses.md
|
|
91
|
+
|
|
92
|
+
publish-testpypi:
|
|
93
|
+
name: Publish to TestPyPI
|
|
94
|
+
needs: build-and-validate
|
|
95
|
+
runs-on: ubuntu-latest
|
|
96
|
+
environment:
|
|
97
|
+
name: testpypi
|
|
98
|
+
url: https://test.pypi.org/project/cuvis-ai-dataloader/
|
|
99
|
+
permissions:
|
|
100
|
+
id-token: write
|
|
101
|
+
steps:
|
|
102
|
+
- name: Download dist
|
|
103
|
+
uses: actions/download-artifact@v8
|
|
104
|
+
with:
|
|
105
|
+
name: dist
|
|
106
|
+
path: dist/
|
|
107
|
+
|
|
108
|
+
- name: Publish to TestPyPI
|
|
109
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
110
|
+
with:
|
|
111
|
+
repository-url: https://test.pypi.org/legacy/
|
|
112
|
+
skip-existing: true
|
|
113
|
+
|
|
114
|
+
publish-pypi:
|
|
115
|
+
name: Publish to PyPI
|
|
116
|
+
needs: publish-testpypi
|
|
117
|
+
runs-on: ubuntu-latest
|
|
118
|
+
environment:
|
|
119
|
+
name: pypi
|
|
120
|
+
url: https://pypi.org/project/cuvis-ai-dataloader/
|
|
121
|
+
permissions:
|
|
122
|
+
id-token: write
|
|
123
|
+
steps:
|
|
124
|
+
- name: Download dist
|
|
125
|
+
uses: actions/download-artifact@v8
|
|
126
|
+
with:
|
|
127
|
+
name: dist
|
|
128
|
+
path: dist/
|
|
129
|
+
|
|
130
|
+
- name: Publish to PyPI
|
|
131
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
132
|
+
|
|
133
|
+
create-release:
|
|
134
|
+
name: Create GitHub Release
|
|
135
|
+
needs: publish-pypi
|
|
136
|
+
runs-on: ubuntu-latest
|
|
137
|
+
permissions:
|
|
138
|
+
contents: write
|
|
139
|
+
steps:
|
|
140
|
+
- uses: actions/checkout@v6
|
|
141
|
+
|
|
142
|
+
- name: Download dist
|
|
143
|
+
uses: actions/download-artifact@v8
|
|
144
|
+
with:
|
|
145
|
+
name: dist
|
|
146
|
+
path: dist/
|
|
147
|
+
|
|
148
|
+
- name: Download reports
|
|
149
|
+
uses: actions/download-artifact@v8
|
|
150
|
+
with:
|
|
151
|
+
name: reports
|
|
152
|
+
path: dist/
|
|
153
|
+
|
|
154
|
+
- name: Extract release notes
|
|
155
|
+
id: extract-notes
|
|
156
|
+
run: |
|
|
157
|
+
VERSION=${GITHUB_REF#refs/tags/v}
|
|
158
|
+
sed -n "/^## ${VERSION}/,/^## [0-9]/p" CHANGELOG.md | sed '1d;$d' > release_notes.md
|
|
159
|
+
if [ ! -s release_notes.md ]; then
|
|
160
|
+
echo "No specific release notes found for version ${VERSION}. See CHANGELOG.md for details." > release_notes.md
|
|
161
|
+
fi
|
|
162
|
+
cat release_notes.md
|
|
163
|
+
|
|
164
|
+
- name: Create GitHub Release
|
|
165
|
+
uses: softprops/action-gh-release@v3
|
|
166
|
+
with:
|
|
167
|
+
files: |
|
|
168
|
+
dist/*.whl
|
|
169
|
+
dist/*.tar.gz
|
|
170
|
+
dist/sbom.cdx.json
|
|
171
|
+
dist/licenses.md
|
|
172
|
+
body_path: release_notes.md
|
|
173
|
+
generate_release_notes: true
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.5.0",
|
|
3
|
+
"plugins_used": [
|
|
4
|
+
{
|
|
5
|
+
"name": "ArtifactoryDetector"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"name": "AWSKeyDetector"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "AzureStorageKeyDetector"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "Base64HighEntropyString",
|
|
15
|
+
"limit": 4.5
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "BasicAuthDetector"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "CloudantDetector"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "DiscordBotTokenDetector"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "GitHubTokenDetector"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "GitLabTokenDetector"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "HexHighEntropyString",
|
|
34
|
+
"limit": 3.0
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "IbmCloudIamDetector"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "IbmCosHmacDetector"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "IPPublicDetector"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "JwtTokenDetector"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "KeywordDetector",
|
|
50
|
+
"keyword_exclude": ""
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "MailchimpDetector"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "NpmDetector"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "OpenAIDetector"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "PrivateKeyDetector"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "PypiTokenDetector"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "SendGridDetector"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "SlackDetector"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "SoftlayerDetector"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "SquareOAuthDetector"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "StripeDetector"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "TelegramBotTokenDetector"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "TwilioKeyDetector"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"filters_used": [
|
|
90
|
+
{
|
|
91
|
+
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
|
|
95
|
+
"min_level": 2
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"path": "detect_secrets.filters.heuristic.is_lock_file"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"path": "detect_secrets.filters.heuristic.is_sequential_string"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"path": "detect_secrets.filters.heuristic.is_swagger_file"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"path": "detect_secrets.filters.heuristic.is_templated_secret"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"results": {},
|
|
126
|
+
"generated_at": "2026-06-16T14:17:05Z"
|
|
127
|
+
}
|