File tree Expand file tree Collapse file tree 4 files changed +20
-17
lines changed
build2cmake/src/templates Expand file tree Collapse file tree 4 files changed +20
-17
lines changed Original file line number Diff line number Diff line change @@ -104,16 +104,17 @@ def build_extension(self, ext: CMakeExtension) -> None:
104104 )
105105
106106
107+ {% set python_name = name | replace ('-' , '_' ) % }
107108setup (
108- name = "{{ name }}" ,
109+ name = "{{ python_name }}" ,
109110 # The version is just a stub, it's not used by the final build artefact.
110111 version = "0.1.0" ,
111- ext_modules = [CMakeExtension ("{{ name }}.{{ ops_name }}" )],
112+ ext_modules = [CMakeExtension ("{{ python_name }}.{{ ops_name }}" )],
112113 cmdclass = {"build_ext" : CMakeBuild },
113- packages = find_packages (where = "torch-ext" , include = ["{{ name }}*" ]),
114+ packages = find_packages (where = "torch-ext" , include = ["{{ python_name }}*" ]),
114115 package_dir = {"" : "torch-ext" },
115116{% if data_globs % }
116- package_data = {"{{ name }}" : [ {{ data_globs }} ]},
117+ package_data = {"{{ python_name }}" : [ {{ data_globs }} ]},
117118{% endif % }
118119 zip_safe = False ,
119120 install_requires = ["torch" ],
Original file line number Diff line number Diff line change @@ -124,16 +124,17 @@ def build_extension(self, ext: CMakeExtension) -> None:
124124
125125
126126
127+ {% set python_name = name | replace ('-' , '_' ) % }
127128setup (
128- name = "{{ name }}" ,
129+ name = "{{ python_name }}" ,
129130 # The version is just a stub, it's not used by the final build artefact.
130131 version = "0.1.0" ,
131- ext_modules = [CMakeExtension ("{{ name }}.{{ ops_name }}" )],
132+ ext_modules = [CMakeExtension ("{{ python_name }}.{{ ops_name }}" )],
132133 cmdclass = {"build_ext" : CMakeBuild },
133- packages = find_packages (where = "torch-ext" , include = ["{{ name }}*" ]),
134+ packages = find_packages (where = "torch-ext" , include = ["{{ python_name }}*" ]),
134135 package_dir = {"" : "torch-ext" },
135136{% if data_globs % }
136- package_data = {"{{ name }}" : [ {{ data_globs }} ]},
137+ package_data = {"{{ python_name }}" : [ {{ data_globs }} ]},
137138{% endif % }
138139 zip_safe = False ,
139140 install_requires = ["torch" ],
Original file line number Diff line number Diff line change @@ -104,16 +104,17 @@ def build_extension(self, ext: CMakeExtension) -> None:
104104 )
105105
106106
107+ {% set python_name = name | replace ('-' , '_' ) % }
107108setup (
108- name = "{{ name }}" ,
109+ name = "{{ python_name }}" ,
109110 # The version is just a stub, it's not used by the final build artefact.
110111 version = "0.1.0" ,
111- ext_modules = [CMakeExtension ("{{ name }}.{{ ops_name }}" )],
112+ ext_modules = [CMakeExtension ("{{ python_name }}.{{ ops_name }}" )],
112113 cmdclass = {"build_ext" : CMakeBuild },
113- packages = find_packages (where = "torch-ext" , include = ["{{ name }}*" ]),
114+ packages = find_packages (where = "torch-ext" , include = ["{{ python_name }}*" ]),
114115 package_dir = {"" : "torch-ext" },
115116{% if data_globs % }
116- package_data = {"{{ name }}" : [ {{ data_globs }} ]},
117+ package_data = {"{{ python_name }}" : [ {{ data_globs }} ]},
117118{% endif % }
118119 zip_safe = False ,
119120 install_requires = ["torch" ],
Original file line number Diff line number Diff line change @@ -105,17 +105,17 @@ def build_extension(self, ext: CMakeExtension) -> None:
105105 for filename in os .listdir (extdir / cfg ):
106106 move (extdir / cfg / filename , extdir / filename )
107107
108-
108+ { % set python_name = name | replace ( '-' , '_' ) % }
109109setup (
110- name = "{{ name }}" ,
110+ name = "{{ python_name }}" ,
111111 # The version is just a stub, it's not used by the final build artefact.
112112 version = "0.1.0" ,
113- ext_modules = [CMakeExtension ("{{ name }}.{{ ops_name }}" )],
113+ ext_modules = [CMakeExtension ("{{ python_name }}.{{ ops_name }}" )],
114114 cmdclass = {"build_ext" : CMakeBuild },
115- packages = find_packages (where = "torch-ext" , include = ["{{ name }}*" ]),
115+ packages = find_packages (where = "torch-ext" , include = ["{{ python_name }}*" ]),
116116 package_dir = {"" : "torch-ext" },
117117{% if data_globs % }
118- package_data = {"{{ name }}" : [ {{ data_globs }} ]},
118+ package_data = {"{{ python_name }}" : [ {{ data_globs }} ]},
119119{% endif % }
120120 zip_safe = False ,
121121 install_requires = ["torch" ],
You can’t perform that action at this time.
0 commit comments