-
Notifications
You must be signed in to change notification settings - Fork 1
Fix partitioning regression #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: astral-sh/setup-uv@v5 | ||
|
|
||
| - name: Install Pillow build dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y python3-dev build-essential libjpeg-dev zlib1g-dev | ||
|
|
||
| - run: uv sync --group dev | ||
|
|
||
| - run: uv run pytest | ||
|
Comment on lines
+20
to
+22
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,65 @@ | ||||||
| # CLAUDE.md | ||||||
|
|
||||||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||||||
|
|
||||||
| ## Project Overview | ||||||
|
|
||||||
| This is the **SMART Integrate Connector SDK** (`cdip_connector`), a Python library for building wildlife/conservation data integration connectors that pull data from external sources and push it to the CDIP (Conservation Data Integration Platform) Sensors API. The project is part of the Gundi ecosystem and is in maintenance/deprecated status (superseded by [gundi-integration-action-runner](https://github.com/PADAS/gundi-integration-action-runner)). | ||||||
|
|
||||||
| ## Build & Development | ||||||
|
|
||||||
| Package manager: **uv** (pyproject.toml with hatchling build backend, uv.lock present) | ||||||
|
|
||||||
| ```bash | ||||||
| # Install dependencies | ||||||
| uv sync | ||||||
|
|
||||||
| # Install with dev dependencies | ||||||
| uv sync --group dev | ||||||
|
|
||||||
| # Run tests | ||||||
| uv run pytest tests/ | ||||||
|
|
||||||
| # Run a single test | ||||||
| uv run pytest tests/test_portalapi.py::TestPortalApi::test_create | ||||||
|
|
||||||
| # Lint | ||||||
| uv run pylint cdip_connector/ | ||||||
|
|
||||||
| # Format | ||||||
| uv run black cdip_connector/ | ||||||
| ``` | ||||||
|
|
||||||
| Python requirement: `>=3.8`. The .venv uses Python 3.10. | ||||||
|
|
||||||
| ## Architecture | ||||||
|
|
||||||
| ### Core Library (`cdip_connector/core/`) | ||||||
|
|
||||||
| - **`connector_base.py`** — The central module. Contains `AbstractConnector` which all connectors subclass. Implements the ETL pipeline: `execute()` → `main()` → `extract_load()` → `extract()` (abstract) + `load()`. Also contains job partitioning logic (`calculate_partition`, `filter_items_for_task`) for running parallel instances via Kubernetes CronJobs or Cloud Run Jobs. | ||||||
| - **`cdip_settings.py`** — All configuration via environment variables using `environs`. Includes Keycloak auth settings, API endpoints, GCP settings, and job partitioning (JOB_COMPLETION_INDEX/COUNT). Can load from a custom env file via `CDIP_SDK_ENVFILE`. | ||||||
| - **`schemas/__init__.py`** — Re-exports all schemas from `gundi_core.schemas` for backward compatibility. | ||||||
| - **`routing.py`** — Pub/Sub topic name definitions for the observation processing pipeline. | ||||||
| - **`cloudstorage.py`** — Abstract `CloudStorage` with `GoogleCloudStorage` and `LocalStorage` implementations for camera trap image handling. | ||||||
|
||||||
| - **`cloudstorage.py`** — Abstract `CloudStorage` with `GoogleCloudStorage` and `LocalStorage` implementations for camera trap image handling. | |
| - **`cloudstorage.py`** — Abstract `CloudStorage` with `GoogleCouldStorage` and `LocalStorage` implementations for camera trap image handling. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow doesn’t pin a Python version. Since
ubuntu-latestcan change its default Python over time, CI results may unexpectedly change or fail even if the project hasn’t. Consider explicitly selecting a Python version (or a test matrix) consistent withrequires-python.