From a9e70cfd7378b5997a948a90d880b8d8849f7dde323de94a3827d2d798a8752d Mon Sep 17 00:00:00 2001 From: Atri Bhattacharya Date: Wed, 5 Feb 2025 06:01:58 +0000 Subject: [PATCH] * Update to version 7.0.0. * Disable whole swathe of failing tests (gh#Mathics3/mathics-core#1346). * Add python-Mathics-sympy1_13.patch -- Add compatibility for tests against sympy >= 1.13 (upstream commits). * Switch to pyproject_* macros for build. * Require numpy < 2 as numpy2 is not supported yet. * BuildArch: noarch as there are no arch dependent binaries in package. * Enable Python 3.11, 3.12. * Disable Python 3.13. * Drop old compatibility macro redefinition. OBS-URL: https://build.opensuse.org/package/show/science/python-Mathics?expand=0&rev=42 --- .gitattributes | 23 ++ .gitignore | 1 + Mathics3-6.0.4.tar.gz | 3 + Mathics3-7.0.0.tar.gz | 3 + _multibuild | 3 + python-Mathics-relax-numpy-versions.patch | 13 ++ python-Mathics-sympy1_13.patch | 224 ++++++++++++++++++ python-Mathics.changes | 272 ++++++++++++++++++++++ python-Mathics.spec | 150 ++++++++++++ 9 files changed, 692 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Mathics3-6.0.4.tar.gz create mode 100644 Mathics3-7.0.0.tar.gz create mode 100644 _multibuild create mode 100644 python-Mathics-relax-numpy-versions.patch create mode 100644 python-Mathics-sympy1_13.patch create mode 100644 python-Mathics.changes create mode 100644 python-Mathics.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/Mathics3-6.0.4.tar.gz b/Mathics3-6.0.4.tar.gz new file mode 100644 index 0000000..8155e58 --- /dev/null +++ b/Mathics3-6.0.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2d4e41008fb92c6ca00cfb345bbeca14b2ac1b447ae592254f48aba56e91d70 +size 2974339 diff --git a/Mathics3-7.0.0.tar.gz b/Mathics3-7.0.0.tar.gz new file mode 100644 index 0000000..833dce0 --- /dev/null +++ b/Mathics3-7.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d039a5dac244d7342abd29a5663d083ba28a86370f6b5cfddc6604ef42af150b +size 3062274 diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/python-Mathics-relax-numpy-versions.patch b/python-Mathics-relax-numpy-versions.patch new file mode 100644 index 0000000..37d76fb --- /dev/null +++ b/python-Mathics-relax-numpy-versions.patch @@ -0,0 +1,13 @@ +Index: Mathics3-6.0.4/setup.py +=================================================================== +--- Mathics3-6.0.4.orig/setup.py ++++ Mathics3-6.0.4/setup.py +@@ -65,7 +65,7 @@ elif sys.version_info[:2] == (3, 6): + sys.exit(-1) + else: + INSTALL_REQUIRES += [ +- "numpy<1.25", ++ "numpy", + "llvmlite", + "sympy>=1.8", + "pillow >= 9.2", diff --git a/python-Mathics-sympy1_13.patch b/python-Mathics-sympy1_13.patch new file mode 100644 index 0000000..167e000 --- /dev/null +++ b/python-Mathics-sympy1_13.patch @@ -0,0 +1,224 @@ +From ef8a0ceeb213e5dd26a0dba8ec50b66c44c69c56 Mon Sep 17 00:00:00 2001 +From: Juan Mauricio Matera +Date: Tue, 20 Aug 2024 09:18:51 -0300 +Subject: [PATCH] fix tests for sympy conversions (#1073) + +This PR just fixes the pytest, and marks some issues in the conversion +of Lambda functions. + +--------- + +Co-authored-by: rocky +--- + mathics/core/symbols.py | 4 +- + test/core/test_sympy_python_convert.py | 71 +++++++++++++++++--------- + 2 files changed, 49 insertions(+), 26 deletions(-) + +Index: Mathics3-7.0.0/mathics/core/symbols.py +=================================================================== +--- Mathics3-7.0.0.orig/mathics/core/symbols.py ++++ Mathics3-7.0.0/mathics/core/symbols.py +@@ -14,8 +14,8 @@ from mathics.core.element import ( + # I put this constants here instead of inside `mathics.core.convert.sympy` + # to avoid a circular reference. Maybe they should be in its own module. + +-sympy_symbol_prefix = "_Mathics_User_" +-sympy_slot_prefix = "_Mathics_Slot_" ++sympy_symbol_prefix = "_mu_" ++sympy_slot_prefix = "_ms_" + + + # FIXME: This is repeated below +Index: Mathics3-7.0.0/test/core/test_sympy_python_convert.py +=================================================================== +--- Mathics3-7.0.0.orig/test/core/test_sympy_python_convert.py ++++ Mathics3-7.0.0/test/core/test_sympy_python_convert.py +@@ -20,32 +20,39 @@ from mathics.core.convert.python import + from mathics.core.convert.sympy import from_sympy + from mathics.core.expression import Expression + from mathics.core.list import ListExpression +-from mathics.core.symbols import Symbol, SymbolPlus ++from mathics.core.symbols import ( ++ Symbol, ++ SymbolPlus, ++ sympy_slot_prefix, ++ sympy_symbol_prefix, ++) + from mathics.core.systemsymbols import ( + SymbolD, + SymbolDerivative, ++ SymbolFunction, + SymbolGamma, + SymbolIntegrate, + SymbolSin, ++ SymbolSlot, + ) + + + class SympyConvert(unittest.TestCase): + def compare_to_sympy(self, mathics_expr, sympy_expr, **kwargs): +- mathics_expr.to_sympy(**kwargs) == sympy_expr ++ assert mathics_expr.to_sympy(**kwargs) == sympy_expr + + def compare_to_mathics(self, mathics_expr, sympy_expr, **kwargs): +- mathics_expr == from_sympy(sympy_expr, **kwargs) ++ assert mathics_expr == from_sympy(sympy_expr, **kwargs) + + def compare(self, mathics_expr, sympy_expr, **kwargs): + self.compare_to_sympy(mathics_expr, sympy_expr, **kwargs) + self.compare_to_mathics(mathics_expr, sympy_expr) + + def testSymbol(self): +- self.compare(Symbol("Global`x"), sympy.Symbol("_Mathics_User_Global`x")) ++ self.compare(Symbol("Global`x"), sympy.Symbol(f"{sympy_symbol_prefix}Global`x")) + self.compare( + Symbol("_Mathics_User_x"), +- sympy.Symbol("_Mathics_User_System`_Mathics_User_x"), ++ sympy.Symbol(f"{sympy_symbol_prefix}System`_Mathics_User_x"), + ) + + def testReal(self): +@@ -81,15 +88,15 @@ class SympyConvert(unittest.TestCase): + def testAdd(self): + self.compare( + Expression(SymbolPlus, Integer1, Symbol("Global`x")), +- sympy.Add(sympy.Integer(1), sympy.Symbol("_Mathics_User_Global`x")), ++ sympy.Add(sympy.Integer(1), sympy.Symbol(f"{sympy_symbol_prefix}Global`x")), + ) + + def testIntegrate(self): + self.compare( + Expression(SymbolIntegrate, Symbol("Global`x"), Symbol("Global`y")), + sympy.Integral( +- sympy.Symbol("_Mathics_User_Global`x"), +- sympy.Symbol("_Mathics_User_Global`y"), ++ sympy.Symbol(f"{sympy_symbol_prefix}Global`x"), ++ sympy.Symbol(f"{sympy_symbol_prefix}Global`y"), + ), + ) + +@@ -97,8 +104,8 @@ class SympyConvert(unittest.TestCase): + self.compare( + Expression(SymbolD, Symbol("Global`x"), Symbol("Global`y")), + sympy.Derivative( +- sympy.Symbol("_Mathics_User_Global`x"), +- sympy.Symbol("_Mathics_User_Global`y"), ++ sympy.Symbol(f"{sympy_symbol_prefix}Global`x"), ++ sympy.Symbol(f"{sympy_symbol_prefix}Global`y"), + ), + ) + +@@ -111,11 +118,13 @@ class SympyConvert(unittest.TestCase): + ) + expr = Expression(head, Symbol("Global`x"), Symbol("Global`y")) + +- sfxy = sympy.Function(str("_Mathics_User_Global`f"))( +- sympy.Symbol("_Mathics_User_Global`x"), +- sympy.Symbol("_Mathics_User_Global`y"), ++ sfxy = sympy.Function(str(f"{sympy_symbol_prefix}Global`f"))( ++ sympy.Symbol(f"{sympy_symbol_prefix}Global`x"), ++ sympy.Symbol(f"{sympy_symbol_prefix}Global`y"), ++ ) ++ sym_expr = sympy.Derivative( ++ sfxy, sympy.Symbol(f"{sympy_symbol_prefix}Global`x") + ) +- sym_expr = sympy.Derivative(sfxy, sympy.Symbol("_Mathics_User_Global`x")) + + self.compare_to_sympy(expr, sym_expr, **kwargs) + # compare_to_mathics fails because Derivative becomes D (which then evaluates to Derivative) +@@ -124,28 +133,28 @@ class SympyConvert(unittest.TestCase): + kwargs = {"converted_functions": set(["Global`f"])} + + marg1 = Expression(Symbol("Global`f"), Symbol("Global`x")) +- sarg1 = sympy.Function(str("_Mathics_User_Global`f"))( +- sympy.Symbol("_Mathics_User_Global`x") ++ sarg1 = sympy.Function(str(f"{sympy_symbol_prefix}Global`f"))( ++ sympy.Symbol(f"{sympy_symbol_prefix}Global`x") + ) + self.compare(marg1, sarg1, **kwargs) + + marg2 = Expression(Symbol("Global`f"), Symbol("Global`x"), Symbol("Global`y")) +- sarg2 = sympy.Function(str("_Mathics_User_Global`f"))( +- sympy.Symbol("_Mathics_User_Global`x"), +- sympy.Symbol("_Mathics_User_Global`y"), ++ sarg2 = sympy.Function(str(f"{sympy_symbol_prefix}Global`f"))( ++ sympy.Symbol(f"{sympy_symbol_prefix}Global`x"), ++ sympy.Symbol(f"{sympy_symbol_prefix}Global`y"), + ) + self.compare(marg2, sarg2, **kwargs) + + self.compare( + Expression(SymbolD, marg2, Symbol("Global`x")), +- sympy.Derivative(sarg2, sympy.Symbol("_Mathics_User_Global`x")), ++ sympy.Derivative(sarg2, sympy.Symbol(f"{sympy_symbol_prefix}Global`x")), + **kwargs, + ) + + def testExpression(self): + self.compare( + Expression(SymbolSin, Symbol("Global`x")), +- sympy.sin(sympy.Symbol("_Mathics_User_Global`x")), ++ sympy.sin(sympy.Symbol(f"{sympy_symbol_prefix}Global`x")), + ) + + def testConstant(self): +@@ -155,14 +164,28 @@ class SympyConvert(unittest.TestCase): + def testGamma(self): + self.compare( + Expression(SymbolGamma, Symbol("Global`z")), +- sympy.gamma(sympy.Symbol("_Mathics_User_Global`z")), ++ sympy.gamma(sympy.Symbol(f"{sympy_symbol_prefix}Global`z")), + ) + self.compare( + Expression(SymbolGamma, Symbol("Global`z"), Symbol("Global`x")), + sympy.uppergamma( +- sympy.Symbol("_Mathics_User_Global`z"), +- sympy.Symbol("_Mathics_User_Global`x"), ++ sympy.Symbol(f"{sympy_symbol_prefix}Global`z"), ++ sympy.Symbol(f"{sympy_symbol_prefix}Global`x"), ++ ), ++ ) ++ ++ def testSlots(self): ++ """check the conversion of slots in anonymous functions.""" ++ sympy_symbol = sympy.Symbol("x") ++ sympy_lambda_expr = sympy.Lambda(sympy_symbol, sympy_symbol + 1) ++ # compare_to_sympy does not pass because Slot[1] are translated as ++ # functions ++ self.compare_to_mathics( ++ Expression( ++ SymbolFunction, ++ Expression(SymbolPlus, Integer1, Expression(SymbolSlot, Integer1)), + ), ++ sympy_lambda_expr, + ) + + +Index: Mathics3-7.0.0/mathics/builtin/testing_expressions/numerical_properties.py +=================================================================== +--- Mathics3-7.0.0.orig/mathics/builtin/testing_expressions/numerical_properties.py ++++ Mathics3-7.0.0/mathics/builtin/testing_expressions/numerical_properties.py +@@ -42,8 +42,8 @@ class CoprimeQ(Builtin): + ## CoprimeQ also works for complex numbers + ## >> CoprimeQ[1+2I, 1-I] + ## = True +- +- ## This test case is commenteted out because the result produced by sympy is wrong: ++ ++ ## This test case is commented out because the result produced by sympy is wrong: + ## In this case, both numbers can be factorized as 2 (2 + I) and 3 (2 + I): + ## >> CoprimeQ[4+2I, 6+3I] + ## = False +Index: Mathics3-7.0.0/pyproject.toml +=================================================================== +--- Mathics3-7.0.0.orig/pyproject.toml ++++ Mathics3-7.0.0/pyproject.toml +@@ -23,7 +23,7 @@ dependencies = [ + "python-dateutil", + "requests", + "setuptools", +- "sympy>=1.11,<1.13", ++ "sympy>=1.11,<1.14", + ] + license = {text = "GPL"} + name = "Mathics3" diff --git a/python-Mathics.changes b/python-Mathics.changes new file mode 100644 index 0000000..3986678 --- /dev/null +++ b/python-Mathics.changes @@ -0,0 +1,272 @@ +------------------------------------------------------------------- +Sun Feb 2 12:44:43 UTC 2025 - Atri Bhattacharya + +- Update to version 7.0.0: + * Long list of changes, see + +- Disable whole swathe of failing tests + (gh#Mathics3/mathics-core#1346). +- Add python-Mathics-sympy1_13.patch -- Add compatibility for + tests against sympy >= 1.13 (upstream commits). +- Switch to pyproject_* macros for build. +- Require numpy < 2 as numpy2 is not supported yet. +- BuildArch: noarch as there are no arch dependent binaries in + package. +- Enable Python 3.11, 3.12. +- Disable Python 3.13. +- Drop old compatibility macro redefinition. + +------------------------------------------------------------------- +Tue Oct 1 23:18:32 UTC 2024 - Atri Bhattacharya + +- Add python-testsuite as BuildRequires for test flavor. +- Add source dir into PYTHONPATH to allow importing of test helper + modules. + +------------------------------------------------------------------- +Mon Apr 8 05:16:21 UTC 2024 - Atri Bhattacharya + +- Disable python 3.12 as it is unsupported: + https://github.com/Mathics3/mathics-core/issues/932 + +------------------------------------------------------------------- +Fri Dec 1 07:07:18 UTC 2023 - Atri Bhattacharya + +- Update to version 6.0.4: + * Correct type annotation in mathics.session.MathicsSession + (gh#Mathics3/mathics-core#934). + +------------------------------------------------------------------- +Fri Sep 1 18:15:06 UTC 2023 - Atri Bhattacharya + +- Disable cython-ised builds: not compatible with Cython 3+. +- Add python-Mathics-relax-numpy-versions.patch to drop the upper + limit on numpy versions. + +------------------------------------------------------------------- +Wed Jul 26 15:24:55 UTC 2023 - Atri Bhattacharya + +- Update to version 6.0.2: + * Change testing to facilitate openSUSE Tumbleweed distribution + which uses Sympy 1.12 (gh#Mathics3/mathics-core#881). +- Drop python-Mathics-relax-module-versions.patch: No longer + required as upstream has removed numpy and scipy upper limits + from requirements. +- Re-enable test_calculus. + +------------------------------------------------------------------- +Tue Apr 11 07:11:25 UTC 2023 - Atri Bhattacharya + +- Drop some unnecessary Requires: python-recordclass, + python-scipy. +- Add necessary Requires: python-requests, python-Cython, + python-Pillow. +- Add python-Mathics-relax-module-versions.patch: relax sympy and + numpy upper limits on requirements as the otherwise unsupported + sympy 1.12 and numpy 1.24.2 are in Tumbleweed. + +------------------------------------------------------------------- +Tue Mar 14 10:37:24 UTC 2023 - Atri Bhattacharya + +- Update to version 6.0.1: + * Some Pattern-matching code gone over to add type annotations + and to start documenting its behavior and characteristics. + * Combinatorica version upgraded from 0.9 (circa 1992) to 0.91 + (circa 1995) which closer matches the published book. + * Random Builtin function documentation gone over to conform to + current documentation style. + * Pillow 9.2 dependency added for Python 3.7+. +- Drop python-Mathics-relax-sympy-version.patch: No longer needed + as upstream setup.py now allows sympy >= 1.11. +- Disable building for python3.11, unsupported + [gh#Mathics3/mathics-core#743]. +- python-Mathics-Scanner >= 1.3.0 now required. + +------------------------------------------------------------------- +Sun Oct 23 04:51:56 UTC 2022 - Atri Bhattacharya + +- Add python-Mathics-relax-sympy-version.patch: Relax sympy + requirement to allow sympy >= 1.11. + +------------------------------------------------------------------- +Mon Sep 19 12:47:11 UTC 2022 - pgajdos@suse.com + +- does not require python-six + https://trello.com/c/MO53MocR/143-remove-python3-six + +------------------------------------------------------------------- +Wed Aug 10 19:32:00 UTC 2022 - Atri Bhattacharya + +- Update to version 5.0.2: + * Rerelease to get requirements-cython.txt into tarball. +- Changes from version 5.0.1: + * format and do_format methods were removed from the interface + of BaseElement, becoming non-member functions. + * The class BoxElement was introduced as a base for boxing + elements. + * New Builtin 'Inverse Gudermannian'. + * Documentation Hyperbolic functions were split off form + trigonometry and exponential functions. More url links were + added. + * Bugs *r Creating a complex number from Infinity no longer + crashes and returns 'I * Infinity' +- Drop requirements-cython.txt as additional source: now included + in source tarball. + +------------------------------------------------------------------- +Sun Jul 31 20:48:13 UTC 2022 - Atri Bhattacharya + +- Update to version 5.0.0: + * Many changes, see + https://github.com/Mathics3/mathics-core/releases/tag/5.0.0 +- Add requirements-cython.txt as Source since it is missing from + the tagged source tarball. +- Drop upstream incorporated patches: + * python-Mathics-relax-sympy-versions.patch + * 41dee8c9dd7b979a4d77d38a1e8fe8dc75b7638c.patch +- Export USE_CYTHON env variable to allow cythonised builds. +- New BuildRequires (for tests) and Requires: python-recordclass. +- Fix up some new spurious file permissions and EOF encodings. + +------------------------------------------------------------------- +Sun Jul 17 00:51:00 UTC 2022 - Atri Bhattacharya + +- Add python-Mathics-relax-sympy-versions.patch -- Relax required + sympy versions, to enable tests to run on openSUSE >= 1550 where + python-sympy is at version 1.10.x already. + +------------------------------------------------------------------- +Tue Mar 22 19:41:00 UTC 2022 - Atri Bhattacharya + +- Refresh sources: 41dee8c9dd7b979a4d77d38a1e8fe8dc75b7638c.patch + from upstream changed in its indexing a little bit. + +------------------------------------------------------------------- +Wed Mar 16 22:31:06 UTC 2022 - Atri Bhattacharya + +- Add Provides: python-Mathics3 to aid packaging using py2pack + other python module packages dependent on this. + +------------------------------------------------------------------- +Sat Jan 29 19:13:15 UTC 2022 - Atri Bhattacharya + +- Update to version 4.0.0: + * Enhancements + - Introduce a Graphics3D protocol. + - mathics.setting have been gone over to simplify. + - A rudimentary and crude SVG Density Plot was added. + * Bug fixes: + - A small SVGTransform bug was fixed. + - Elliptic arcs are now supported in Asymptote. + - A bug in image decoding introduced in 3.1.0 or so was fixed. + - A bug SVG LineBoxes was fixed. + - SVG and Asymptote drawing now includes inline comments + indicating which Box Structures are being implemented in + code. + * Documentation updates. +- New BuildRequires: python-Cython (to use cython-ised builds), + python-Mathics-Scanner (also Requires), python-scipy (for some + tests). +- Add more Requires according to setup.py. +- Add 41dee8c9dd7b979a4d77d38a1e8fe8dc75b7638c.patch: git commit + from upstream that made version incorrect before tagged release; + apply with -R to revert. +- Drop binaries no longer installed by upstream. +- Enable multibuild: Split out tests into its own flavour, since + some tests require the binary installed with update-alternative + magic. + +------------------------------------------------------------------- +Tue Apr 20 04:19:34 UTC 2021 - Steve Kowalik + +- Don't build for Python 3.6, due to no NumPy. + +------------------------------------------------------------------- +Mon Dec 28 01:52:38 UTC 2020 - Atri Bhattacharya + +- Update to version 1.1.1: + * Mathics Packages added: + - DiscreteMath`CombinatoricaV0.9 (preferred) + - DiscreteMath`CombinatoricaV0.6. + * New builtins: + - StirlingS1, StirlingS2 (not all WL variations handled) + - MapAt (not all WL variations handled) + - PythonForm, SympyForm: these is not in WL. It simply will + show a crude translation to sympy or python. + - Throw and Catch + - With + - FileNameTake + * Enhancements and Bug fixes: + - Workaround for Compile so it accepts functions + (gh#mathics/Mathics#1026) + - Add Trace option to Get. Get["fn", Trace->True] will show + lines as they are read. + - Convert to/from Boolean types properly in from_python, + to_python. Previously they were 0, and 1. + - Extend DeleteCases to accept a levelspec parameter. + - Set Evaluation#exc_result to capture Aborted, Timeout, + Overflow1`, etc. + - ImageData changed to get bits {0,1}, not booleans as + previously. + - Add tokenizer symbols for <-> and -> and the unicode + versions of those. + - Small corrections to Needs, e.g check if already loaded, + correct a typo, etc. + - System`$InputFileName is now set inside Needs and Get + - Install shell scripts dmathicserver, dmathicsscript, and + dmathics to simplify running docker + - Adjust $InputFileName inside Get and Needs. +- Adapt file list to the renaming of mathicsscript to + dmathicsscript and the addition of dmathicserver. + +------------------------------------------------------------------- +Sat Nov 14 22:17:20 UTC 2020 - Atri Bhattacharya + +- Update to version 1.1.0: + * Add Symbolic Comparisons [gh#mathics/Mathics#1000]. + * Support for externally PyPI-packagable builtin modules - + PyMathics. + * SetDirectory fixes [gh#mathics/Mathics#994]. + * Catch `PatternError Exceptions. + * Fix formatting of .. and ... (RepeatAll) + * tokenization of \. without a following space (ReplaceAll) + [gh#mathics/Mathics#992]. + * Support for assignments to named `Pattern` + * Improving support for `Names [gh#mathics/Mathics#1003]. + * Adding a MathicsSession class to simplify running Mathics from + Python [gh#mathics/Mathics#1001]. + * Improving support for `Protect` and `Unprotect` list + of symbols and regular expressions [gh#mathics/Mathics#1003]. +- Updated source URL. +- Disable python2 as it is not supported any more by upstream. +- Run tests: + * Omit home_page tests as they require a running django server + set up first. + * Add additional BuildRequires needed for tests: python-Pint, + python-chardet, python-palettable, python-pytest, + python-requests. +- Sympy >= 1.6 is now required. + +------------------------------------------------------------------- +Mon May 25 06:50:45 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + +------------------------------------------------------------------- +Sun Mar 15 07:58:36 UTC 2020 - Tomáš Chvátal + +- Fix build without python2 + +------------------------------------------------------------------- +Tue Dec 19 10:56:27 UTC 2017 - badshah400@gmail.com + +- Correct License: Includes software licensed as BSD-3-Clause, + MIT, and Apache-2.0, and data licensed under CC-by-SA-3.0 and/or + GFDL. +- Use python_expand to run fdupes for both python 2 and 3. + +------------------------------------------------------------------- +Mon Dec 18 07:34:29 UTC 2017 - badshah400@gmail.com + +- Initial package. + diff --git a/python-Mathics.spec b/python-Mathics.spec new file mode 100644 index 0000000..ed28781 --- /dev/null +++ b/python-Mathics.spec @@ -0,0 +1,150 @@ +# +# spec file for package python-Mathics +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global flavor @BUILD_FLAVOR@%{nil} + +%if "%{flavor}" == "test" +%bcond_without test +%define psuffix -test +%else +%bcond_with test +%define psuffix %{nil} +%endif + +%define skip_python313 1 +%define pyname Mathics3 +Name: python-Mathics%{psuffix} +Version: 7.0.0 +Release: 0 +Summary: A general-purpose computer algebra system +# Mathics itself is licensed as GPL-3.0 but it includes third-party software with MIT, BSD-3-Clause, and Apache-2.0 Licensing; also includes data from wikipedia licensed under CC-BY-SA-3.0 and GFDL-1.3 +License: Apache-2.0 AND BSD-3-Clause AND GPL-3.0-only AND MIT +URL: https://mathics.github.io/ +Source0: https://github.com/Mathics3/mathics-core/releases/download/%{version}/%{pyname}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM python-Mathics-sympy1_13.patch badshah400@gmail.com -- Add compatibility for tests against sympy >= 1.13 +Patch0: python-Mathics-sympy1_13.patch +BuildRequires: %{python_module Django >= 1.8} +BuildRequires: %{python_module colorama} +BuildRequires: %{python_module devel} +BuildRequires: %{python_module mpmath >= 0.19} +BuildRequires: %{python_module numpy < 2} +BuildRequires: %{python_module pexpect} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module python-dateutil} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module sympy >= 1.10.1} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-Mathics-Scanner >= 1.3.0 +Requires: python-Pint +Requires: python-llvmlite +Requires: python-mpmath >= 0.19 +Requires: python-numpy < 2 +Requires: python-palettable +Requires: python-python-dateutil +Requires: python-requests +Requires: python-sympy >= 1.10.1 +Requires: (python-Pillow >= 9.2 if python-base >= 3.7) +Requires(post): update-alternatives +Requires(postun): update-alternatives +Recommends: python-scikit-image >= 0.17 +%if %{with test} +# SECTION For tests +BuildRequires: %{python_module Mathics = %{version}} +BuildRequires: %{python_module Mathics-Scanner >= 1.3.0} +BuildRequires: %{python_module Pillow >= 9.2 if %python-base >= 3.7} +BuildRequires: %{python_module Pint} +BuildRequires: %{python_module chardet} +BuildRequires: %{python_module llvmlite} +BuildRequires: %{python_module palettable} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module requests} +BuildRequires: %{python_module scikit-image >= 0.17} +BuildRequires: %{python_module testsuite} +BuildRequires: %{python_module typing-extensions} +# /SECTION +%endif +Provides: python-Mathics3 = %{version} +BuildArch: noarch +%python_subpackages + +%description +Mathics is a general-purpose computer algebra system (CAS). It is meant to be a +free, lightweight alternative to Mathematica. + +%prep +%autosetup -p1 -n %{pyname}-%{version} + +# REMOVE SHEBANGS FROM FILES INSTALLED TO NON-EXEC LOCATIONS +pushd mathics +for d in `find ./ -prune -type d` +do + find ${d} -name "*.py" -exec sed -i "1,4{/\/usr\/bin\/env/d}" '{}' \; +done +popd + +%build +%if %{without test} +export USE_CYTHON=0 +%pyproject_wheel +%endif + +%install +%if %{without test} +export USE_CYTHON=0 +%pyproject_install +%python_clone -a %{buildroot}%{_bindir}/mathics +%python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif + +%if %{with test} +%check +PYTHONPATH+=:${PWD} +# test_gudermannian needs network access +# test_image: https://github.com/Mathics3/mathics-core/issues/837 +DONTTEST='test_gudermannian or test_image' +# A whole swathe of tests no longer work: https://github.com/Mathics3/mathics-core/issues/1346 +DONTTEST+=' or test_element or test_limit or test_private_doctests_' +DONTTEST+=' or test_associations_private_doctests or test_ArcCos or test_add' +DONTTEST+=' or test_set_and_clear or test_compare_many_members or test_cmp1_no_pass' +DONTTEST+=' or test_makeboxes_ or test_returncode or test_predicates_private_doctests' +# DONTTEST+=' or test_limit or or test_compare_many_members' +# DONTTEST+=' or test_apply_fns_to_lists or test_bessel or test_string_replace_errors' +# DONTTEST+=' or test_set_and_clear or test_predicates_private_doctests or test_ArcCos' +export DONTTEST +export USE_CYTHON=0 +%pytest -k "not (${DONTTEST})" +%endif + +%if %{without test} +%post +%python_install_alternative mathics + +%postun +%python_uninstall_alternative mathics + +%files %{python_files} +%license COPYING.txt +%doc README.rst AUTHORS.txt +%python_alternative %{_bindir}/mathics +%{python_sitelib}/mathics/ +%{python_sitelib}/%{pyname}-%{version}*.*-info/ +%endif + +%changelog