changeset 747:95d3239bec73

FIX: Root-Is-PureLib: false installs into "purelib" but should install into "platlib". Overwrite also the "install" command.
author Franz Glasner <f.glasner@feldmann-mg.com>
date Mon, 30 Oct 2023 15:46:13 +0100
parents d6646cfcdddd
children c27d0812b30d
files setup.py
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/setup.py	Mon Oct 30 09:25:19 2023 +0100
+++ b/setup.py	Mon Oct 30 15:46:13 2023 +0100
@@ -178,6 +178,21 @@
 
                 cmdclass["bdist_wheel"] = BDistWheel
 
+
+            #
+            # See also: https://peps.python.org/pep-0427/
+            # See also: https://github.com/google/or-tools/issues/616
+            #
+            from setuptools.command.install import install
+
+            class InstallPlatlib(install):
+                def finalize_options(self):
+                    super().finalize_options()
+                    if self.distribution.has_ext_modules():
+                        self.install_lib = self.install_platlib
+
+            cmdclass["install"] = InstallPlatlib
+
         from setuptools.dist import Distribution
 
         #