From 06c44e8f7d0f4fcdc564f6870a34408fdc887d11 Mon Sep 17 00:00:00 2001 From: Abel Luck Date: Mon, 30 Mar 2026 17:12:31 +0200 Subject: [PATCH] include static assets in build --- pyproject.toml | 2 +- tests/test_packaging.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 tests/test_packaging.py diff --git a/pyproject.toml b/pyproject.toml index 3361a67..1de1d45 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ where = ["."] include = ["repub*"] [tool.setuptools.package-data] -repub = ["sql/*.sql"] +repub = ["sql/*.sql", "static/*.css", "static/*.js"] [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/tests/test_packaging.py b/tests/test_packaging.py new file mode 100644 index 0000000..4c58062 --- /dev/null +++ b/tests/test_packaging.py @@ -0,0 +1,15 @@ +from __future__ import annotations + +import tomllib +from pathlib import Path + + +def test_pyproject_includes_static_assets_in_package_data() -> None: + pyproject_path = Path(__file__).resolve().parents[1] / "pyproject.toml" + config = tomllib.loads(pyproject_path.read_text(encoding="utf-8")) + + package_data = config["tool"]["setuptools"]["package-data"]["repub"] + + assert "sql/*.sql" in package_data + assert "static/*.css" in package_data + assert "static/*.js" in package_data