Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symengine and symengine_py 0.11 #36677

Merged
merged 9 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions build/pkgs/symengine/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=symengine-VERSION.tar.gz
sha1=11885879ddcd0a9ab69e36a79b93aef836d6c95d
md5=4673c85b423241ce85a9df35a7ed61bb
cksum=1344562381
sha1=a2c8957f2099c9199751b165f107bf93d6823818
md5=fe3c3fee1bd8dfdb9576fc2d28cb1076
cksum=3544211225
upstream_url=https://github.com/symengine/symengine/releases/download/vVERSION/symengine-VERSION.tar.gz
1 change: 1 addition & 0 deletions build/pkgs/symengine/distros/arch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
symengine
1 change: 1 addition & 0 deletions build/pkgs/symengine/distros/homebrew.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
symengine
2 changes: 1 addition & 1 deletion build/pkgs/symengine/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.1
0.11.1
45 changes: 45 additions & 0 deletions build/pkgs/symengine/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
SAGE_SPKG_CONFIGURE([symengine], [
m4_pushdef(SAGE_SYMENGINE_VERSION_MAJOR, [0])
m4_pushdef(SAGE_SYMENGINE_VERSION_MINOR, [11])
SAGE_SPKG_DEPCHECK([gmp arb ecm flint mpc mpfr], [
AC_CHECK_HEADER([symengine/symengine_config.h], [], [sage_spkg_install_symengine=yes])
AC_MSG_CHECKING([whether we can link a program using symengine])
SYMENGINE_SAVED_LIBS=$LIBS
LIBS="$LIBS -lsymengine"
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[#include <symengine/expression.h>]],
[[using SymEngine::Expression;
Expression x("x");
auto ex = pow(x+sqrt(Expression(2)), 6);]]
)], [AC_MSG_RESULT([yes])], [
AC_MSG_RESULT([no]); sage_spkg_install_symengine=yes
LIBS=$SYMENGINE_SAVED_LIBS
])
AC_MSG_CHECKING([symengine version >= ]SAGE_SYMENGINE_VERSION_MAJOR[.]SAGE_SYMENGINE_VERSION_MINOR)
AC_RUN_IFELSE([
AC_LANG_PROGRAM(
[[#include <symengine/symengine_config.h>
#include <stdio.h>
]], [[
fprintf(stderr, "%s\n", SYMENGINE_VERSION);
if (SYMENGINE_MAJOR_VERSION >]] SAGE_SYMENGINE_VERSION_MAJOR[[) return 0;
else if (SYMENGINE_MAJOR_VERSION ==]] SAGE_SYMENGINE_VERSION_MAJOR[[ &&
SYMENGINE_MINOR_VERSION >=]] SAGE_SYMENGINE_VERSION_MINOR[[) return 0;
else return 1;
]])], [
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
sage_spkg_install_symengine=yes
], [
dnl assume that the person running cross-compiling
dnl knows what they are doing
AC_MSG_RESULT([yes])
])
])

m4_popdef([SAGE_SYMENGINE_VERSION_MAJOR])
m4_popdef([SAGE_SYMENGINE_VERSION_MINOR])
], [], [], []
)

