Skip to content

Commit bc84086

Browse files
committed
Fix build to avoid duplicate files in wheel
Fix the build system to package pure Python files via distutils/setuptools, and limit CMake to installing the compiled extension. The prior logic has installed some of the .py files both via setuptools and via CMake, to different build directories. As a result, the resulting wheel contained duplicate files, e.g.: 2170 05-02-2022 07:08 symengine/__init__.py 2170 05-02-2022 07:08 symengine-0.9.2.data/purelib/symengine/__init__.py Duplicate files cause the wheel to be rejected by the installer package. After the change, a correct wheel is generated. Installation works both via PEP517/wheel and via legacy `setup.py install`.
1 parent 3528389 commit bc84086

File tree

4 files changed

+2
-33
lines changed

4 files changed

+2
-33
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def finalize_options(self):
226226
url="https://github.com/symengine/symengine.py",
227227
python_requires='>=3.7,<4',
228228
zip_safe=False,
229-
packages=['symengine'],
229+
packages=['symengine', 'symengine.lib', 'symengine.tests'],
230230
cmdclass = cmdclass,
231231
classifiers=[
232232
'License :: OSI Approved :: MIT License',

symengine/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
11
add_subdirectory(lib)
2-
add_subdirectory(tests)
3-
4-
set(PY_PATH ${PYTHON_INSTALL_PATH}/symengine)
5-
install(FILES __init__.py utilities.py sympy_compat.py functions.py printing.py
6-
DESTINATION ${PY_PATH}
7-
)

symengine/lib/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ install(TARGETS symengine_wrapper
2828
ARCHIVE DESTINATION ${PY_PATH}
2929
LIBRARY DESTINATION ${PY_PATH}
3030
)
31-
install(FILES __init__.py
31+
install(FILES
3232
${CMAKE_CURRENT_BINARY_DIR}/config.pxi
3333
symengine.pxd
3434
symengine_wrapper.pxd

symengine/tests/CMakeLists.txt

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)