From ff6cede1469f1285d835aa95f42a3ae9f788ade7 Mon Sep 17 00:00:00 2001 From: Benjamin Labrecque Date: Wed, 15 Jul 2026 14:13:50 +0200 Subject: [PATCH] fix: python apps --- bin/start_service.sh | 2 +- justfile | 4 ++++ packages/agebd/pyproject.toml | 14 ++------------ services/dbpm3curr/current/app/pyproject.toml | 7 +++++++ services/dbpm3curr/current/app/uv.lock | 2 +- services/master/current/app/pyproject.toml | 7 +++++++ services/master/current/app/uv.lock | 2 +- services/nturns/current/app/pyproject.toml | 7 +++++++ services/nturns/current/app/uv.lock | 2 +- .../current/app/pyproject.toml.jinja | 7 +++++++ 10 files changed, 38 insertions(+), 16 deletions(-) diff --git a/bin/start_service.sh b/bin/start_service.sh index dd39514..a143804 100755 --- a/bin/start_service.sh +++ b/bin/start_service.sh @@ -36,4 +36,4 @@ uv sync --frozen --project ${APP_DIR} source ${APP_DIR}/.venv/bin/activate # TODO: use `exec python3 ...` here? -python3 -u -B ${APP_DIR}/src/agebd_${SVC_NAME_LOWER_UNDERSCORES}/main.py +python -u -B -m agebd_${SVC_NAME_LOWER_UNDERSCORES}.main diff --git a/justfile b/justfile index 2e06b7b..1f03ab1 100644 --- a/justfile +++ b/justfile @@ -9,6 +9,10 @@ default: test-all: find services -name "pyproject.toml" -execdir uv run pytest \; +# Sync all envs +sync-all: + find services -name "pyproject.toml" -execdir uv sync \; + # Run tests for a SPECIFIC service (e.g., 'just test master') test service: cd services/{{service}}/current/app && uv run pytest diff --git a/packages/agebd/pyproject.toml b/packages/agebd/pyproject.toml index 24731ea..bddb685 100644 --- a/packages/agebd/pyproject.toml +++ b/packages/agebd/pyproject.toml @@ -2,11 +2,7 @@ name = "agebd" version = "0.1.0" description = "SLS HLA Framework" -readme = "README.md" requires-python = ">=3.9" -authors = [ - { name = "" } -] dependencies = [ "typer>=0.23.2", @@ -21,14 +17,8 @@ dev = [ ] [build-system] -requires = ["setuptools", "wheel"] -build-backend = "setuptools.build_meta" - -[tool.setuptools] -package-dir = {"" = "src"} - -[tool.setuptools.packages.find] -where = ["src"] +requires = ["hatchling"] +build-backend = "hatchling.build" [tool.uv] package = true diff --git a/services/dbpm3curr/current/app/pyproject.toml b/services/dbpm3curr/current/app/pyproject.toml index 4785789..1b78cc4 100644 --- a/services/dbpm3curr/current/app/pyproject.toml +++ b/services/dbpm3curr/current/app/pyproject.toml @@ -20,6 +20,13 @@ dev = [ # machines (see CI/CD in .gitea/workflows) agebd = { path = "../../../../packages/agebd", editable = true } +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.uv] +package = true + [tool.pytest.ini_options] pythonpath = ["src"] env = [ diff --git a/services/dbpm3curr/current/app/uv.lock b/services/dbpm3curr/current/app/uv.lock index a2539b5..56c1642 100644 --- a/services/dbpm3curr/current/app/uv.lock +++ b/services/dbpm3curr/current/app/uv.lock @@ -30,7 +30,7 @@ dev = [ [[package]] name = "agebd-dbpm3curr" version = "0.1.0" -source = { virtual = "." } +source = { editable = "." } dependencies = [ { name = "agebd" }, { name = "numpy", version = "2.0.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, diff --git a/services/master/current/app/pyproject.toml b/services/master/current/app/pyproject.toml index f99ecde..a533765 100644 --- a/services/master/current/app/pyproject.toml +++ b/services/master/current/app/pyproject.toml @@ -20,6 +20,13 @@ dev = [ # machines (see CI/CD in .gitea/workflows) agebd = { path = "../../../../packages/agebd", editable = true } +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.uv] +package = true + [tool.pytest.ini_options] pythonpath = ["src"] env = [ diff --git a/services/master/current/app/uv.lock b/services/master/current/app/uv.lock index 6811c9e..6006c26 100644 --- a/services/master/current/app/uv.lock +++ b/services/master/current/app/uv.lock @@ -30,7 +30,7 @@ dev = [ [[package]] name = "agebd-master" version = "0.1.0" -source = { virtual = "." } +source = { editable = "." } dependencies = [ { name = "agebd" }, { name = "pyyaml" }, diff --git a/services/nturns/current/app/pyproject.toml b/services/nturns/current/app/pyproject.toml index 551c949..765151a 100644 --- a/services/nturns/current/app/pyproject.toml +++ b/services/nturns/current/app/pyproject.toml @@ -21,6 +21,13 @@ dev = [ # machines (see CI/CD in .gitea/workflows) agebd = { path = "../../../../packages/agebd", editable = true } +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.uv] +package = true + [tool.pytest.ini_options] pythonpath = ["src"] env = [ diff --git a/services/nturns/current/app/uv.lock b/services/nturns/current/app/uv.lock index 83e3256..4b83c18 100644 --- a/services/nturns/current/app/uv.lock +++ b/services/nturns/current/app/uv.lock @@ -30,7 +30,7 @@ dev = [ [[package]] name = "agebd-nturns" version = "0.1.0" -source = { virtual = "." } +source = { editable = "." } dependencies = [ { name = "agebd" }, { name = "numpy", version = "2.0.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, diff --git a/templates/service/{{service_name_lower}}/current/app/pyproject.toml.jinja b/templates/service/{{service_name_lower}}/current/app/pyproject.toml.jinja index 81a8c20..dca37ab 100644 --- a/templates/service/{{service_name_lower}}/current/app/pyproject.toml.jinja +++ b/templates/service/{{service_name_lower}}/current/app/pyproject.toml.jinja @@ -19,6 +19,13 @@ dev = [ # machines (see CI/CD in .gitea/workflows) agebd = { path = "../../../../packages/agebd", editable = true } +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.uv] +package = true + [tool.pytest.ini_options] pythonpath = ["src"] env = [