8 changes: 4 additions & 4 deletions build/pkgs/symengine_py/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=symengine.py-VERSION.tar.gz
sha1=fbbf052e66077ec51df319444b71f94114f33d9e
md5=fc5d2d7f571a880aa2e040214aed2ff0
cksum=2535731241
upstream_url=https://github.com/symengine/symengine.py/archive/vVERSION.tar.gz
sha1=4a8da0d0a057c8709c5b28543dbb3d26a060f013
md5=d10f4ba5c27b09ef234fcafddf824ce5
cksum=1332096394
upstream_url=https://pypi.io/packages/source/p/symengine/symengine-VERSION.tar.gz
1 change: 1 addition & 0 deletions build/pkgs/symengine_py/distros/arch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-symengine
1 change: 1 addition & 0 deletions build/pkgs/symengine_py/distros/freebsd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
math/py-symengine
1 change: 1 addition & 0 deletions build/pkgs/symengine_py/distros/gentoo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dev-python/symengine
2 changes: 1 addition & 1 deletion build/pkgs/symengine_py/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.0
0.11.0
1 change: 1 addition & 0 deletions build/pkgs/symengine_py/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SAGE_SPKG_CONFIGURE([symengine_py], [SAGE_PYTHON_PACKAGE_CHECK([symengine_py])])
2 changes: 1 addition & 1 deletion build/pkgs/symengine_py/type
Original file line number Diff line number Diff line change
@@ -1 +1 @@
experimental
optional
43 changes: 43 additions & 0 deletions src/sage/features/symengine_py.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
r"""
Check for symengine_py
"""

# ****************************************************************************
# Copyright (C) 2023 Dima Pasechnik
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# https://www.gnu.org/licenses/
# ****************************************************************************

from . import PythonModule
from .join_feature import JoinFeature


class symengine_py(JoinFeature):
mkoeppe marked this conversation as resolved.
Show resolved Hide resolved
r"""
A :class:`sage.features.Feature` describing the presence of the
Python package :ref:`symengine_py <spkg_symengine_py>`.

EXAMPLES::

sage: from sage.features.symengine_py import symengine_py
sage: symengine_py().is_present() # optional - symengine_py
FeatureTestResult('symengine_py', True)
"""
def __init__(self):
r"""
TESTS::

sage: from sage.features.symengine_py import symengine_py
sage: isinstance(symengine_py(), symengine_py)
True
"""
JoinFeature.__init__(self, 'symengine_py',
[PythonModule('symengine', spkg="symengine_py",
url="https://pypi.org/project/symengine")])
Comment on lines +38 to +40
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
JoinFeature.__init__(self, 'symengine_py',
[PythonModule('symengine', spkg="symengine_py",
url="https://pypi.org/project/symengine")])
JoinFeature.__init__(self, "symengine_py",
[PythonModule("symengine", spkg="symengine_py",
type="experimental",
url="https://pypi.org/project/symengine")])

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untested, to fix:

File "src/sage/doctest/test.py", line 515, in sage.doctest.test
Failed example:
    subprocess.call(["sage", "-t", "--warn-long", "0",
         "--random-seed=0", "--optional=bad-option", "show_skipped.rst"], **kwds)
Expected:
    Traceback (most recent call last):
    ...
    ValueError: invalid optional tag 'bad-option'
    1
Got:
    /home/runner/work/sage/sage/src/sage/features/__init__.py:107: UserWarning: Feature symengine is declared optional, but it is provided by symengine_py, which is declared experimental in SAGE_ROOT/build/pkgs
      cached = _trivial_unique_representation_cache[key] = type.__call__(cls, *args, **options)
    /home/runner/work/sage/sage/src/sage/features/symengine_py.py:38: UserWarning: Feature symengine_py is declared optional, but it is provided by symengine_py, which is declared experimental in SAGE_ROOT/build/pkgs
      JoinFeature.__init__(self, 'symengine_py',
    Traceback (most recent call last):
      File "/home/runner/work/sage/sage/src/bin/sage-runtests", line 161, in <module>
        DC = DocTestController(args, args.filenames)
      File "/home/runner/work/sage/sage/src/sage/doctest/control.py", line 502, in __init__
        raise ValueError('invalid optional tag {!r}'.format(o))
    ValueError: invalid optional tag 'bad-option'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about promoting symengine_py to optional ? then none of this will be needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me as well. By the way, what's the general roadmap concerning maxima vs symengine?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imho we should be going towards symengine to replace pynac, first of all.

no idea how hard this is, though

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about promoting symengine_py to optional

Fine with me


def all_features():
return [symengine_py()]