Skip to content

Commit 9a36501

Browse files
niraboclaude
andcommitted
feat: add testing infrastructure and development tooling (Phase 1)
Add new infrastructure files from feature/unit_tests_and_linting: - CI/CD pipeline (.github/workflows/ci.yml) - Pre-commit hooks configuration - Development documentation and guides - Docker container for CI testing - Makefile for task automation - Python project configuration (pyproject.toml) - Pytest configuration (conftest.py) - UV lock file for dependencies - Refactoring documentation These files do not exist in PR ChHarding#111 and can be safely added. Part of integration effort to merge PR ChHarding#111 with feature/unit_tests_and_linting. Tracked in merging_plan.md. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 5f38324 commit 9a36501

File tree

13 files changed

+4771
-0
lines changed

13 files changed

+4771
-0
lines changed

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, master, feature/** ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
lint-and-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.12'
20+
21+
- name: Install GDAL system dependencies
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y gdal-bin libgdal-dev
25+
26+
- name: Get GDAL version
27+
id: gdal-version
28+
run: |
29+
GDAL_VERSION=$(gdal-config --version)
30+
echo "GDAL version: $GDAL_VERSION"
31+
echo "version=$GDAL_VERSION" >> $GITHUB_OUTPUT
32+
33+
- name: Install Python dependencies
34+
env:
35+
GDAL_VERSION: ${{ steps.gdal-version.outputs.version }}
36+
run: |
37+
python -m pip install --upgrade pip
38+
# Install build dependencies first (numpy<2 needed for GDAL compatibility)
39+
pip install setuptools wheel "numpy<2"
40+
# Install GDAL Python bindings with --no-build-isolation
41+
# This allows GDAL to see the numpy we just installed
42+
pip install --no-build-isolation --no-cache-dir GDAL==$GDAL_VERSION
43+
# Install all other dependencies (excluding GDAL and numpy from requirements.txt)
44+
grep -v -e "^gdal" -e "^numpy" requirements.txt > requirements_no_gdal_numpy.txt
45+
pip install -r requirements_no_gdal_numpy.txt
46+
# Install test/dev dependencies
47+
pip install pytest pytest-cov ruff
48+
49+
- name: Verify GDAL installation
50+
run: |
51+
python -c "from osgeo import gdal; print(f'GDAL version: {gdal.__version__}')"
52+
python -c "from osgeo import gdal_array; print('GDAL array support: OK')"
53+
54+
- name: Run ruff (lint)
55+
run: |
56+
ruff check . --exit-zero
57+
58+
- name: Run tests
59+
run: |
60+
pytest -q -m "not earth_engine and not slow"

.pre-commit-config.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
repos:
2+
- repo: https://github.com/pycqa/isort
3+
rev: 6.1.0
4+
hooks:
5+
- id: isort
6+
args: ["--profile", "black", "--line-length", "88"]
7+
8+
- repo: https://github.com/psf/black
9+
rev: 25.9.0
10+
hooks:
11+
- id: black
12+
13+
- repo: https://github.com/charliermarsh/ruff-pre-commit
14+
rev: v0.14.0
15+
hooks:
16+
- id: ruff
17+
args: ["--fix"]
18+
19+
- repo: https://github.com/pre-commit/pre-commit-hooks
20+
rev: v6.0.0
21+
hooks:
22+
- id: end-of-file-fixer
23+
- id: trailing-whitespace

0 commit comments

Comments
 (0)