diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2763750c..c176f13e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,60 +12,60 @@ jobs: WITH_BFD: yes PYTHON_VERSION: '3.12' TEST_SYMPY: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Debug WITH_BFD: yes PYTHON_VERSION: '3.11' TEST_SYMPY: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Debug WITH_BFD: yes PYTHON_VERSION: '3.10' TEST_SYMPY: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Debug WITH_BFD: yes PYTHON_VERSION: '3.9' TEST_SYMPY: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Release - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' BUILD_SHARED_LIBS: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Release - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_MPFR: yes INTEGER_CLASS: gmpxx WITH_NUMPY: no - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Release - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_MPC: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Release WITH_MPFR: yes - PYTHON_VERSION: '3.8' - OS: ubuntu-20.04 + PYTHON_VERSION: '3.13' + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Release PYTHON_VERSION: '3.9' WITH_MPC: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc - BUILD_TYPE: Release @@ -73,42 +73,44 @@ jobs: WITH_MPC: yes INTEGER_CLASS: flint WITH_FLINT: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: gcc #- BUILD_TYPE: Debug # PYTHON_VERSION: '3.9' # WITH_BFD: yes # WITH_PIRANHA: yes - # OS: ubuntu-20.04 + # OS: ubuntu-22.04 # CC: gcc - BUILD_TYPE: Debug - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_BFD: yes BUILD_SHARED_LIBS: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: clang - BUILD_TYPE: Release - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_NUMPY: yes - OS: ubuntu-20.04 + OS: ubuntu-22.04 CC: clang - BUILD_TYPE: Debug - PYTHON_VERSION: '3.10' + PYTHON_VERSION: '3.12' WITH_SYMPY: yes - WITH_LLVM: 14 + WITH_LLVM: 18 WITH_SCIPY: yes + WITH_LATEST_GCC: yes INTEGER_CLASS: 'boostmp' PYTEST_ADDOPTS: '-k "not integer_nthroot"' - OS: ubuntu-22.04 - EXTRA_APT_REPOSITORY: 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-14 main' - EXTRA_APT_PACKAGES: 'llvm-14' + OS: ubuntu-24.04 + CC: gcc # ubuntu nobel uses gcc-13 + #EXTRA_APT_REPOSITORY: 'deb http://apt.llvm.org/jammy/ llvm-toolchain-nobel-18 main' + EXTRA_APT_PACKAGES: 'llvm-18' - BUILD_TYPE: Debug - PYTHON_VERSION: '3.8' + PYTHON_VERSION: '3.13' WITH_SCIPY: yes WITH_LLVM: 5.0 OS: macos-13 @@ -121,19 +123,19 @@ 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 - BUILD_TYPE: Release PYTHON_VERSION: '3.11' - OS: ubuntu-20.04 + OS: ubuntu-22.04 WITH_MPC: yes WITH_MPFR: yes WITH_FLINT: yes @@ -145,11 +147,21 @@ jobs: CC: gcc steps: + + - uses: conda-incubator/setup-miniconda@v3 + if: matrix.MSYS_ENV == '' + with: + activate-environment: symengine + channel-priority: strict + architecture: x86_64 + channels: conda-forge + conda-remove-defaults: "true" + - name: Checkout code uses: actions/checkout@v4 - name: Build and test symengine - shell: bash + shell: bash -el {0} run: | source bin/test_symengine_unix.sh env: 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 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 diff --git a/appveyor.yml b/appveyor.yml index f21df0ae..ce1c487c 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 @@ -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 diff --git a/bin/install_travis.sh b/bin/install_travis.sh index 572bb0d2..f63a4747 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"; @@ -33,5 +33,4 @@ if [[ "${WITH_SYMPY}" != "no" ]]; then pip install sympy; fi -conda clean --all -source activate $our_install_dir; +conda clean --all \ No newline at end of file diff --git a/bin/test_symengine_unix.sh b/bin/test_symengine_unix.sh index 976f305d..0c62b7d1 100644 --- a/bin/test_symengine_unix.sh +++ b/bin/test_symengine_unix.sh @@ -10,7 +10,7 @@ cd .. # Setup travis for C++ library cd $SOURCE_DIR -source bin/test_symengine_unix.sh +source bin/test_symengine.sh # Setup travis for Python wrappers cd $PYTHON_SOURCE_DIR 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 035471db..23d948ef 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) @@ -117,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")): @@ -222,17 +222,17 @@ 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'], + setup_requires=['cython>=0.29.24', 'setuptools'], long_description=long_description, author="SymEngine development team", 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'], + packages=[], cmdclass = cmdclass, classifiers=[ 'License :: OSI Approved :: MIT License', @@ -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/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/__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 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 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..e49372be 100644 --- a/symengine_version.txt +++ b/symengine_version.txt @@ -1 +1 @@ -v0.14.0 +c9510fb4b5c30b84adb993573a51f2a9a38a4cfe