Repository navigation
IN‐CORE Developer Setup
This guide covers getting a local development environment running, and running the tests, for every repository in the IN-CORE platform. It is the mechanical companion to CONTRIBUTING.md, which covers the process side (GitFlow, branch naming, PR review, CLA).
Each repository section has the same five parts:
- Prerequisites: runtimes and services you need before you start
- Setup: from a clean clone
- Run it: how to start the component locally
- Test it: how to run the test suite
- After a dependency change: what to regenerate, and what to commit
- Getting the source
- Shared prerequisites
- IN-CORE account and tokens
- Python libraries: pyincore · pyincore-viz · pyincore-data · pyincore-incubator
- Python based services: incore-auth · plotting-service · maestro-service
- Java based services: incore-services
- JavaScript/TypeScript based user interface: incore-ui · incore-studio
- Docs and infrastructure: incore-docs · incore-helm · incore-lab
This repository is a superproject that tracks several of the component repositories as git submodules.
git clone --recurse-submodules https://github.com/IN-CORE/IN-CORE.gitIf you already cloned without --recurse-submodules:
git submodule update --init --recursive12 repositories are tracked here as submodules: incore-auth, incore-docs, incore-helm, incore-lab, incore-services, incore-studio, incore-ui, plotting-service, pyincore, pyincore-data, pyincore-incubator, pyincore-viz.
maestro-service is part of the platform but is not a submodule of this repository, and must be cloned separately:
git clone https://github.com/IN-CORE/maestro-service.gitAll repositories use GitFlow: branch from develop, PR back into develop. The exception is this superproject, which currently has only main. Only admins can make contributions directly to the superproject. See also CONTRIBUTING.md.
You will not need all of these. Install what the repositories you are working on ask for.
| Tool | Used by | Notes |
|---|---|---|
| conda or micromamba | all Python repos | conda is the officially supported installation path for the pyincore family. CI uses micromamba. mamba is a drop-in faster replacement for conda if you prefer it. |
| Python 3.11+ | pyincore, pyincore-viz, pyincore-data |
pyincore sets python_requires=">=3.11"; CI tests 3.11, 3.12, 3.13. |
| Python 3.9 |
pyincore-incubator, maestro-service
|
Older pins; see Known problems. |
| GDAL C library |
pyincore, pyincore-viz, pyincore-incubator
|
Only needed for the (unsupported) pip install path. On Ubuntu: gdal-bin, libgdal-dev. Conda pulls this in for you. |
| Ipopt | pyincore |
Required by the CGE analyses. Comes from the ipopt>=3.11 conda dependency. |
| pre-commit |
pyincore, pyincore-viz, pyincore-data, pyincore-incubator
|
brew install pre-commit or pip install pre-commit. |
| JDK 11 | incore-services |
CI uses Zulu 11. The Gradle build sets source/target compatibility to 11. |
| Node 18+ | incore-studio |
engines requires node >= 16; CI builds on 18. |
| Node 12–14 | incore-ui |
CI builds on 12 and 14 only; see Known problems. |
| Poetry | maestro-service |
pip install poetry |
| Docker | every repo | Every component ships a Dockerfile; several are easiest to run this way. |
| MongoDB |
incore-services, incore-auth
|
|
| PostgreSQL |
maestro-service, incore-services (GeoServer-backed dataset publishing) |
|
| Helm 3 + a Kubernetes cluster | incore-helm |
Most of the Python repositories talk to the IN-CORE web services, and their tests authenticate against the dev deployment.
- Create an IN-CORE account: https://tools.in-core.org/ (sign-up link can also be found in CONTRIBUTING.md).
-
pyincorecaches tokens under~/.incore/.IncoreClientcreates this directory on first use and writes one token file per service URL. -
pyincore's test suite does not use the cache.tests/conftest.pyreadstests/pyincore/.incorepw, a two-line file containing a JWT and the key to decode it, and uses the credentials inside to log intoINCORE_API_DEV_URL. In CI this file is written from thePYTEST_USER_TOKENsecret. Ask in the#in-core-dev-teamSlack channel for the equivalent for local runs. Do not commit this file.
Python analysis library; the core of the platform.
conda (or micromamba), Python 3.11+, pre-commit. Ipopt and GDAL come from the conda environment.
This is the developer setup. End users install a released package with conda install -c in-core pyincore instead; that path does not pick up local source changes.
cd pyincore
conda env create -f environment.yml
conda activate pyincore
pip install -e .
pre-commit installpip install -e . installs the local checkout in editable mode. After you change library code, reinstall so the env stays in sync:
pip install -e .environment.yml is the authoritative dependency file for this repository: requirements.txt, setup.py's install_requires, recipes/meta.yaml and versions.md are all generated from it (see step 5).
pyincore is a library, not a service. Use it from a notebook or script:
from pyincore import IncoreClient
client = IncoreClient()Example notebooks live in incore-docs under manual_jb/content/notebooks/.
Put your .incorepw in tests/pyincore/ first (see IN-CORE account and tokens).
Unit / integration tests (pytest). This is what CI runs (.github/workflows/pytests.yml):
python -m pytest --ignore=tests/test_format.py --ignore=tests/pyincore/analysesThe two exclusions are deliberate: tests/test_format.py duplicates the pre-commit hooks, and tests/pyincore/analyses is not a pytest suite (see below).
Analysis scripts (not pytest). Files under tests/pyincore/analyses/ are runnable example scripts (if __name__ == "__main__"). They talk to the dev services and write result files next to the script. Run one analysis at a time:
python tests/pyincore/analyses/meandamage/test_meandamage_building.pyDo not expect python -m pytest tests/pyincore/analyses to exercise them; almost none define test_* functions for pytest to collect.
Formatting is enforced separately by pre-commit (black 23.11.0 + flake8 6.1.0):
pre-commit run --all-filesDo not hand-edit requirements.txt, environment.yml, versions.md, recipes/meta.yaml, or setup.py's version pins. Instead:
- Add or change the minimum version in
requirements.min. This is the one file you edit by hand. - If the new dependency has to come from conda rather than pip, add it to
CONDA_IMPORTSat the top ofrequirements.sh. - Regenerate (requires
python3 -m virtualenvon your PATH; the script creates/tmp/pyincore-requirementson first run):./requirements.sh
requirements.sh scans imports in pyincore/, tests/, and notebooks/, resolves them with pip-compile in that throwaway virtualenv, and rewrites requirements.imports, requirements.txt, environment.yml, versions.md, recipes/meta.yaml, and setup.py.
4. Rebuild the conda env and reinstall the local package before re-running tests:
conda env update -f environment.yml --prune
conda activate pyincore
pip install -e .Then re-run the tests and commit all regenerated files together with your code change. Skipping the rebuild is a common source of misleading passes and failures.
A nightly workflow (.github/workflows/requirements.yaml) runs requirements.sh against main and opens a PR when the resolved versions drift. If you see an automated "Updated requirements" PR, that is where it came from.
Note: pyincore-viz and pyincore-incubator use the same requirements.sh mechanism with a different MODULE value. pyincore-data does not; keep its files in sync by hand (see that section).