From d0ac1789ff6d92fbcf976b5711080ba570fe2b8e Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Fri, 1 Sep 2023 19:06:13 -0400 Subject: [PATCH] Move all autowrap stuff into the same directory --- robotpy_build/autowrap/__init__.py | 0 robotpy_build/{templates => autowrap}/cls_prologue.cpp.j2 | 0 robotpy_build/{templates => autowrap}/cls_rpy_include.hpp.j2 | 0 robotpy_build/{templates => autowrap}/cls_tmpl_impl.hpp.j2 | 0 robotpy_build/{templates => autowrap}/cls_tmpl_inst.cpp.j2 | 0 robotpy_build/{templates => autowrap}/cls_tmpl_inst.hpp.j2 | 0 robotpy_build/{templates => autowrap}/cls_trampoline.hpp.j2 | 0 robotpy_build/{templates => autowrap}/clsdeps.json.j2 | 0 robotpy_build/{templates => autowrap}/header.cpp.j2 | 0 robotpy_build/{ => autowrap}/hooks.py | 4 ++-- robotpy_build/{ => autowrap}/j2_context.py | 2 +- robotpy_build/{ => autowrap}/mangle.py | 0 robotpy_build/{templates => autowrap}/pybind11.cpp.j2 | 0 robotpy_build/generator_data.py | 2 +- robotpy_build/wrapper.py | 4 ++-- 15 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 robotpy_build/autowrap/__init__.py rename robotpy_build/{templates => autowrap}/cls_prologue.cpp.j2 (100%) rename robotpy_build/{templates => autowrap}/cls_rpy_include.hpp.j2 (100%) rename robotpy_build/{templates => autowrap}/cls_tmpl_impl.hpp.j2 (100%) rename robotpy_build/{templates => autowrap}/cls_tmpl_inst.cpp.j2 (100%) rename robotpy_build/{templates => autowrap}/cls_tmpl_inst.hpp.j2 (100%) rename robotpy_build/{templates => autowrap}/cls_trampoline.hpp.j2 (100%) rename robotpy_build/{templates => autowrap}/clsdeps.json.j2 (100%) rename robotpy_build/{templates => autowrap}/header.cpp.j2 (100%) rename robotpy_build/{ => autowrap}/hooks.py (99%) rename robotpy_build/{ => autowrap}/j2_context.py (99%) rename robotpy_build/{ => autowrap}/mangle.py (100%) rename robotpy_build/{templates => autowrap}/pybind11.cpp.j2 (100%) diff --git a/robotpy_build/autowrap/__init__.py b/robotpy_build/autowrap/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/robotpy_build/templates/cls_prologue.cpp.j2 b/robotpy_build/autowrap/cls_prologue.cpp.j2 similarity index 100% rename from robotpy_build/templates/cls_prologue.cpp.j2 rename to robotpy_build/autowrap/cls_prologue.cpp.j2 diff --git a/robotpy_build/templates/cls_rpy_include.hpp.j2 b/robotpy_build/autowrap/cls_rpy_include.hpp.j2 similarity index 100% rename from robotpy_build/templates/cls_rpy_include.hpp.j2 rename to robotpy_build/autowrap/cls_rpy_include.hpp.j2 diff --git a/robotpy_build/templates/cls_tmpl_impl.hpp.j2 b/robotpy_build/autowrap/cls_tmpl_impl.hpp.j2 similarity index 100% rename from robotpy_build/templates/cls_tmpl_impl.hpp.j2 rename to robotpy_build/autowrap/cls_tmpl_impl.hpp.j2 diff --git a/robotpy_build/templates/cls_tmpl_inst.cpp.j2 b/robotpy_build/autowrap/cls_tmpl_inst.cpp.j2 similarity index 100% rename from robotpy_build/templates/cls_tmpl_inst.cpp.j2 rename to robotpy_build/autowrap/cls_tmpl_inst.cpp.j2 diff --git a/robotpy_build/templates/cls_tmpl_inst.hpp.j2 b/robotpy_build/autowrap/cls_tmpl_inst.hpp.j2 similarity index 100% rename from robotpy_build/templates/cls_tmpl_inst.hpp.j2 rename to robotpy_build/autowrap/cls_tmpl_inst.hpp.j2 diff --git a/robotpy_build/templates/cls_trampoline.hpp.j2 b/robotpy_build/autowrap/cls_trampoline.hpp.j2 similarity index 100% rename from robotpy_build/templates/cls_trampoline.hpp.j2 rename to robotpy_build/autowrap/cls_trampoline.hpp.j2 diff --git a/robotpy_build/templates/clsdeps.json.j2 b/robotpy_build/autowrap/clsdeps.json.j2 similarity index 100% rename from robotpy_build/templates/clsdeps.json.j2 rename to robotpy_build/autowrap/clsdeps.json.j2 diff --git a/robotpy_build/templates/header.cpp.j2 b/robotpy_build/autowrap/header.cpp.j2 similarity index 100% rename from robotpy_build/templates/header.cpp.j2 rename to robotpy_build/autowrap/header.cpp.j2 diff --git a/robotpy_build/hooks.py b/robotpy_build/autowrap/hooks.py similarity index 99% rename from robotpy_build/hooks.py rename to robotpy_build/autowrap/hooks.py index 818968ca..010a357c 100644 --- a/robotpy_build/hooks.py +++ b/robotpy_build/autowrap/hooks.py @@ -10,7 +10,7 @@ else: Protocol = object # pragma: no cover -from .config.autowrap_yml import ( +from ..config.autowrap_yml import ( AutowrapConfigYaml, BufferData, BufferType, @@ -21,7 +21,7 @@ PropAccess, ReturnValuePolicy, ) -from .generator_data import GeneratorData, MissingReporter, OverloadTracker +from ..generator_data import GeneratorData, MissingReporter, OverloadTracker from .mangle import trampoline_signature from .j2_context import ( diff --git a/robotpy_build/j2_context.py b/robotpy_build/autowrap/j2_context.py similarity index 99% rename from robotpy_build/j2_context.py rename to robotpy_build/autowrap/j2_context.py index 595e5321..ba61bd49 100644 --- a/robotpy_build/j2_context.py +++ b/robotpy_build/autowrap/j2_context.py @@ -12,7 +12,7 @@ from dataclasses import dataclass, field import typing -from .config.autowrap_yml import ReturnValuePolicy +from ..config.autowrap_yml import ReturnValuePolicy Documentation = typing.Optional[typing.List[str]] diff --git a/robotpy_build/mangle.py b/robotpy_build/autowrap/mangle.py similarity index 100% rename from robotpy_build/mangle.py rename to robotpy_build/autowrap/mangle.py diff --git a/robotpy_build/templates/pybind11.cpp.j2 b/robotpy_build/autowrap/pybind11.cpp.j2 similarity index 100% rename from robotpy_build/templates/pybind11.cpp.j2 rename to robotpy_build/autowrap/pybind11.cpp.j2 diff --git a/robotpy_build/generator_data.py b/robotpy_build/generator_data.py index 2e8bac40..3f3dc1de 100644 --- a/robotpy_build/generator_data.py +++ b/robotpy_build/generator_data.py @@ -7,7 +7,7 @@ PropData, FunctionData, ) -from .j2_context import OverloadTracker +from .autowrap.j2_context import OverloadTracker import dataclasses from typing import Dict, Optional, Tuple diff --git a/robotpy_build/wrapper.py b/robotpy_build/wrapper.py index 486c5c12..7caa736f 100644 --- a/robotpy_build/wrapper.py +++ b/robotpy_build/wrapper.py @@ -32,7 +32,7 @@ from .download import download_and_extract_zip from .config.pyproject_toml import PatchInfo, WrapperConfig, Download from .generator_data import MissingReporter -from .hooks import Hooks +from .autowrap.hooks import Hooks from .config.autowrap_yml import AutowrapConfigYaml from .config.dev_yml import get_dev_config @@ -612,7 +612,7 @@ def on_build_gen( thisdir = abspath(dirname(__file__)) hppoutdir = join(self.rpy_incdir, "rpygen") - tmpl_dir = join(thisdir, "templates") + tmpl_dir = join(thisdir, "autowrap") header_cpp_tmpl = join(tmpl_dir, "header.cpp.j2") cls_tmpl_inst_cpp = join(tmpl_dir, "cls_tmpl_inst.cpp.j2") cls_tmpl_inst_hpp = join(tmpl_dir, "cls_tmpl_inst.hpp.j2")