Skip to content

Commit 77c598b

Browse files
committed
Change location of Python.Runtime.dll in wheel.
Install Python.Runtime.dll into the same folder as the clr module, rather than the platform specific data folder.
1 parent e822502 commit 77c598b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

setup.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,17 +241,17 @@ class PythonNET_InstallData(install_data):
241241

242242
def run(self):
243243
build_cmd = self.get_finalized_command("build_ext")
244-
install_lib_cmd = self.get_finalized_command("install_lib")
245-
build_dir = os.path.abspath(build_cmd.build_lib)
246-
install_dir = os.path.abspath(install_lib_cmd.install_dir)
244+
install_cmd = self.get_finalized_command("install")
245+
build_lib = os.path.abspath(build_cmd.build_lib)
246+
install_platlib = os.path.relpath(install_cmd.install_platlib, self.install_dir)
247247

248248
for i, data_files in enumerate(self.data_files):
249249
if isinstance(data_files, str):
250-
self.data_files[i] = data_files[i].replace("BUILD_DIR", build_dir)
250+
self.data_files[i] = data_files[i].format(build_lib=build_lib)
251251
else:
252252
for j, filename in enumerate(data_files[1]):
253-
data_files[1][j] = filename.replace("BUILD_DIR", build_dir)
254-
dest = data_files[0].replace("INSTALL_DIR", install_dir)
253+
data_files[1][j] = filename.format(build_lib=build_lib)
254+
dest = data_files[0].format(install_platlib=install_platlib)
255255
self.data_files[i] = dest, data_files[1]
256256

257257
return install_data.run(self)
@@ -324,7 +324,7 @@ def _check_output(*popenargs, **kwargs):
324324
Extension("clr", sources=sources)
325325
],
326326
data_files=[
327-
("INSTALL_DIR", ["BUILD_DIR/Python.Runtime.dll"]),
327+
("{install_platlib}", ["{build_lib}/Python.Runtime.dll"]),
328328
],
329329
scripts=[_npython_exe],
330330
zip_safe=False,

0 commit comments

Comments
 (0)