Skip to content

Commit 7cfc618

Browse files
Fix Fedora/RedHat installation location
Those OSes have separate platlib and purelib directories. Symengine was installed partially into both from version 0.10.0 onwards. This change marks some of it's packages as ext_modules, which makes setuptools treat the wheel as platform specific and install if fully into platlib (lib64) instead of purelib (lib). This should solve #474.
1 parent f0a013d commit 7cfc618

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

cmake/FindPython.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
6060
endif()
6161

6262
execute_process(
63-
COMMAND ${PYTHON_BIN} -c "from sysconfig import get_paths; print(get_paths()['purelib'])"
63+
COMMAND ${PYTHON_BIN} -c "from sysconfig import get_paths; print(get_paths()['platlib'])"
6464
OUTPUT_VARIABLE PYTHON_INSTALL_PATH_tmp
6565
)
6666
string(STRIP ${PYTHON_INSTALL_PATH_tmp} PYTHON_INSTALL_PATH_tmp)

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
if use_setuptools:
2626
try:
27-
from setuptools import setup
27+
from setuptools import Extension, setup
2828
from setuptools.command.install import install as _install
2929
from setuptools.command.build_ext import build_ext as _build_ext
3030
except ImportError:
@@ -232,7 +232,8 @@ def finalize_options(self):
232232
url="https://github.com/symengine/symengine.py",
233233
python_requires='>=3.9,<4',
234234
zip_safe=False,
235-
packages=['symengine', 'symengine.lib', 'symengine.tests'],
235+
ext_modules=[Extension(name='symengine.lib', sources=[])],
236+
packages=['symengine', 'symengine.tests'],
236237
cmdclass = cmdclass,
237238
classifiers=[
238239
'License :: OSI Approved :: MIT License',

0 commit comments

Comments
 (0)