diff --git a/astrape_dashboard/__init__.py b/__init__.py similarity index 100% rename from astrape_dashboard/__init__.py rename to __init__.py diff --git a/astrape_dashboard/classes/__init__.py b/classes/__init__.py similarity index 100% rename from astrape_dashboard/classes/__init__.py rename to classes/__init__.py diff --git a/astrape_dashboard/classes/displays/__init__.py b/classes/displays/__init__.py similarity index 100% rename from astrape_dashboard/classes/displays/__init__.py rename to classes/displays/__init__.py diff --git a/astrape_dashboard/classes/displays/oracle.py b/classes/displays/oracle.py similarity index 100% rename from astrape_dashboard/classes/displays/oracle.py rename to classes/displays/oracle.py diff --git a/astrape_dashboard/classes/displays/oracle_quality.py b/classes/displays/oracle_quality.py similarity index 100% rename from astrape_dashboard/classes/displays/oracle_quality.py rename to classes/displays/oracle_quality.py diff --git a/astrape_dashboard/classes/displays/station.py b/classes/displays/station.py similarity index 100% rename from astrape_dashboard/classes/displays/station.py rename to classes/displays/station.py diff --git a/astrape_dashboard/classes/displays/weather.py b/classes/displays/weather.py similarity index 100% rename from astrape_dashboard/classes/displays/weather.py rename to classes/displays/weather.py diff --git a/astrape_dashboard/classes/sample_data.py b/classes/sample_data.py similarity index 100% rename from astrape_dashboard/classes/sample_data.py rename to classes/sample_data.py diff --git a/astrape_dashboard/classes/webui.py b/classes/webui.py similarity index 100% rename from astrape_dashboard/classes/webui.py rename to classes/webui.py diff --git a/deploy/systemd/astrape-web.service b/deploy/systemd/astrape-web.service deleted file mode 100644 index 2adecc3..0000000 --- a/deploy/systemd/astrape-web.service +++ /dev/null @@ -1,25 +0,0 @@ -[Unit] -Description=Astrape Web UI -After=network-online.target -Wants=network-online.target - -[Service] -Type=simple -User=gibil -Group=gibil -WorkingDirectory=/srv/astrape -Environment=PYTHONUNBUFFERED=1 -Environment=PYTHONDONTWRITEBYTECODE=1 -# WorkingDirectory is /srv/astrape, which also holds the gibil checkout. Without -# this, Python prepends the working directory to sys.path and the repo root -# /srv/astrape/gibil shadows the installed package as a namespace portion -- -# gibil.__file__ becomes None and imports work only by accident. All code is -# installed into the venv, so nothing needs the working directory on sys.path. -Environment=PYTHONSAFEPATH=1 - -ExecStart=/srv/astrape/.venv/bin/python -m astrape_dashboard.scripts.daemons.web_daemon -Restart=always -RestartSec=10 - -[Install] -WantedBy=multi-user.target diff --git a/pyproject.toml b/pyproject.toml index 5a3b2bf..cb634cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,5 +9,9 @@ description = "Astrape web frontend" requires-python = ">=3.12" dependencies = ["gibil", "astrape-ems", "astrape-oracle"] -[tool.setuptools.packages.find] -include = ["astrape_dashboard*"] +# Flat layout: this repository *is* the package. package-dir maps astrape_dashboard to the +# repository root rather than to a nested astrape_dashboard/ directory, so the checkout is +# astrape/astrape-dashboard and not astrape/astrape-dashboard/astrape_dashboard. +[tool.setuptools] +packages = ["astrape_dashboard", "astrape_dashboard.classes", "astrape_dashboard.classes.displays", "astrape_dashboard.scripts", "astrape_dashboard.scripts.daemons", "astrape_dashboard.scripts.debug"] +package-dir = {"astrape_dashboard" = "."} diff --git a/astrape_dashboard/scripts/__init__.py b/scripts/__init__.py similarity index 100% rename from astrape_dashboard/scripts/__init__.py rename to scripts/__init__.py diff --git a/astrape_dashboard/scripts/daemons/__init__.py b/scripts/daemons/__init__.py similarity index 100% rename from astrape_dashboard/scripts/daemons/__init__.py rename to scripts/daemons/__init__.py diff --git a/astrape_dashboard/scripts/daemons/web_daemon.py b/scripts/daemons/web_daemon.py similarity index 100% rename from astrape_dashboard/scripts/daemons/web_daemon.py rename to scripts/daemons/web_daemon.py diff --git a/astrape_dashboard/scripts/debug/__init__.py b/scripts/debug/__init__.py similarity index 100% rename from astrape_dashboard/scripts/debug/__init__.py rename to scripts/debug/__init__.py diff --git a/astrape_dashboard/scripts/debug/debug_weather.py b/scripts/debug/debug_weather.py similarity index 100% rename from astrape_dashboard/scripts/debug/debug_weather.py rename to scripts/debug/debug_weather.py