cuvis-ai-core 0.1.2__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_core-0.1.2/.githooks/pre-commit +38 -0
- cuvis_ai_core-0.1.2/.githooks/pre-push +31 -0
- cuvis_ai_core-0.1.2/.github/dependabot.yml +33 -0
- cuvis_ai_core-0.1.2/.github/workflows/ci.yml +184 -0
- cuvis_ai_core-0.1.2/.github/workflows/pypi-release.yml +157 -0
- cuvis_ai_core-0.1.2/.gitignore +203 -0
- cuvis_ai_core-0.1.2/.secrets.baseline +11936 -0
- cuvis_ai_core-0.1.2/CHANGELOG.md +70 -0
- cuvis_ai_core-0.1.2/LICENSE +190 -0
- cuvis_ai_core-0.1.2/PKG-INFO +192 -0
- cuvis_ai_core-0.1.2/README.md +115 -0
- cuvis_ai_core-0.1.2/buf.gen.yaml +10 -0
- cuvis_ai_core-0.1.2/buf.yaml +11 -0
- cuvis_ai_core-0.1.2/codecov.yml +25 -0
- cuvis_ai_core-0.1.2/configs/data/lentils.yaml +14 -0
- cuvis_ai_core-0.1.2/configs/pipeline/gradient_based.pt +0 -0
- cuvis_ai_core-0.1.2/configs/pipeline/gradient_based.yaml +56 -0
- cuvis_ai_core-0.1.2/configs/pipeline/statistical_based.yaml +29 -0
- cuvis_ai_core-0.1.2/configs/training/default.yaml +26 -0
- cuvis_ai_core-0.1.2/configs/trainrun/gradient_based.yaml +26 -0
- cuvis_ai_core-0.1.2/configs/trainrun/statistical_based.yaml +17 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/__init__.py +9 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/data/__init__.py +0 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/data/coco_labels.py +300 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/data/datasets.py +351 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/data/public_datasets.py +166 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/deciders/__init__.py +0 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/deciders/base_decider.py +60 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/__init__.py +32 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/callbacks.py +148 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/config_service.py +154 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/discovery_service.py +98 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/health.py +64 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/helpers.py +777 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/inference_service.py +225 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/introspection_service.py +150 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/pipeline_service.py +288 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/plugin_service.py +385 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/production_server.py +246 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/service.py +174 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/session_manager.py +192 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/session_service.py +87 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/training_service.py +621 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/trainrun_service.py +274 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/v1/__init__.py +12 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/v1/cuvis_ai_core_pb2.py +252 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/v1/cuvis_ai_core_pb2.pyi +1148 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/grpc/v1/cuvis_ai_core_pb2_grpc.py +1274 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/node/__init__.py +7 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/node/huggingface.py +225 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/node/node.py +397 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/pipeline/__init__.py +1 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/pipeline/factory.py +306 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/pipeline/pipeline.py +1366 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/pipeline/validator.py +23 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/pipeline/visualizer.py +506 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/training/__init__.py +41 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/training/config.py +698 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/training/datamodule.py +100 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/training/optimizer_registry.py +236 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/training/trainers.py +647 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/utils/__init__.py +16 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/utils/config_helpers.py +229 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/utils/general.py +56 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/utils/git_and_os.py +456 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/utils/graph_helper.py +44 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/utils/node_registry.py +583 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/utils/plugin_config.py +184 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/utils/restore.py +618 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core/utils/serializer.py +33 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core.egg-info/PKG-INFO +192 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core.egg-info/SOURCES.txt +168 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core.egg-info/dependency_links.txt +1 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core.egg-info/entry_points.txt +3 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core.egg-info/requires.txt +49 -0
- cuvis_ai_core-0.1.2/cuvis_ai_core.egg-info/top_level.txt +1 -0
- cuvis_ai_core-0.1.2/docs/grpc_plugin_api.md +552 -0
- cuvis_ai_core-0.1.2/docs/plugins.md +416 -0
- cuvis_ai_core-0.1.2/examples/grpc_plugin_management_client.py +434 -0
- cuvis_ai_core-0.1.2/proto/cuvis_ai_core/grpc/v1/cuvis_ai_core.proto +604 -0
- cuvis_ai_core-0.1.2/pyproject.toml +179 -0
- cuvis_ai_core-0.1.2/pytest.ini +59 -0
- cuvis_ai_core-0.1.2/setup.cfg +4 -0
- cuvis_ai_core-0.1.2/tests/README.md +220 -0
- cuvis_ai_core-0.1.2/tests/__init__.py +1 -0
- cuvis_ai_core-0.1.2/tests/config/test_json_schema.py +31 -0
- cuvis_ai_core-0.1.2/tests/config/test_pydantic_models.py +133 -0
- cuvis_ai_core-0.1.2/tests/conftest.py +219 -0
- cuvis_ai_core-0.1.2/tests/data/__init__.py +1 -0
- cuvis_ai_core-0.1.2/tests/data/test_coco_labels.py +365 -0
- cuvis_ai_core-0.1.2/tests/deciders/__init__.py +1 -0
- cuvis_ai_core-0.1.2/tests/deciders/test_base_decider.py +109 -0
- cuvis_ai_core-0.1.2/tests/fixtures/__init__.py +19 -0
- cuvis_ai_core-0.1.2/tests/fixtures/basic_nodes.py +247 -0
- cuvis_ai_core-0.1.2/tests/fixtures/basic_pipelines.py +202 -0
- cuvis_ai_core-0.1.2/tests/fixtures/config_factory.py +350 -0
- cuvis_ai_core-0.1.2/tests/fixtures/data_factory.py +568 -0
- cuvis_ai_core-0.1.2/tests/fixtures/grpc.py +157 -0
- cuvis_ai_core-0.1.2/tests/fixtures/mock_models.py +204 -0
- cuvis_ai_core-0.1.2/tests/fixtures/mock_nodes.py +463 -0
- cuvis_ai_core-0.1.2/tests/fixtures/mock_sdk.py +86 -0
- cuvis_ai_core-0.1.2/tests/fixtures/registry_test_nodes.py +169 -0
- cuvis_ai_core-0.1.2/tests/fixtures/sessions.py +330 -0
- cuvis_ai_core-0.1.2/tests/fixtures/test_nodes_package/__init__.py +1 -0
- cuvis_ai_core-0.1.2/tests/fixtures/test_nodes_package/normalizers.py +23 -0
- cuvis_ai_core-0.1.2/tests/fixtures/test_nodes_package/selectors.py +22 -0
- cuvis_ai_core-0.1.2/tests/fixtures/test_nodes_package/transformers.py +22 -0
- cuvis_ai_core-0.1.2/tests/fixtures/workflow_fixtures.py +177 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/__init__.py +1 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_advanced_features.py +257 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_config_preservation.py +405 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_end_to_end_workflows.py +495 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_experiment_management.py +707 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_file_resolution.py +36 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_gradient_training.py +68 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_grpc_proto_contract.py +61 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_helpers.py +267 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_hydra_composition.py +127 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_introspection.py +89 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_performance.py +144 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_pipeline_builder.py +312 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_pipeline_discovery.py +159 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_pipeline_management.py +368 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_plugin_management.py +574 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_plugin_service.py +513 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_production_server.py +58 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_proto_converters.py +212 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_proto_generation.py +60 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_service_basic.py +174 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_session_isolation.py +41 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_session_manager.py +163 -0
- cuvis_ai_core-0.1.2/tests/grpc_api/test_statistical_training.py +146 -0
- cuvis_ai_core-0.1.2/tests/integration/test_4step_workflow.py +117 -0
- cuvis_ai_core-0.1.2/tests/integration/test_config_resolution.py +80 -0
- cuvis_ai_core-0.1.2/tests/integration/test_dependencies_compatibility.py +31 -0
- cuvis_ai_core-0.1.2/tests/integration/test_error_cases.py +352 -0
- cuvis_ai_core-0.1.2/tests/integration/test_pipeline_precedence.py +85 -0
- cuvis_ai_core-0.1.2/tests/integration/test_plugin_session_isolation.py +561 -0
- cuvis_ai_core-0.1.2/tests/integration/test_pydantic_integration.py +51 -0
- cuvis_ai_core-0.1.2/tests/integration/test_search_paths.py +317 -0
- cuvis_ai_core-0.1.2/tests/integration/test_typed_io_integration.py +308 -0
- cuvis_ai_core-0.1.2/tests/integration/test_weight_loading.py +190 -0
- cuvis_ai_core-0.1.2/tests/node/test_node_autocomplete.py +152 -0
- cuvis_ai_core-0.1.2/tests/node/test_node_registry.py +225 -0
- cuvis_ai_core-0.1.2/tests/node/test_node_registry_session.py +477 -0
- cuvis_ai_core-0.1.2/tests/node/test_node_serialization.py +235 -0
- cuvis_ai_core-0.1.2/tests/node/test_plugin_system.py +187 -0
- cuvis_ai_core-0.1.2/tests/pipeline/test_graph_connections.py +253 -0
- cuvis_ai_core-0.1.2/tests/pipeline/test_graph_routing.py +346 -0
- cuvis_ai_core-0.1.2/tests/pipeline/test_graph_wiring.py +547 -0
- cuvis_ai_core-0.1.2/tests/pipeline/test_node_ports.py +270 -0
- cuvis_ai_core-0.1.2/tests/pipeline/test_node_state_serialization.py +254 -0
- cuvis_ai_core-0.1.2/tests/pipeline/test_pipeline_introspection.py +195 -0
- cuvis_ai_core-0.1.2/tests/pipeline/test_ports.py +210 -0
- cuvis_ai_core-0.1.2/tests/pipeline/test_runtime_io_validation.py +340 -0
- cuvis_ai_core-0.1.2/tests/pipeline/test_unique_node_names.py +89 -0
- cuvis_ai_core-0.1.2/tests/pipeline/test_visualizer.py +127 -0
- cuvis_ai_core-0.1.2/tests/pipeline/test_yaml_loading.py +341 -0
- cuvis_ai_core-0.1.2/tests/proto/test_proto_consistency.py +11 -0
- cuvis_ai_core-0.1.2/tests/stress/__init__.py +5 -0
- cuvis_ai_core-0.1.2/tests/stress/synthetic_data.py +318 -0
- cuvis_ai_core-0.1.2/tests/stress/test_gpu_stress.py +698 -0
- cuvis_ai_core-0.1.2/tests/stress/test_performance.py +246 -0
- cuvis_ai_core-0.1.2/tests/stress/test_pipeline_stress.py +534 -0
- cuvis_ai_core-0.1.2/tests/test_fixtures_smoke.py +93 -0
- cuvis_ai_core-0.1.2/tests/training/test_config.py +292 -0
- cuvis_ai_core-0.1.2/tests/training/test_external_trainers.py +534 -0
- cuvis_ai_core-0.1.2/tests/utils/__init__.py +0 -0
- cuvis_ai_core-0.1.2/tests/utils/test_restore.py +9 -0
- cuvis_ai_core-0.1.2/uv.lock +3316 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Pre-commit hook: Fast quality checks (linting + formatting)
|
|
3
|
+
# Skip with: git commit --no-verify
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "Running pre-commit checks..."
|
|
8
|
+
|
|
9
|
+
# Get list of tracked files before running checks
|
|
10
|
+
TRACKED_FILES=$(git diff --name-only --cached)
|
|
11
|
+
|
|
12
|
+
# Run Ruff formatting first
|
|
13
|
+
echo "→ Running Ruff formatting..."
|
|
14
|
+
if ! uv run ruff format .; then
|
|
15
|
+
echo "✗ Ruff formatting failed. Please fix the errors and try again."
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
# Run Ruff linting with auto-fix (on formatted code)
|
|
20
|
+
echo "→ Running Ruff linting (with auto-fix)..."
|
|
21
|
+
if ! uv run ruff check . --fix; then
|
|
22
|
+
echo "✗ Ruff linting failed. Please fix the errors and try again."
|
|
23
|
+
exit 1
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
# Auto-stage any files that were modified by Ruff
|
|
27
|
+
# Only re-stage files that were originally staged
|
|
28
|
+
if [ -n "$TRACKED_FILES" ]; then
|
|
29
|
+
echo "→ Auto-staging formatted files..."
|
|
30
|
+
echo "$TRACKED_FILES" | while read -r file; do
|
|
31
|
+
if [ -f "$file" ]; then
|
|
32
|
+
git add "$file"
|
|
33
|
+
fi
|
|
34
|
+
done
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
echo "✓ Pre-commit checks passed!"
|
|
38
|
+
exit 0
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Pre-push hook: Comprehensive quality checks (linting + formatting + tests)
|
|
3
|
+
# Skip with: git push --no-verify
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "Running pre-push checks..."
|
|
8
|
+
|
|
9
|
+
# Run Ruff formatting first
|
|
10
|
+
echo "→ Running Ruff formatting..."
|
|
11
|
+
if ! uv run ruff format .; then
|
|
12
|
+
echo "✗ Ruff formatting failed. Please fix the errors and try again."
|
|
13
|
+
exit 1
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
# Run Ruff linting with auto-fix (on formatted code)
|
|
17
|
+
echo "→ Running Ruff linting (with auto-fix)..."
|
|
18
|
+
if ! uv run ruff check . --fix; then
|
|
19
|
+
echo "✗ Ruff linting failed. Please fix the errors and try again."
|
|
20
|
+
exit 1
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
# Run pytest with non-GPU tests
|
|
24
|
+
echo "→ Running pytest (excluding GPU tests)..."
|
|
25
|
+
if ! uv run python -m pytest tests/ -v --tb=line -m "not slow and not gpu"; then
|
|
26
|
+
echo "✗ Tests failed. Please fix the failing tests and try again."
|
|
27
|
+
exit 1
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
echo "✓ All pre-push checks passed!"
|
|
31
|
+
exit 0
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
ignore:
|
|
20
|
+
# Exclude PyTorch packages - require manual updates for CUDA compatibility
|
|
21
|
+
- dependency-name: "torch"
|
|
22
|
+
- dependency-name: "torchvision"
|
|
23
|
+
- dependency-name: "torchaudio"
|
|
24
|
+
|
|
25
|
+
# GitHub Actions
|
|
26
|
+
- package-ecosystem: "github-actions"
|
|
27
|
+
directory: "/"
|
|
28
|
+
schedule:
|
|
29
|
+
interval: "weekly"
|
|
30
|
+
day: "monday"
|
|
31
|
+
time: "09:00"
|
|
32
|
+
timezone: "Europe/Berlin"
|
|
33
|
+
open-pull-requests-limit: 5
|
|
@@ -0,0 +1,184 @@
|
|
|
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
|
+
jobs:
|
|
19
|
+
test:
|
|
20
|
+
name: Run tests with coverage
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
container:
|
|
23
|
+
image: cubertgmbh/cuvis_pyil:3.5.0-ubuntu24.04
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v6
|
|
26
|
+
|
|
27
|
+
- name: Install uv
|
|
28
|
+
uses: astral-sh/setup-uv@v7
|
|
29
|
+
with:
|
|
30
|
+
enable-cache: true
|
|
31
|
+
|
|
32
|
+
- name: Set up Python
|
|
33
|
+
uses: actions/setup-python@v6
|
|
34
|
+
with:
|
|
35
|
+
python-version: "3.11"
|
|
36
|
+
|
|
37
|
+
- name: Install dependencies
|
|
38
|
+
run: |
|
|
39
|
+
uv sync --all-extras
|
|
40
|
+
|
|
41
|
+
- name: Run tests with coverage
|
|
42
|
+
run: |
|
|
43
|
+
uv run pytest tests/ \
|
|
44
|
+
--cov=cuvis_ai_core \
|
|
45
|
+
--cov-report=xml \
|
|
46
|
+
--cov-report=term-missing \
|
|
47
|
+
-m "not slow and not gpu and not stress and not requires_data" \
|
|
48
|
+
-v
|
|
49
|
+
|
|
50
|
+
- name: Upload coverage to Codecov
|
|
51
|
+
uses: codecov/codecov-action@v5
|
|
52
|
+
with:
|
|
53
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
54
|
+
files: ./coverage.xml
|
|
55
|
+
flags: unittests
|
|
56
|
+
name: codecov-umbrella
|
|
57
|
+
fail_ci_if_error: false
|
|
58
|
+
|
|
59
|
+
typecheck:
|
|
60
|
+
name: Type checking
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/checkout@v6
|
|
64
|
+
|
|
65
|
+
- name: Install uv
|
|
66
|
+
uses: astral-sh/setup-uv@v7
|
|
67
|
+
with:
|
|
68
|
+
enable-cache: true
|
|
69
|
+
|
|
70
|
+
- name: Set up Python
|
|
71
|
+
uses: actions/setup-python@v6
|
|
72
|
+
with:
|
|
73
|
+
python-version: "3.11"
|
|
74
|
+
|
|
75
|
+
- name: Install dependencies
|
|
76
|
+
run: |
|
|
77
|
+
uv sync --all-extras
|
|
78
|
+
|
|
79
|
+
- name: Run mypy
|
|
80
|
+
run: |
|
|
81
|
+
uv run mypy cuvis_ai_core/ || true
|
|
82
|
+
|
|
83
|
+
lint:
|
|
84
|
+
name: Linting and formatting
|
|
85
|
+
runs-on: ubuntu-latest
|
|
86
|
+
steps:
|
|
87
|
+
- uses: actions/checkout@v6
|
|
88
|
+
|
|
89
|
+
- name: Install uv
|
|
90
|
+
uses: astral-sh/setup-uv@v7
|
|
91
|
+
with:
|
|
92
|
+
enable-cache: true
|
|
93
|
+
|
|
94
|
+
- name: Set up Python
|
|
95
|
+
uses: actions/setup-python@v6
|
|
96
|
+
with:
|
|
97
|
+
python-version: "3.11"
|
|
98
|
+
|
|
99
|
+
- name: Install dependencies
|
|
100
|
+
run: |
|
|
101
|
+
uv sync --all-extras
|
|
102
|
+
|
|
103
|
+
- name: Run ruff check
|
|
104
|
+
run: |
|
|
105
|
+
uv run ruff check cuvis_ai_core/
|
|
106
|
+
|
|
107
|
+
- name: Run ruff format check
|
|
108
|
+
run: |
|
|
109
|
+
uv run ruff format --check cuvis_ai_core/
|
|
110
|
+
|
|
111
|
+
security:
|
|
112
|
+
name: Security scanning
|
|
113
|
+
runs-on: ubuntu-latest
|
|
114
|
+
steps:
|
|
115
|
+
- uses: actions/checkout@v6
|
|
116
|
+
|
|
117
|
+
- name: Install uv
|
|
118
|
+
uses: astral-sh/setup-uv@v7
|
|
119
|
+
with:
|
|
120
|
+
enable-cache: true
|
|
121
|
+
|
|
122
|
+
- name: Set up Python
|
|
123
|
+
uses: actions/setup-python@v6
|
|
124
|
+
with:
|
|
125
|
+
python-version: "3.11"
|
|
126
|
+
|
|
127
|
+
- name: Install dependencies
|
|
128
|
+
run: |
|
|
129
|
+
uv sync --all-extras
|
|
130
|
+
|
|
131
|
+
- name: Run pip-audit
|
|
132
|
+
run: |
|
|
133
|
+
uv run pip-audit --strict --desc on || true
|
|
134
|
+
|
|
135
|
+
- name: Run detect-secrets
|
|
136
|
+
run: |
|
|
137
|
+
uv run detect-secrets scan --baseline .secrets.baseline
|
|
138
|
+
|
|
139
|
+
- name: Run bandit
|
|
140
|
+
run: |
|
|
141
|
+
uv run bandit -r cuvis_ai_core/ || true
|
|
142
|
+
|
|
143
|
+
build-and-validate:
|
|
144
|
+
name: Build and validate package
|
|
145
|
+
needs: [test, typecheck, lint, security]
|
|
146
|
+
runs-on: ubuntu-latest
|
|
147
|
+
steps:
|
|
148
|
+
- uses: actions/checkout@v6
|
|
149
|
+
with:
|
|
150
|
+
fetch-depth: 0
|
|
151
|
+
|
|
152
|
+
- name: Install uv
|
|
153
|
+
uses: astral-sh/setup-uv@v7
|
|
154
|
+
with:
|
|
155
|
+
enable-cache: true
|
|
156
|
+
|
|
157
|
+
- name: Set up Python
|
|
158
|
+
uses: actions/setup-python@v6
|
|
159
|
+
with:
|
|
160
|
+
python-version: "3.11"
|
|
161
|
+
|
|
162
|
+
- name: Install dependencies
|
|
163
|
+
run: |
|
|
164
|
+
uv sync --all-extras
|
|
165
|
+
|
|
166
|
+
- name: Build package
|
|
167
|
+
run: |
|
|
168
|
+
uv build
|
|
169
|
+
|
|
170
|
+
- name: Validate package
|
|
171
|
+
run: |
|
|
172
|
+
uv run twine check dist/*
|
|
173
|
+
|
|
174
|
+
- name: Show package version
|
|
175
|
+
run: ls dist/
|
|
176
|
+
|
|
177
|
+
- name: Generate SBOM
|
|
178
|
+
run: |
|
|
179
|
+
uv run cyclonedx-py -o sbom.cdx.json || true
|
|
180
|
+
|
|
181
|
+
- name: Generate license report
|
|
182
|
+
run: |
|
|
183
|
+
uv run pip-licenses --format=markdown --with-authors > licenses.md || true
|
|
184
|
+
|
|
@@ -0,0 +1,157 @@
|
|
|
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
|
+
jobs:
|
|
13
|
+
build-and-validate:
|
|
14
|
+
name: Build and validate package
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v6
|
|
18
|
+
with:
|
|
19
|
+
fetch-depth: 0
|
|
20
|
+
|
|
21
|
+
- name: Install uv
|
|
22
|
+
uses: astral-sh/setup-uv@v7
|
|
23
|
+
with:
|
|
24
|
+
enable-cache: true
|
|
25
|
+
|
|
26
|
+
- name: Set up Python
|
|
27
|
+
uses: actions/setup-python@v6
|
|
28
|
+
with:
|
|
29
|
+
python-version: "3.11"
|
|
30
|
+
|
|
31
|
+
- name: Install dependencies
|
|
32
|
+
run: |
|
|
33
|
+
uv sync --all-extras
|
|
34
|
+
|
|
35
|
+
- name: Build package
|
|
36
|
+
run: |
|
|
37
|
+
uv build
|
|
38
|
+
|
|
39
|
+
- name: Validate package
|
|
40
|
+
run: |
|
|
41
|
+
uv run twine check dist/*
|
|
42
|
+
|
|
43
|
+
- name: Verify version matches tag
|
|
44
|
+
run: |
|
|
45
|
+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
|
|
46
|
+
PKG_VERSION=$(ls dist/*.tar.gz | sed 's/.*cuvis_ai_core-\(.*\)\.tar\.gz/\1/')
|
|
47
|
+
echo "Tag version: $TAG_VERSION"
|
|
48
|
+
echo "Package version: $PKG_VERSION"
|
|
49
|
+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
|
|
50
|
+
echo "::error::Tag version ($TAG_VERSION) does not match package version ($PKG_VERSION)"
|
|
51
|
+
exit 1
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
- name: Generate SBOM
|
|
55
|
+
run: |
|
|
56
|
+
uv run cyclonedx-py -o sbom.cdx.json || true
|
|
57
|
+
|
|
58
|
+
- name: Generate license report
|
|
59
|
+
run: |
|
|
60
|
+
uv run pip-licenses --format=markdown --with-authors > licenses.md || true
|
|
61
|
+
|
|
62
|
+
- name: Upload dist
|
|
63
|
+
uses: actions/upload-artifact@v6
|
|
64
|
+
with:
|
|
65
|
+
name: dist
|
|
66
|
+
path: dist/
|
|
67
|
+
|
|
68
|
+
- name: Upload reports
|
|
69
|
+
uses: actions/upload-artifact@v6
|
|
70
|
+
with:
|
|
71
|
+
name: reports
|
|
72
|
+
path: |
|
|
73
|
+
sbom.cdx.json
|
|
74
|
+
licenses.md
|
|
75
|
+
|
|
76
|
+
publish-testpypi:
|
|
77
|
+
name: Publish to TestPyPI
|
|
78
|
+
needs: build-and-validate
|
|
79
|
+
runs-on: ubuntu-latest
|
|
80
|
+
environment:
|
|
81
|
+
name: testpypi
|
|
82
|
+
url: https://test.pypi.org/project/cuvis-ai-core/
|
|
83
|
+
permissions:
|
|
84
|
+
id-token: write
|
|
85
|
+
steps:
|
|
86
|
+
- name: Download dist
|
|
87
|
+
uses: actions/download-artifact@v7
|
|
88
|
+
with:
|
|
89
|
+
name: dist
|
|
90
|
+
path: dist/
|
|
91
|
+
|
|
92
|
+
- name: Publish to TestPyPI
|
|
93
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
94
|
+
with:
|
|
95
|
+
repository-url: https://test.pypi.org/legacy/
|
|
96
|
+
skip-existing: true
|
|
97
|
+
|
|
98
|
+
publish-pypi:
|
|
99
|
+
name: Publish to PyPI
|
|
100
|
+
needs: publish-testpypi
|
|
101
|
+
runs-on: ubuntu-latest
|
|
102
|
+
environment:
|
|
103
|
+
name: pypi
|
|
104
|
+
url: https://pypi.org/project/cuvis-ai-core/
|
|
105
|
+
permissions:
|
|
106
|
+
id-token: write
|
|
107
|
+
steps:
|
|
108
|
+
- name: Download dist
|
|
109
|
+
uses: actions/download-artifact@v7
|
|
110
|
+
with:
|
|
111
|
+
name: dist
|
|
112
|
+
path: dist/
|
|
113
|
+
|
|
114
|
+
- name: Publish to PyPI
|
|
115
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
116
|
+
|
|
117
|
+
create-release:
|
|
118
|
+
name: Create GitHub Release
|
|
119
|
+
needs: publish-pypi
|
|
120
|
+
runs-on: ubuntu-latest
|
|
121
|
+
permissions:
|
|
122
|
+
contents: write
|
|
123
|
+
steps:
|
|
124
|
+
- uses: actions/checkout@v6
|
|
125
|
+
|
|
126
|
+
- name: Download dist
|
|
127
|
+
uses: actions/download-artifact@v7
|
|
128
|
+
with:
|
|
129
|
+
name: dist
|
|
130
|
+
path: dist/
|
|
131
|
+
|
|
132
|
+
- name: Download reports
|
|
133
|
+
uses: actions/download-artifact@v7
|
|
134
|
+
with:
|
|
135
|
+
name: reports
|
|
136
|
+
path: dist/
|
|
137
|
+
|
|
138
|
+
- name: Extract release notes
|
|
139
|
+
id: extract-notes
|
|
140
|
+
run: |
|
|
141
|
+
VERSION=${GITHUB_REF#refs/tags/v}
|
|
142
|
+
sed -n "/## \[${VERSION}\]/,/## \[/p" CHANGELOG.md | sed '1d;$d' > release_notes.md
|
|
143
|
+
if [ ! -s release_notes.md ]; then
|
|
144
|
+
echo "No specific release notes found for version ${VERSION}. See CHANGELOG.md for details." > release_notes.md
|
|
145
|
+
fi
|
|
146
|
+
cat release_notes.md
|
|
147
|
+
|
|
148
|
+
- name: Create GitHub Release
|
|
149
|
+
uses: softprops/action-gh-release@v2
|
|
150
|
+
with:
|
|
151
|
+
files: |
|
|
152
|
+
dist/*.whl
|
|
153
|
+
dist/*.tar.gz
|
|
154
|
+
dist/sbom.cdx.json
|
|
155
|
+
dist/licenses.md
|
|
156
|
+
body_path: release_notes.md
|
|
157
|
+
generate_release_notes: true
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
_build
|
|
2
|
+
|
|
3
|
+
# Created by https://www.toptal.com/developers/gitignore/api/python
|
|
4
|
+
# Edit at https://www.toptal.com/developers/gitignore?templates=python
|
|
5
|
+
|
|
6
|
+
### Python ###
|
|
7
|
+
# Byte-compiled / optimized / DLL files
|
|
8
|
+
__pycache__/
|
|
9
|
+
*.py[cod]
|
|
10
|
+
*$py.class
|
|
11
|
+
|
|
12
|
+
# C extensions
|
|
13
|
+
*.so
|
|
14
|
+
|
|
15
|
+
# Distribution / packaging
|
|
16
|
+
.Python
|
|
17
|
+
build/
|
|
18
|
+
develop-eggs/
|
|
19
|
+
dist/
|
|
20
|
+
downloads/
|
|
21
|
+
eggs/
|
|
22
|
+
.eggs/
|
|
23
|
+
lib/
|
|
24
|
+
lib64/
|
|
25
|
+
parts/
|
|
26
|
+
sdist/
|
|
27
|
+
var/
|
|
28
|
+
wheels/
|
|
29
|
+
share/python-wheels/
|
|
30
|
+
*.egg-info/
|
|
31
|
+
.installed.cfg
|
|
32
|
+
*.egg
|
|
33
|
+
MANIFEST
|
|
34
|
+
|
|
35
|
+
# PyInstaller
|
|
36
|
+
# Usually these files are written by a python script from a template
|
|
37
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
38
|
+
*.manifest
|
|
39
|
+
*.spec
|
|
40
|
+
|
|
41
|
+
# Installer logs
|
|
42
|
+
pip-log.txt
|
|
43
|
+
pip-delete-this-directory.txt
|
|
44
|
+
|
|
45
|
+
# Unit test / coverage reports
|
|
46
|
+
htmlcov/
|
|
47
|
+
.tox/
|
|
48
|
+
.nox/
|
|
49
|
+
.coverage
|
|
50
|
+
.coverage.*
|
|
51
|
+
.cache
|
|
52
|
+
nosetests.xml
|
|
53
|
+
coverage.xml
|
|
54
|
+
*.cover
|
|
55
|
+
*.py,cover
|
|
56
|
+
.hypothesis/
|
|
57
|
+
.pytest_cache/
|
|
58
|
+
cover/
|
|
59
|
+
|
|
60
|
+
# Translations
|
|
61
|
+
*.mo
|
|
62
|
+
*.pot
|
|
63
|
+
|
|
64
|
+
# Django stuff:
|
|
65
|
+
*.log
|
|
66
|
+
local_settings.py
|
|
67
|
+
db.sqlite3
|
|
68
|
+
db.sqlite3-journal
|
|
69
|
+
|
|
70
|
+
# Flask stuff:
|
|
71
|
+
instance/
|
|
72
|
+
.webassets-cache
|
|
73
|
+
|
|
74
|
+
# Scrapy stuff:
|
|
75
|
+
.scrapy
|
|
76
|
+
|
|
77
|
+
# Sphinx documentation
|
|
78
|
+
docs/_build/
|
|
79
|
+
|
|
80
|
+
# PyBuilder
|
|
81
|
+
.pybuilder/
|
|
82
|
+
target/
|
|
83
|
+
|
|
84
|
+
# Jupyter Notebook
|
|
85
|
+
.ipynb_checkpoints
|
|
86
|
+
|
|
87
|
+
# IPython
|
|
88
|
+
profile_default/
|
|
89
|
+
ipython_config.py
|
|
90
|
+
|
|
91
|
+
# pyenv
|
|
92
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
93
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
94
|
+
# .python-version
|
|
95
|
+
|
|
96
|
+
# pipenv
|
|
97
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
98
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
99
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
100
|
+
# install all needed dependencies.
|
|
101
|
+
#Pipfile.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
|
|
110
|
+
# pdm
|
|
111
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
112
|
+
#pdm.lock
|
|
113
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
114
|
+
# in version control.
|
|
115
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
116
|
+
.pdm.toml
|
|
117
|
+
|
|
118
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
119
|
+
__pypackages__/
|
|
120
|
+
|
|
121
|
+
# Celery stuff
|
|
122
|
+
celerybeat-schedule
|
|
123
|
+
celerybeat.pid
|
|
124
|
+
|
|
125
|
+
# SageMath parsed files
|
|
126
|
+
*.sage.py
|
|
127
|
+
|
|
128
|
+
# Environments
|
|
129
|
+
.env
|
|
130
|
+
.venv
|
|
131
|
+
env/
|
|
132
|
+
venv/
|
|
133
|
+
ENV/
|
|
134
|
+
env.bak/
|
|
135
|
+
venv.bak/
|
|
136
|
+
|
|
137
|
+
# Spyder project settings
|
|
138
|
+
.spyderproject
|
|
139
|
+
.spyproject
|
|
140
|
+
|
|
141
|
+
# Rope project settings
|
|
142
|
+
.ropeproject
|
|
143
|
+
|
|
144
|
+
# mkdocs documentation
|
|
145
|
+
/site
|
|
146
|
+
|
|
147
|
+
# mypy
|
|
148
|
+
.mypy_cache/
|
|
149
|
+
.dmypy.json
|
|
150
|
+
dmypy.json
|
|
151
|
+
|
|
152
|
+
# Pyre type checker
|
|
153
|
+
.pyre/
|
|
154
|
+
|
|
155
|
+
# pytype static type analyzer
|
|
156
|
+
.pytype/
|
|
157
|
+
|
|
158
|
+
# Cython debug symbols
|
|
159
|
+
cython_debug/
|
|
160
|
+
|
|
161
|
+
# PyCharm
|
|
162
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
163
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
164
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
165
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
166
|
+
#.idea/
|
|
167
|
+
|
|
168
|
+
### Python Patch ###
|
|
169
|
+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
|
|
170
|
+
poetry.toml
|
|
171
|
+
|
|
172
|
+
# ruff
|
|
173
|
+
.ruff_cache/
|
|
174
|
+
|
|
175
|
+
# LSP config files
|
|
176
|
+
pyrightconfig.json
|
|
177
|
+
|
|
178
|
+
# End of https://www.toptal.com/developers/gitignore/api/python
|
|
179
|
+
/docs/_autosummary
|
|
180
|
+
/.history/
|
|
181
|
+
/data/
|
|
182
|
+
docs_dev/
|
|
183
|
+
/outputs/
|
|
184
|
+
/wandb/
|
|
185
|
+
lightning_logs/
|
|
186
|
+
.vscode/
|
|
187
|
+
|
|
188
|
+
/tools/*csv.py
|
|
189
|
+
|
|
190
|
+
/examples_torch/outputs/
|
|
191
|
+
cuvis_ai/outputs/
|
|
192
|
+
/tools/*csv.py
|
|
193
|
+
runs/
|
|
194
|
+
test_outputs/
|
|
195
|
+
tensorboard/
|
|
196
|
+
.clinerules
|
|
197
|
+
experiments/
|
|
198
|
+
*.pt
|
|
199
|
+
!configs/**/*.pt
|
|
200
|
+
/.venv-adaclip-test/
|
|
201
|
+
.history/
|
|
202
|
+
.claude/
|
|
203
|
+
cuvis-ai-core.code-workspace
|