sympde icon indicating copy to clipboard operation
sympde copied to clipboard

Upgrade supported Python version to 3.12

Open kvrigor opened this issue 1 year ago • 1 comments

Address #106. On my local machine (Ubuntu 22.04) the sympde tests pass for sympy 1.9 but fail for sympy 1.10-1.12. Let's see if the CI picks up the same failures I've encountered.

kvrigor avatar May 15 '24 07:05 kvrigor

So the error with sympy 1.12 isn't local to my dev machine and could be replicated here: https://github.com/pyccel/sympde/actions/runs/9091374690/job/24985858819#step:6:33

============================= test session starts ==============================
platform linux -- Python 3.11.[9](https://github.com/pyccel/sympde/actions/runs/9091374690/job/24985858819#step:6:10), pytest-8.2.0, pluggy-1.5.0
rootdir: /home/runner
collected 157 items / 1 error

==================================== ERRORS ====================================
_______________ ERROR collecting exterior/tests/test_compiler.py _______________
/opt/hostedtoolcache/Python/3.[11](https://github.com/pyccel/sympde/actions/runs/9091374690/job/24985858819#step:6:12).9/x64/lib/python3.11/site-packages/sympde/exterior/tests/test_compiler.py:299: in <module>
    test_compiler_3d_poisson()
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/sympde/exterior/tests/test_compiler.py:237: in test_compiler_3d_poisson
    expr = dot(sigma, tau) + div(tau)*u + div(sigma)*v
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/sympde/calculus/core.py:363: in __new__
    if a == b:
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/sympy/core/basic.py:4[17](https://github.com/pyccel/sympde/actions/runs/9091374690/job/24985858819#step:6:18): in __eq__
    a, b = self._hashable_content(), other._hashable_content()
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/sympy/core/symbol.py:363: in _hashable_content
    return (self.name,) + tuple(sorted(self.assumptions0.items()))
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/sympy/core/symbol.py:375: in assumptions0
    return self._assumptions0.copy()
E   AttributeError: 'VectorFunction' object has no attribute '_assumptions0'
=========================== short test summary info ============================
ERROR exterior/tests/test_compiler.py - AttributeError: 'VectorFunction' object has no attribute '_assumptions0'
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 4.30s ===============================

This seems to be a known issue in sympy (issue#25134) and has something to do with incompatible pickle-d objects across sympy versions. Nevertheless, I've added a test for Python 3.12 and the sympde tests still pass even without upgrading sympy.

kvrigor avatar May 15 '24 07:05 kvrigor