Core development workflow
This page walks you through getting apexinfosysindia/core running from a source checkout.
Prerequisites
- Python 3.14.2 or newer — core declares
requires-python = ">=3.14.2"inpyproject.toml. Older interpreters will not install. - A Linux or macOS shell (CI runs on Ubuntu; the dev container is Linux-based).
uvis recommended — the setup scripts use it when available and fall back to the standard tooling otherwise.
Quick start: script/setup
Clone your fork and run the repository's setup script from the repo root:
git clone https://github.com/<your-username>/core.git
cd core
script/setup
script/setup does everything in one shot:
-
Copies default VS Code settings into
.vscode/settings.jsonif you don't have any. -
Creates a
.venvvirtual environment (viauv venvwhenuvis installed, elsepython3 -m venv) and activates it. -
Runs
script/bootstrap, which installs the development dependencies:uv pip install \-e . \-r requirements_all.txt \-r requirements_test.txt \colorlog \--upgrade \--config-settings editable_mode=compatNote the editable install (
-e .) — your source edits take effect without reinstalling. -
Compiles the English translations:
python3 -m script.translations develop --all. Tests and the UI read from the generatedtranslations/en.jsonfiles, not fromstrings.jsondirectly, so re-run this (or the--integration <name>variant) after editing anystrings.json. -
Installs the git hooks with
prek install, so lint runs automatically on commit. -
Creates a local
config/directory and seeds it withapex --script ensure_config -c config, adding a defaultlogger:block toconfiguration.yaml.
Manual setup
If you prefer to do it by hand, the equivalent minimal steps are:
python3.14 -m venv .venv
source .venv/bin/activate
pip install uv
uv pip install -e . -r requirements_test.txt
requirements_all.txt (every integration's dependencies) is large; you can skip it and instead install only what a specific integration needs:
python3 -m script.install_integration_requirements <domain>
Running core locally
The editable install exposes the console script apex (defined in pyproject.toml as apex = "apexos.__main__:main"). Running the package module directly, python -m apexos, is equivalent.
# Run against the repo-local config directory created by script/setup
apex -c config
# Or explicitly via the module
python -m apexos -c config
-c/--configpoints at the configuration directory. If you omit it, the default is~/.apexosin your home directory.apex --script ensure_config -c configcreates the directory and a starterconfiguration.yamlwithout starting the server.- If the configuration directory doesn't exist and isn't the default, startup aborts with a fatal error — create it first (or let
ensure_configdo it).
On first start the frontend is served locally and you can walk through onboarding in the browser.
Running tests for a single integration
You rarely need the full test suite locally. Target the integration you're working on:
python3 -m pytest tests/components/<domain>
For coverage output matching what CI checks:
python3 -m pytest tests/components/<domain> \
--cov=apexos.components.<domain> \
--cov-report=term-missing
See Testing for the fixtures, layout, and the exact flags CI uses.
Linting your changes
script/lint runs Ruff (through prek) and pylint against only the Python files changed on your branch — a fast pre-push sanity check. The commit-time hooks installed by prek install cover formatting automatically.