From 86629a109ed302d6ef7126c62d8b51cf1277410e Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Mon, 8 Sep 2025 19:17:33 -0400 Subject: [PATCH] Fix missing parameterizations in cpp template --- cpp/cpp/cpp-template/extension.cpp | 3 --- .../{{project_name_formatted}}/extension.cpp.jinja | 3 +++ .../extension.hpp | 0 cpp/pyproject.toml.jinja | 11 +++++++---- 4 files changed, 10 insertions(+), 7 deletions(-) delete mode 100644 cpp/cpp/cpp-template/extension.cpp create mode 100644 cpp/cpp/{{project_name_formatted}}/extension.cpp.jinja rename cpp/cpp/{cpp-template => {{project_name_formatted}}}/extension.hpp (100%) diff --git a/cpp/cpp/cpp-template/extension.cpp b/cpp/cpp/cpp-template/extension.cpp deleted file mode 100644 index d42fa05..0000000 --- a/cpp/cpp/cpp-template/extension.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "cpp-template/extension.hpp" - -int add(int i, int j) { return i + j; } diff --git a/cpp/cpp/{{project_name_formatted}}/extension.cpp.jinja b/cpp/cpp/{{project_name_formatted}}/extension.cpp.jinja new file mode 100644 index 0000000..341dcab --- /dev/null +++ b/cpp/cpp/{{project_name_formatted}}/extension.cpp.jinja @@ -0,0 +1,3 @@ +#include "{{project_name_formatted}}/extension.hpp" + +int add(int i, int j) { return i + j; } diff --git a/cpp/cpp/cpp-template/extension.hpp b/cpp/cpp/{{project_name_formatted}}/extension.hpp similarity index 100% rename from cpp/cpp/cpp-template/extension.hpp rename to cpp/cpp/{{project_name_formatted}}/extension.hpp diff --git a/cpp/pyproject.toml.jinja b/cpp/pyproject.toml.jinja index 2ba515e..fcb05fb 100644 --- a/cpp/pyproject.toml.jinja +++ b/cpp/pyproject.toml.jinja @@ -78,6 +78,9 @@ ignore = [ ".clang-format", "Makefile", "docs/**/*", + "{{module}}/*.dll", + "{{module}}/*.dylib", + "{{module}}/*.so", ] [tool.cibuildwheel] @@ -112,9 +115,9 @@ fail_under = 50 [tool.hatch.build] artifacts = [ - "project/*.dll", - "project/*.dylib", - "project/*.so", + "{{module}}/*.dll", + "{{module}}/*.dylib", + "{{module}}/*.so", ] [tool.hatch.build.sources] @@ -123,7 +126,7 @@ src = "/" [tool.hatch.build.hooks.hatch-cpp] verbose = true libraries = [ -{name = "{{module}}/extension", sources = ["cpp/cpp-template/extension.cpp"], include-dirs = ["cpp"], binding="pybind11"} +{name = "{{module}}/extension", sources = ["cpp/{{project_name_formatted}}/extension.cpp"], include-dirs = ["cpp"], binding="pybind11"} ] [tool.hatch.build.targets.sdist]