Repository: Mathics3/mathics-core (language: python)

Issue:
(sympy 1.12) test_calculus fails with AssertionError: Issue 208
<!-- Feel free to remove sections marked optional if they are not relevant. The other sections please fill out. See also https://github.com/Mathics3/mathics-core/blob/master/REPORTING-BUGS.md -->

## Description

On openSUSE Tumbleweed, our sympy packages have moved on to version 1.12, and now we see one failure when running pytest for Mathics 6.0.1 in test_calculus with the message: "AssertionError: Issue 208". I understand that the requirements specify sympy < 1.12, but this is not an option for us when building openSUSE packages for Mathics any more, which is why I just tried running the tests and reporting any issues here anyway.

## How to Reproduce

Using Mathics 6.0.1, python 3.9 and 3.10, numpy 1.24.2, and sympy 1.12, the error may be reproduced by running tests using pytest from the command line terminal.

## Output Given

```
FAILED test/test_calculus.py::test_calculus - AssertionError: Issue 208
```

Full build fail log attached: 
[log.zip](https://github.com/Mathics3/mathics-core/files/12095031/log.zip)



## Expected behavior

Tests should pass.

**All: Mathics version, Installed Python Python packages.

```
[   21s] Mathics 6.0.1
[   21s] on CPython 3.10.12 (main, Jun 28 2023, 17:56:55) [GCC]
[   21s] using SymPy 1.12, mpmath 1.2.1, numpy 1.24.2, cython 0.29.36
```

In addition

**Desktop (please complete the following information):**
 - OS: [e.g. iOS]: Linux/openSUSE Tumbleweed
 - Browser [e.g. chrome, safari]: NA


## Additional context

Found when trying to build RPM packages for openSUSE Tumbleweed


Discussion / hints:
So, the true issue is a request for support for the sympy 1.12, right?
The error seems to be related just to the way the results are ordered. So it would be just a matter of reformulating the test for working with both versions.
Thanks for the information. I'll look at and take care of when I get a chance. 

As for the process though, since our API has become incompatible with 6.x, a branch off of the 6.0.1 release tag is needed and a change should be applied there. 

It may be that a parallel change may be applied to the master branch as well. 

Fix patch:
diff --git a/setup.py b/setup.py
index 09ab41cb3..66327215b 100644
--- a/setup.py
+++ b/setup.py
@@ -57,7 +57,7 @@
         "numpy",
         "llvmlite<0.37",
         "pillow >= 8.4.0",
-        "sympy>=1.8,<1.12",
+        "sympy>=1.8",
     ]
     if is_PyPy:
         print("Mathics does not support PyPy Python 3.6" % sys.version_info[:2])


Test patch:
diff --git a/test/test_calculus.py b/test/test_calculus.py
index fec1a4187..e99ee9926 100644
--- a/test/test_calculus.py
+++ b/test/test_calculus.py
@@ -9,13 +9,13 @@
 def test_calculus():
     for str_expr, str_expected, message in (
         (
-            "Solve[{(7+x)*ma == 167, (5+x)*mb == 167, (7+5)*(ma+mb) == 334}, {ma, mb, x}]",
+            "Solve[{(7+x)*ma == 167, (5+x)*mb == 167, (7+5)*(ma+mb) == 334}, {ma, mb, x}]//Sort",
             "{{ma -> 1169 / 12 - 167 Sqrt[37] / 12, mb -> -835 / 12 + 167 Sqrt[37] / 12, x -> Sqrt[37]}, {ma -> 1169 / 12 + 167 Sqrt[37] / 12, mb -> -835 / 12 - 167 Sqrt[37] / 12, x -> -Sqrt[37]}}",
             "Issue63",
         ),
         (
-            "Solve[{(7+x)*ma == 167, (5+x)*mb == 167, (7+5)*(ma+mb) == 334}, {x, ma, mb}]",
-            "{{x -> -Sqrt[37], ma -> 1169 / 12 + 167 Sqrt[37] / 12, mb -> -835 / 12 - 167 Sqrt[37] / 12}, {x -> Sqrt[37], ma -> 1169 / 12 - 167 Sqrt[37] / 12, mb -> -835 / 12 + 167 Sqrt[37] / 12}}",
+            "Solve[{(7+x)*ma == 167, (5+x)*mb == 167, (7+5)*(ma+mb) == 334}, {x, ma, mb}]//Sort",
+            "{{x -> Sqrt[37], ma -> 1169 / 12 - 167 Sqrt[37] / 12, mb -> -835 / 12 + 167 Sqrt[37] / 12}, {x -> -Sqrt[37], ma -> 1169 / 12 + 167 Sqrt[37] / 12, mb -> -835 / 12 - 167 Sqrt[37] / 12}}",
             "Issue 208",
         ),
         (