From 5953432e7f8ccad5cc217e74a7243a99c09e2cc6 Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Fri, 1 Aug 2025 06:44:17 +0100 Subject: [PATCH 1/2] Specify `flit` build-system within `pyproject.toml` With the team using flit to build and package garak it can be defined in the pyproject.toml rather than with setuptools. --- pyproject.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 728402a5d..954f854fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = ["setuptools>=61.0.0", "wheel"] -build-backend = "setuptools.build_meta" +requires = ["flit_core >=3.11,<4"] +build-backend = "flit_core.buildapi" [project] name = "garak" @@ -139,11 +139,11 @@ audio = [ [project.scripts] garak = "garak.__main__:main" -[tool.setuptools] -packages = ["garak"] +[tool.flit.module] +name = "garak" -[tool.setuptools.package-data] -"garak.resources" = ["*"] +[tool.flit.sdist] +include = ["./garak/resources/*.json", "./garak/resources/*.yaml"] [tool.black] line-length = 88 From 07e4f97bbc35c155c80167ca9d579a89fba0f10f Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Fri, 1 Aug 2025 18:16:18 +0100 Subject: [PATCH 2/2] Consolidate MANIFEST.in into flint configuration in pyproject.toml Several items in MANIFEST.in were triggering `warning: manifest_maker: MANIFEST.in, line 1: unknown action` warnings With flint the convention for additional resources is to use `[tool.flit.sdist]` or `[tool.flit.external-data]` https://flit.pypa.io/en/stable/pyproject_toml.html#external-data-section --- MANIFEST.in | 18 ------------------ pyproject.toml | 9 ++++++++- 2 files changed, 8 insertions(+), 19 deletions(-) delete mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 315396f5e..000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,18 +0,0 @@ -garak/analyze -garak/buffs -garak/configs -garak/detectors -garak/evaluators -garak/generators -garak/harnesses -garak/probes -garak/resources -garak/data - -include *.md -include *.txt -recursive-include garak *.py -recursive-include garak/analyze *.py *.jinja -recursive-include garak/configs *.yaml -recursive-include garak/resources * -recursive-include garak/data * \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 954f854fc..bdbdd64a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -143,7 +143,14 @@ garak = "garak.__main__:main" name = "garak" [tool.flit.sdist] -include = ["./garak/resources/*.json", "./garak/resources/*.yaml"] +include = [ + "*.md", + "*.txt", + "garak/analyze/templates/*", + "garak/configs/*", + "garak/resources/*.json", + "garak/resources/*.yaml", +] [tool.black] line-length = 88