File tree Expand file tree Collapse file tree 7 files changed +21
-17
lines changed Expand file tree Collapse file tree 7 files changed +21
-17
lines changed Original file line number Diff line number Diff line change 1212
1313def main ():
1414 parser = argparse .ArgumentParser (usage = inspect .cleandoc (__doc__ or "" ))
15- parser .add_argument ("package_name " )
15+ parser .add_argument ("module_package_name " )
1616 parser .add_argument ("name" )
1717 parser .add_argument ("pyproject_toml" , type = pathlib .Path )
1818 parser .add_argument ("pcfile" , type = pathlib .Path )
1919 parser .add_argument ("--libinit-py" )
2020 args = parser .parse_args ()
2121
22- package_name = args .package_name
22+ module_package_name = args .module_package_name
2323 project = PyProject (args .pyproject_toml )
2424
25- module = project .get_extension (package_name )
25+ module = project .get_extension (module_package_name )
2626 depends = project .get_extension_deps (module )
2727
28- pc_install_path = project .package_root / pathlib .Path (* package_name .split ("." ))
28+ pc_install_path = project .package_root / pathlib .Path (* module_package_name .split ("." )[: - 1 ] )
2929 make_pc_file (
3030 project_root = project .root ,
3131 pcfile = args .pcfile ,
@@ -36,6 +36,7 @@ def main():
3636 includes = module .includes ,
3737 depends = depends ,
3838 libinit_py = args .libinit_py ,
39+ generator_name = "semiwrap.cmd_gen_pkgconf" ,
3940 )
4041
4142
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ def main():
4747 includes = cfg .includedir ,
4848 depends = cfg .requires ,
4949 libinit_py = None ,
50+ generator_name = "semiwrap.cmd_publish_casters" ,
5051 )
5152
5253 #
Original file line number Diff line number Diff line change @@ -14,11 +14,13 @@ def make_pc_file(
1414 includes : T .List [str ],
1515 depends : T .List [str ],
1616 libinit_py : T .Optional [str ],
17+ generator_name : str ,
1718):
1819
1920 pc_content = [
20- "# automatically generated by semiwrap " ,
21+ f "# automatically generated by { generator_name } " ,
2122 "prefix=${pcfiledir}" ,
23+ f"# pc_install_path: { pc_install_path } "
2224 ]
2325
2426 if libinit_py :
@@ -28,7 +30,7 @@ def make_pc_file(
2830
2931 for i , inc in enumerate (includes ):
3032 includedir = project_root / pathlib .PurePosixPath (inc )
31- rel = includedir .relative_to (pc_install_path . parent )
33+ rel = includedir .relative_to (pc_install_path , walk_up = True )
3234 pc_content .append (f"inc{ i } =${{prefix}}/{ rel .as_posix ()} " )
3335 cflags .append (f"-I${{inc{ i } }}" )
3436
Original file line number Diff line number Diff line change @@ -75,8 +75,8 @@ def project(self):
7575 ) from e
7676 return self ._project
7777
78- def get_extension (self , package_name : str ) -> ExtensionModuleConfig :
79- return self .project .extension_modules [package_name ]
78+ def get_extension (self , module_package_name : str ) -> ExtensionModuleConfig :
79+ return self .project .extension_modules [module_package_name ]
8080
8181 def get_extension_deps (self , extension : ExtensionModuleConfig ) -> T .List [str ]:
8282 deps = []
Original file line number Diff line number Diff line change 1- /src /swtest_base /sw-caster-test-pybind11 .pc
2- /src /swtest_base /sw-caster-test-pybind11 .pybind11.json
1+ /src /swtest_base /sw-caster-test-casters .pc
2+ /src /swtest_base /sw-caster-test-casters .pybind11.json
33/src /swtest_base /trampolines
Original file line number Diff line number Diff line change @@ -20,18 +20,18 @@ packages = ['src/swtest_base']
2020
2121[tool .semiwrap ]
2222[tool .semiwrap .extension_modules ."swtest_base ._module" ]
23- depends = [" sw-test-base-pybind11 " ]
23+ depends = [" sw-test-base-casters " ]
2424includes = [" src/swtest_base/cpp" ]
2525
2626[tool .semiwrap .extension_modules ."swtest_base ._module" .headers ]
2727fn = " cpp/fn.h"
2828base_class = " cpp/baseclass.h"
2929
3030
31- [tool .semiwrap .export_type_casters .sw-test-base-pybind11 ]
31+ [tool .semiwrap .export_type_casters .sw-test-base-casters ]
3232pypackage = " swtest_base"
3333includedir = [" src/swtest_base/cpp/type_casters" ]
3434
35- [[tool .semiwrap .export_type_casters .sw-test-base-pybind11 .headers ]]
35+ [[tool .semiwrap .export_type_casters .sw-test-base-casters .headers ]]
3636header = " inty_cast.h"
3737types = [" inty" ]
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ packages = ["src/swtest"]
2121[tool .semiwrap ]
2222
2323[tool .semiwrap .extension_modules ."swtest .ft ._ft" ]
24- depends = [" sw-test-pybind11 " ]
24+ depends = [" sw-test-casters " ]
2525wraps = [" swtest_base__module" ]
2626yaml_path = " wrapcfg/ft"
2727includes = [" src/swtest/ft/include" ]
@@ -99,16 +99,16 @@ tnested = "templates/nested.h"
9999
100100
101101
102- [tool .semiwrap .export_type_casters .sw-test-pybind11 ]
102+ [tool .semiwrap .export_type_casters .sw-test-casters ]
103103pypackage = " swtest.tc"
104104includedir = [" src/swtest/tc/include" ]
105105
106- [[tool .semiwrap .export_type_casters .sw-test-pybind11 .headers ]]
106+ [[tool .semiwrap .export_type_casters .sw-test-casters .headers ]]
107107header = " rpyint_type_caster.h"
108108types = [" rpy::rpyint" ]
109109default_arg_cast = true
110110
111- [[tool .semiwrap .export_type_casters .sw-test-pybind11 .headers ]]
111+ [[tool .semiwrap .export_type_casters .sw-test-casters .headers ]]
112112header = " rpyint_type_caster.h"
113113types = [" rpyint_plus_5" ]
114114
You can’t perform that action at this time.
0 commit comments