From e108841338568d5bc8f2034aa70722d9b221c982 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 17 Feb 2025 15:33:22 -0600 Subject: [PATCH 01/11] Drop python 3.8 --- .github/workflows/ci.yml | 18 +++++++++--------- appveyor.yml | 2 +- setup.py | 8 ++++---- symengine/lib/symengine_wrapper.in.pyx | 6 ------ 4 files changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2763750c..ec7dc82a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,13 +37,13 @@ jobs: CC: gcc - BUILD_TYPE: Release - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' BUILD_SHARED_LIBS: yes OS: ubuntu-20.04 CC: gcc - BUILD_TYPE: Release - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_MPFR: yes INTEGER_CLASS: gmpxx WITH_NUMPY: no @@ -51,14 +51,14 @@ jobs: CC: gcc - BUILD_TYPE: Release - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_MPC: yes OS: ubuntu-20.04 CC: gcc - BUILD_TYPE: Release WITH_MPFR: yes - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' OS: ubuntu-20.04 CC: gcc @@ -84,14 +84,14 @@ jobs: # CC: gcc - BUILD_TYPE: Debug - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_BFD: yes BUILD_SHARED_LIBS: yes OS: ubuntu-20.04 CC: clang - BUILD_TYPE: Release - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_NUMPY: yes OS: ubuntu-20.04 CC: clang @@ -108,7 +108,7 @@ jobs: EXTRA_APT_PACKAGES: 'llvm-14' - BUILD_TYPE: Debug - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_SCIPY: yes WITH_LLVM: 5.0 OS: macos-13 @@ -121,13 +121,13 @@ jobs: CC: clang - BUILD_TYPE: Debug - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_NUMPY: no OS: macos-13 CC: gcc - BUILD_TYPE: Release - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' OS: macos-13 CC: gcc diff --git a/appveyor.yml b/appveyor.yml index f21df0ae..1f02ccd7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,7 +24,7 @@ environment: - BUILD_TYPE: "Release" COMPILER: MSVC15 PLATFORM: "x64" - PYTHON_VERSION: 38-x64 + PYTHON_VERSION: 312-x64 CONDA_INSTALL_LOCN: C:\\Miniconda38-x64 - BUILD_TYPE: "Release" COMPILER: MSVC15 diff --git a/setup.py b/setup.py index 035471db..f76c5a0d 100644 --- a/setup.py +++ b/setup.py @@ -5,8 +5,8 @@ import platform # Make sure the system has the right Python version. -if sys.version_info[:2] < (3, 8): - print("SymEngine requires Python 3.8 or newer. " +if sys.version_info[:2] < (3, 9): + print("SymEngine requires Python 3.9 or newer. " "Python %d.%d detected" % sys.version_info[:2]) sys.exit(-1) @@ -230,7 +230,7 @@ def finalize_options(self): author_email="symengine@googlegroups.com", license="MIT", url="https://github.com/symengine/symengine.py", - python_requires='>=3.8,<4', + python_requires='>=3.9,<4', zip_safe=False, packages=['symengine', 'symengine.lib', 'symengine.tests'], cmdclass = cmdclass, @@ -241,10 +241,10 @@ def finalize_options(self): 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Mathematics', 'Topic :: Scientific/Engineering :: Physics', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', ] ) diff --git a/symengine/lib/symengine_wrapper.in.pyx b/symengine/lib/symengine_wrapper.in.pyx index 26c31ad8..6fe0ffa5 100644 --- a/symengine/lib/symengine_wrapper.in.pyx +++ b/symengine/lib/symengine_wrapper.in.pyx @@ -1213,9 +1213,6 @@ cdef class Basic(object): def __int__(self): return int(float(self)) - def __long__(self): - return int(float(self)) - def __complex__(self): f = self.n(real=False) if not isinstance(f, (ComplexDouble, RealDouble)): @@ -1523,9 +1520,6 @@ cdef class BooleanTrue(BooleanAtom): def _sage_(self): return True - def __nonzero__(self): - return True - def __bool__(self): return True From 08f04ec1341b49e4562fc87fb9cc2140e7702dcb Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 18 Feb 2025 07:20:04 -0600 Subject: [PATCH 02/11] install setuptools --- bin/install_travis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/install_travis.sh b/bin/install_travis.sh index 572bb0d2..0460c58a 100644 --- a/bin/install_travis.sh +++ b/bin/install_travis.sh @@ -2,7 +2,7 @@ # symengine's bin/install_travis.sh will install miniconda -export conda_pkgs="python=${PYTHON_VERSION} pip pytest gmp mpfr" +export conda_pkgs="python=${PYTHON_VERSION} pip pytest setuptools gmp mpfr" if [[ "${WITH_NUMPY}" != "no" ]]; then export conda_pkgs="${conda_pkgs} numpy"; From 0fcebccafdbb35cc82ab1fcdbddd964dfdc65c6a Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 18 Feb 2025 08:09:39 -0600 Subject: [PATCH 03/11] install setuptools on win --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 1f02ccd7..ce1c487c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -97,7 +97,7 @@ install: - set "PATH=C:\Python%PYTHON_VERSION%;C:\Python%PYTHON_VERSION%\Scripts;%PATH%" - echo %PATH% -- pip install nose pytest cython +- pip install nose pytest cython setuptools - if NOT [%WITH_NUMPY%]==[no] pip install numpy - if NOT [%WITH_SYMPY%]==[no] pip install sympy From ec3a60522c84ed2b2942dab67ca77a03d6cbbb73 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 18 Feb 2025 11:24:18 -0600 Subject: [PATCH 04/11] add setuptools to setup_requires --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f76c5a0d..c082f3ea 100644 --- a/setup.py +++ b/setup.py @@ -224,7 +224,7 @@ def finalize_options(self): setup(name="symengine", version="0.14.0", description="Python library providing wrappers to SymEngine", - setup_requires=['cython>=0.29.24'], + setup_requires=['cython>=0.29.24', 'setuptools'], long_description=long_description, author="SymEngine development team", author_email="symengine@googlegroups.com", From 5f924464cbf300748c3b9e4aebf32d78d54d1b5b Mon Sep 17 00:00:00 2001 From: Adrian Ostrowski <81568391+aostrowski-hbn@users.noreply.github.com> Date: Mon, 31 Mar 2025 13:25:46 -0700 Subject: [PATCH 05/11] 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. --- cmake/FindPython.cmake | 2 +- setup.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/FindPython.cmake b/cmake/FindPython.cmake index df8bfdc1..c1f6c439 100644 --- a/cmake/FindPython.cmake +++ b/cmake/FindPython.cmake @@ -60,7 +60,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") endif() execute_process( - COMMAND ${PYTHON_BIN} -c "from sysconfig import get_paths; print(get_paths()['purelib'])" + COMMAND ${PYTHON_BIN} -c "from sysconfig import get_paths; print(get_paths()['platlib'])" OUTPUT_VARIABLE PYTHON_INSTALL_PATH_tmp ) string(STRIP ${PYTHON_INSTALL_PATH_tmp} PYTHON_INSTALL_PATH_tmp) diff --git a/setup.py b/setup.py index c082f3ea..fcd97ec9 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ if use_setuptools: try: - from setuptools import setup + from setuptools import Extension, setup from setuptools.command.install import install as _install from setuptools.command.build_ext import build_ext as _build_ext except ImportError: @@ -36,7 +36,7 @@ from distutils.command.build import build as _build if not use_setuptools: - from distutils.core import setup + from distutils.core import Extension, setup from distutils.command.install import install as _install from distutils.command.build_ext import build_ext as _build_ext from distutils.command.build import build as _build @@ -232,7 +232,8 @@ def finalize_options(self): url="https://github.com/symengine/symengine.py", python_requires='>=3.9,<4', zip_safe=False, - packages=['symengine', 'symengine.lib', 'symengine.tests'], + ext_modules=[Extension(name='symengine.lib', sources=[])], + packages=['symengine', 'symengine.tests'], cmdclass = cmdclass, classifiers=[ 'License :: OSI Approved :: MIT License', From 6da52ebc8687f6477d54963524c8c841ce37f582 Mon Sep 17 00:00:00 2001 From: Adrian Ostrowski Date: Tue, 1 Apr 2025 16:34:43 +0200 Subject: [PATCH 06/11] Fix CMake 4.0.0 build break --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fcd97ec9..5adb759f 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,8 @@ from distutils.command.build import build as _build cmake_opts = [("PYTHON_BIN", sys.executable), - ("CMAKE_INSTALL_RPATH_USE_LINK_PATH", "yes")] + ("CMAKE_INSTALL_RPATH_USE_LINK_PATH", "yes"), + ("CMAKE_POLICY_VERSION_MINIMUM", "3.5")] cmake_generator = [None] cmake_build_type = ["Release"] From 03918d1183d65a2cde1fb8809f2467ebed633257 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 1 Apr 2025 10:34:11 -0500 Subject: [PATCH 07/11] install py files from cmake --- setup.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 5adb759f..28d05bce 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ if use_setuptools: try: - from setuptools import Extension, setup + from setuptools import setup from setuptools.command.install import install as _install from setuptools.command.build_ext import build_ext as _build_ext except ImportError: @@ -36,14 +36,13 @@ from distutils.command.build import build as _build if not use_setuptools: - from distutils.core import Extension, setup + from distutils.core import setup from distutils.command.install import install as _install from distutils.command.build_ext import build_ext as _build_ext from distutils.command.build import build as _build cmake_opts = [("PYTHON_BIN", sys.executable), - ("CMAKE_INSTALL_RPATH_USE_LINK_PATH", "yes"), - ("CMAKE_POLICY_VERSION_MINIMUM", "3.5")] + ("CMAKE_INSTALL_RPATH_USE_LINK_PATH", "yes")] cmake_generator = [None] cmake_build_type = ["Release"] @@ -118,7 +117,7 @@ def cmake_build(self): cmake_cmd = ["cmake", source_dir, "-DCMAKE_BUILD_TYPE=" + cmake_build_type[0], - "-DSYMENGINE_INSTALL_PY_FILES=OFF", + "-DSYMENGINE_INSTALL_PY_FILES=ON", ] cmake_cmd.extend(process_opts(cmake_opts)) if not path.exists(path.join(build_dir, "CMakeCache.txt")): @@ -233,8 +232,7 @@ def finalize_options(self): url="https://github.com/symengine/symengine.py", python_requires='>=3.9,<4', zip_safe=False, - ext_modules=[Extension(name='symengine.lib', sources=[])], - packages=['symengine', 'symengine.tests'], + packages=[], cmdclass = cmdclass, classifiers=[ 'License :: OSI Approved :: MIT License', From fe654772f35b6bd2d285d26e6136ab3dd081a903 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 1 Apr 2025 10:39:47 -0500 Subject: [PATCH 08/11] fix cmake_minimum_required --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c83e7cf..e83c95b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 2.8.12...4.0.0) if (POLICY CMP0057) cmake_policy(SET CMP0057 NEW) # needed for llvm >= 16 From b93259288c8e36ff22d43c17d35e3a42e442ce0e Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 1 Apr 2025 22:12:45 -0500 Subject: [PATCH 09/11] fix installing --- symengine/CMakeLists.txt | 19 +++++++++++++------ symengine/tests/CMakeLists.txt | 19 ++++++++++++------- symengine_version.txt | 2 +- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/symengine/CMakeLists.txt b/symengine/CMakeLists.txt index 907e6f64..bedec397 100644 --- a/symengine/CMakeLists.txt +++ b/symengine/CMakeLists.txt @@ -1,10 +1,17 @@ add_subdirectory(lib) if (SYMENGINE_INSTALL_PY_FILES) - add_subdirectory(tests) - - set(PY_PATH ${PYTHON_INSTALL_PATH}/symengine) - install(FILES __init__.py utilities.py sympy_compat.py functions.py printing.py - DESTINATION ${PY_PATH} - ) + add_subdirectory(tests) + set(PY_PATH ${PYTHON_INSTALL_PATH}/symengine) + install( + FILES + __init__.py + functions.py + printing.py + sympy_compat.py + test_utilities.py + utilities.py + DESTINATION + ${PY_PATH} +) endif () diff --git a/symengine/tests/CMakeLists.txt b/symengine/tests/CMakeLists.txt index ebd4dfaa..4f19093b 100644 --- a/symengine/tests/CMakeLists.txt +++ b/symengine/tests/CMakeLists.txt @@ -1,13 +1,19 @@ set(PY_PATH ${PYTHON_INSTALL_PATH}/symengine/tests) -install(FILES __init__.py +install( + FILES + __init__.py test_arit.py + test_cse.py test_dict_basic.py test_eval.py test_expr.py test_functions.py - test_number.py + test_lambdify.py + test_logic.py test_matrices.py test_ntheory.py + test_number.py + test_pickling.py test_printing.py test_sage.py test_series_expansion.py @@ -16,10 +22,9 @@ install(FILES __init__.py test_subs.py test_symbol.py test_sympify.py + test_sympy_compat.py test_sympy_conv.py test_var.py - test_lambdify.py - test_sympy_compat.py - test_logic.py - DESTINATION ${PY_PATH} - ) + DESTINATION + ${PY_PATH} +) diff --git a/symengine_version.txt b/symengine_version.txt index 4a29f93b..549ada38 100644 --- a/symengine_version.txt +++ b/symengine_version.txt @@ -1 +1 @@ -v0.14.0 +153b7e98f310bccaae586dab6b49284ccd5f4174 From a924eeffc62a094a58f976b5213bf3d1d83fb099 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 3 Apr 2025 11:35:59 -0500 Subject: [PATCH 10/11] bump to 0.14.1 --- setup.py | 2 +- symengine/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 28d05bce..23d948ef 100644 --- a/setup.py +++ b/setup.py @@ -222,7 +222,7 @@ def finalize_options(self): ''' setup(name="symengine", - version="0.14.0", + version="0.14.1", description="Python library providing wrappers to SymEngine", setup_requires=['cython>=0.29.24', 'setuptools'], long_description=long_description, diff --git a/symengine/__init__.py b/symengine/__init__.py index 4ca4dd7c..e9545baf 100644 --- a/symengine/__init__.py +++ b/symengine/__init__.py @@ -63,7 +63,7 @@ def __getattr__(name): raise AttributeError(f"module 'symengine' has no attribute '{name}'") -__version__ = "0.14.0" +__version__ = "0.14.1" # To not expose internals From 6b35fd056a976d002d71c45ae233ab095563f056 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 3 Apr 2025 11:37:15 -0500 Subject: [PATCH 11/11] Add Adrian to AUTHORS. Welcome to SymEngine!! --- .mailmap | 1 + AUTHORS | 1 + 2 files changed, 2 insertions(+) diff --git a/.mailmap b/.mailmap index 5a35cee3..11654a9b 100644 --- a/.mailmap +++ b/.mailmap @@ -22,3 +22,4 @@ Nilay Pochhi Björn Dahlgren Richard Otis richardotis Firat Bezir +Adrian Ostrowski <81568391+aostrowski-hbn@users.noreply.github.com> diff --git a/AUTHORS b/AUTHORS index 19d0bd08..484d38be 100644 --- a/AUTHORS +++ b/AUTHORS @@ -38,3 +38,4 @@ Christian Clauss Moraxyc Aaron Miller <78561124+aaron-skydio@users.noreply.github.com> Firat Bezir +Adrian Ostrowski