Skip to content
Snippets Groups Projects
Commit 92b62d9c authored by Celeste's avatar Celeste
Browse files

community/py3-sympy: upgrade to 1.12.1

parent f29d2588
No related branches found
No related tags found
1 merge request!68698community/py3-sympy: upgrade to 1.12.1
Pipeline #245680 skipped
# Contributor: Maxim Karasev <mxkrsv@disroot.org>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=py3-sympy
pkgver=1.12
pkgrel=3
pkgver=1.12.1
pkgrel=0
pkgdesc="Computer algebra system written in pure Python"
url="https://www.sympy.org/"
arch="noarch"
......@@ -19,9 +19,7 @@ checkdepends="
py3-pytest-xdist
"
subpackages="$pkgname-doc $pkgname-pyc"
source="https://github.com/sympy/sympy/archive/sympy-$pkgver/py3-sympy-$pkgver.tar.gz
py3.12-factorial.patch
"
source="https://github.com/sympy/sympy/archive/sympy-$pkgver/py3-sympy-$pkgver.tar.gz"
builddir="$srcdir/sympy-sympy-$pkgver"
# DO NOT MERGE with tests enabled: they are fine in CI,
# but get stuck and never complete on the builders.
......@@ -43,7 +41,7 @@ check() {
.testenv/bin/python3 -m installer .dist/*.whl
# test_pinv_rank_deficient_when_diagonalization_fails doesn't complete in over 30mins on the CI
.testenv/bin/python3 -m pytest \
timeout 2h .testenv/bin/python3 -m pytest \
-n auto \
--maxprocesses 24 \
--timeout 600 \
......@@ -60,6 +58,5 @@ package() {
}
sha512sums="
96a89b88f6912d70c56f5bd1903dd3c518963118ff25d033cdcb7da2f260b8ee209d3ab4a4394dd2b5dc0b4585b71ccd55d55c8e5c6e28024cccbedf07ee4360 py3-sympy-1.12.tar.gz
0df6e61d0f9dc8b52aec25b18ec80bf88bd3243b3c286d05038e08ea47f66acec77e0f940766df86d6fdab241fb1d7f08af2715f9d8bbbaf73d52a78cd67836b py3.12-factorial.patch
5e7642b6e70332f521a3bc58a9c19a64f8eb3e9a6cc6cab63a3e02a9343e31a616f6f437b6c9af601f05fb4f3f69efee1b9811370721a456c14264b97697c965 py3-sympy-1.12.1.tar.gz
"
Patch-Source: https://github.com/sympy/sympy/commit/4b82eae46164afb468bb8995d87cbc643dc9e7a6.patch
--
From 4b82eae46164afb468bb8995d87cbc643dc9e7a6 Mon Sep 17 00:00:00 2001
From: Pablo Galindo <pablogsal@gmail.com>
Date: Fri, 9 Jun 2023 11:22:20 +0100
Subject: [PATCH] Fix factorial parsing for Python 3.12
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
---
.mailmap | 1 +
sympy/parsing/sympy_parser.py | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/.mailmap b/.mailmap
index df8403a47432..e44019a18246 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1523,6 +1523,7 @@ naelsondouglas <naelson17@gmail.com>
noam simcha finkelstein <noam.finkelstein@protonmail.com>
numbermaniac <5206120+numbermaniac@users.noreply.github.com>
oittaa <8972248+oittaa@users.noreply.github.com>
+pablogsal <pablogsal@gmail.com>
pekochun <hamburg_hamburger2000@yahoo.co.jp>
prshnt19 <prashant.rawat216@gmail.com>
rahuldan <rahul02013@gmail.com>
diff --git a/sympy/parsing/sympy_parser.py b/sympy/parsing/sympy_parser.py
index 7e3a0e8067ce..1c89f0d25b9a 100644
--- a/sympy/parsing/sympy_parser.py
+++ b/sympy/parsing/sympy_parser.py
@@ -627,7 +627,10 @@ def factorial_notation(tokens: List[TOKEN], local_dict: DICT, global_dict: DICT)
result: List[TOKEN] = []
nfactorial = 0
for toknum, tokval in tokens:
- if toknum == ERRORTOKEN:
+ if toknum == OP and tokval == "!":
+ # In Python 3.12 "!" are OP instead of ERRORTOKEN
+ nfactorial += 1
+ elif toknum == ERRORTOKEN:
op = tokval
if op == '!':
nfactorial += 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment