Skip to content

Commit 5f92446

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 5f92446

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
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: 4 additions & 3 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:
@@ -36,7 +36,7 @@
3636
from distutils.command.build import build as _build
3737

3838
if not use_setuptools:
39-
from distutils.core import setup
39+
from distutils.core import Extension, setup
4040
from distutils.command.install import install as _install
4141
from distutils.command.build_ext import build_ext as _build_ext
4242
from distutils.command.build import build as _build
@@ -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)