Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copy this file to ``.env`` and fill in values for your environment.
# ``python-dotenv`` is loaded by ``gee_mcp.server.auth`` on import, so any
# variables set here will be picked up automatically when the server
# starts.

# ----------------------------------------------------------------------
# Gemini (pick ONE of the two paths below)
# ----------------------------------------------------------------------

# Path A — Gemini Developer API key
# GEMINI_API_KEY=
# GOOGLE_API_KEY=

# Path B — Vertex AI project (requires ``gcloud auth
# application-default login`` to have been run)
# VERTEXAI_PROJECT=your-vertexai-project
# VERTEXAI_LOCATION=global

# ----------------------------------------------------------------------
# Google Earth Engine
# ----------------------------------------------------------------------
#
# Auth is delegated to ``ee.Initialize`` which walks the standard
# Google Cloud credential chain (GOOGLE_APPLICATION_CREDENTIALS,
# gcloud ADC, the ``earthengine authenticate`` cache, GCE metadata).
# You typically just need GEE_PROJECT after running
# ``earthengine authenticate`` or ``gcloud auth application-default login``.

# Required: GEE project id used for ``ee.Initialize(project=...)``.
GEE_PROJECT=your-gee-project

# Optional: path to a service-account JSON key file. Set this when
# running headlessly (CI, Cloud Run, etc.) without interactive
# authentication.
# GOOGLE_APPLICATION_CREDENTIALS=/absolute/path/to/service-account.json

# ----------------------------------------------------------------------
# Test / CI escape hatch
# ----------------------------------------------------------------------

# Set to ``1`` to skip GEE auth entirely on import. Used by the test
# suite to avoid hitting the auth chain in CI. Do not set for normal
# use.
# GEE_SKIP_AUTH=1
34 changes: 34 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on: push
jobs:
test:
strategy:
matrix:
python-version: ['3.11', '3.12', '3.13', '3.14']
defaults:
run:
shell: bash
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-${{ matrix.python-version }}-
- name: Install dependencies
run: |
poetry install --no-interaction
- name: Running pre-commit
uses: pre-commit/action@v3.0.1
99 changes: 99 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[codz]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
download/
eggs/
.eggs/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py.cover
.hypothesis/
.pytest_cache/
cover/

# Logs
*.log

# Translations
*.mo
*.pot

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# Environments
.env
.envrc
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Tooling caches
.mypy_cache/
.dmypy.json
dmypy.json
.pyre/
.pytype/
.ruff_cache/

# Editors
.vscode/
.idea/

# Project-specific
.config/
*.tif
download/
CLAUDE.md
69 changes: 69 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
repos:
- repo: local
hooks:
- id: detect-secrets
name: Detect secrets
language: system
entry: poetry run detect-secrets-hook
args: ['--baseline', '.secrets.baseline']
exclude: '\.ipynb$'
- id: autoflake
name: autoflake
language: system
"types": [python]
require_serial: true
entry: poetry run autoflake
args:
- "--in-place"
- "--remove-unused-variables"
- "--recursive"
- id: black
name: black
entry: poetry run black .
language: system
types: [python]
- id: isort
name: isort
entry: poetry run isort .
language: system
exclude: |
(?x)^(
.+\.js$|
.+\.jsx$|
.+\.css$|
.+\.html$|
.+\.json$|
.+\.md$
)$
- id: mypy
name: mypy
entry: poetry run mypy src tests
pass_filenames: false
language: system
args:
- "--ignore-missing-imports"
- "--warn-unused-ignores"
- id: pylint
name: pylint
entry: poetry run pylint src tests
pass_filenames: false
language: system
args:
- "--enable-useless-suppression"
- id: pytest-with-coverage
name: Run pytest with coverage
entry: poetry run coverage run -m pytest --testdox tests
language: system
pass_filenames: false
always_run: true
- id: coverage-report
name: Coverage report
entry: poetry run coverage report
language: system
pass_filenames: false
verbose: true
args:
- "--fail-under=20"
- "--skip-empty"
- "--skip-covered"
- "--show-missing"
Loading
Loading