1
0

Compare commits

..

52 Commits

Author SHA256 Message Date
Ana Guerrero
4632f56ec3 Accepting request 1224949 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/1224949
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=21
2024-11-20 15:58:45 +00:00
60eb19dd17 - Update to 0.17.0
* Support parsing annotated statement
	* Document and test Meson integration
	* Update / improve Blas detection, including scipy-openblas
	* Fix usage of Blas library
	* Improve error reporting
	* Support array module
	* Reduce dependency on setuptools
	* Faster forward substitution
	* Enforce default optimization level to `-O2`
- Drop upstreamed numpy-2.1-interval.patch
- Drop upstreamed numpy-2.1-support.patch
- Drop upstreamed support-gast-0.6.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=54
2024-11-18 21:09:46 +00:00
Dominique Leuenberger
27c961e4d8 Accepting request 1198174 from devel:languages:python:numeric
- Add patch numpy-2.1-support.patch, numpy-2.1-interval.patch:
  * Fix test suite failure with numpy 2.1
- prepare for python 3.13

OBS-URL: https://build.opensuse.org/request/show/1198174
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=20
2024-09-03 11:37:31 +00:00
Dominique Leuenberger
a9d7418085 Accepting request 1190557 from devel:languages:python:numeric
- Add patch support-gast-0.6.patch:
  * Support gast 0.6.0 changes, change Requires appropriately.

OBS-URL: https://build.opensuse.org/request/show/1190557
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=19
2024-08-01 20:03:26 +00:00
Steve Kowalik
ec3fa17564 - Add patch support-gast-0.6.patch:
* Support gast 0.6.0 changes, change Requires appropriately.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=48
2024-07-31 04:35:31 +00:00
Ana Guerrero
3a4347dd93 Accepting request 1184144 from devel:languages:python:numeric
- limit to gast < 0.6.0

OBS-URL: https://build.opensuse.org/request/show/1184144
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=18
2024-07-02 16:14:38 +00:00
adca54398c - limit to gast < 0.6.0
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=46
2024-06-30 20:50:06 +00:00
Ana Guerrero
bd6726f1f6 Accepting request 1180776 from devel:languages:python:numeric
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/1180776
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=17
2024-06-14 16:57:52 +00:00
9a7f0d1c68 - update to 0.16.1:
* Fix massive memory leakage in all ndarray

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=44
2024-06-06 20:23:17 +00:00
Ana Guerrero
7b9a150396 Accepting request 1177345 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/1177345
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=16
2024-05-29 17:35:23 +00:00
9289882dcd Accepting request 1177183 from home:bnavigator:branches:devel:languages:python:numeric
- Update to 0.16.0
  * Support numpy.vectorize, numpy.argsort's kind keyword,
    real/imag on numpy_iexpr
  * Add missing omp.set_num_thread descriptor
  * Provide --trace-allocations switch
  * Support empty PYTHRANRC for reproducible builds
  * Improve compilation time
  * Support ufunc creation through #pythran export ufunc
    func_name(arg_types...)
  * Fix memory leak when returing numpy_gexpr to Python
  * Numpy 2.x support
  * Upgrade xsimd to 13.0.0
  * Improve detection of non-overlapping memory area during gexpr
    assignment
  * Improve python 3.12 support (distutils removal)
  * Support imatmul
  * Only link blas when needed
- Refactor the multibuild test flavor logic
- Accomodate some 15.x intricacies for the failing tests:
  * use netlib lapack/blas instead of openblas

OBS-URL: https://build.opensuse.org/request/show/1177183
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=42
2024-05-28 12:41:40 +00:00
Ana Guerrero
108c3339d7 Accepting request 1149913 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/1149913
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=15
2024-02-25 13:04:54 +00:00
ce579c406b Accepting request 1149905 from home:dimstar:Factory
- Use newly supported shrink{} on OBS to exclude python flavors
  will all python versions skipped.

OBS-URL: https://build.opensuse.org/request/show/1149905
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=40
2024-02-23 12:33:50 +00:00
Ana Guerrero
57d2f49c64 Accepting request 1147370 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/1147370
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=14
2024-02-21 16:53:00 +00:00
42a8035c46 Accepting request 1147360 from home:bnavigator:branches:devel:languages:python:numeric
- Yet another fix of the python39 test skip

OBS-URL: https://build.opensuse.org/request/show/1147360
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=38
2024-02-18 00:09:28 +00:00
fabf7106e6 Accepting request 1146276 from home:bnavigator:branches:devel:languages:python:numeric
- Fix python312 tests: Force linking to openblas with custom
  pythranrc
- Remove test skips no longer needed
- Make test flavors future proof: Don't fail on empty buildset
- Skip python39 for all test flavors: The test-py39 multibuild has
  already been removed but it is still in the build set, so don't
  test it in the other multibuilds.
- Debundle xsimd

OBS-URL: https://build.opensuse.org/request/show/1146276
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=37
2024-02-12 22:30:05 +00:00
3a1f027049 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=36 2024-02-07 09:36:41 +00:00
94c4bccce5 - update to 0.15.0:
* Use pyproject.toml to store setup and build configuration
  * Upgrade xsimd to a48ab430d4b84ecd5449180ee1c6d2eed67c4191
  * Improve detection of non-overlapping memory area during gexpr
    assignment
  * Support python 3.12
  * Support list.clear
  * Improve detection of methods uses as functions
- drop python39 from testing, add python312

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=35
2024-02-06 11:27:16 +00:00
fc9cf6cfea - drop python39 from testing, add python312
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=34
2024-02-06 09:05:17 +00:00
Ana Guerrero
395fe8544a Accepting request 1129689 from devel:languages:python:numeric
- Prepare for Python 3.12, by skipping it for the other test flavors, and
  adding one for it.

OBS-URL: https://build.opensuse.org/request/show/1129689
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=13
2023-11-30 20:59:04 +00:00
Steve Kowalik
dc82b5318c - Prepare for Python 3.12, by skipping it for the other test flavors, and
adding one for it.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=32
2023-11-29 04:28:39 +00:00
Ana Guerrero
c8a8af201f Accepting request 1127832 from devel:languages:python:numeric
- Update to 0.14.0:
  * Numpy compatibility - update signatures, complex number handling, long
    double support
  * Lazyly import top-level modules and submodules
  * Improve array indexing by an array
  * Require at least clang 7 or gcc 8
  * Make pythran compilation reproducible
  * Support np.roll with multiple axis
  * Support numpy.ndarray.view
  * Improve list resizing speed
  * Fix bug when filtering an empty sequence
- Drop patches, now included upstream:
  * numpy-longdouble.patch
  * numpy-complex.patch
- Switch to pyproject macros.

OBS-URL: https://build.opensuse.org/request/show/1127832
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=12
2023-11-22 17:54:06 +00:00
Steve Kowalik
b876032470 - Update to 0.14.0:
* Numpy compatibility - update signatures, complex number handling, long
    double support
  * Lazyly import top-level modules and submodules
  * Improve array indexing by an array
  * Require at least clang 7 or gcc 8
  * Make pythran compilation reproducible
  * Support np.roll with multiple axis
  * Support numpy.ndarray.view
  * Improve list resizing speed
  * Fix bug when filtering an empty sequence
- Drop patches, now included upstream:
  * numpy-longdouble.patch
  * numpy-complex.patch
- Switch to pyproject macros.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=30
2023-11-21 06:45:26 +00:00
Dominique Leuenberger
3fe1d60041 Accepting request 1103601 from devel:languages:python:numeric
Forwarded request #1102981 from ecsos

- Fix build error in Leap, because it must not be two "Patch:" lines.

OBS-URL: https://build.opensuse.org/request/show/1103601
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=11
2023-08-13 17:17:37 +00:00
99ff7f3e99 Accepting request 1102981 from home:ecsos:python
- Fix build error in Leap, because it must not be two "Patch:" lines.

OBS-URL: https://build.opensuse.org/request/show/1102981
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=28
2023-08-12 13:54:02 +00:00
Dominique Leuenberger
e6bd6c692a Accepting request 1101065 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/1101065
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=10
2023-07-28 20:19:50 +00:00
48cbabdad7 Accepting request 1101054 from home:mcalabkova:branches:devel:languages:python:numeric
- Add upstream numpy-longdouble.patch and numpy-complex.patch to support new numpy

OBS-URL: https://build.opensuse.org/request/show/1101054
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=26
2023-07-27 12:18:23 +00:00
Dominique Leuenberger
695821b9b3 Accepting request 1092220 from devel:languages:python:numeric
- Add %{?sle15_python_module_pythons}

OBS-URL: https://build.opensuse.org/request/show/1092220
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=9
2023-06-12 13:24:34 +00:00
57c49b2fca OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=24 2023-06-11 11:31:52 +00:00
a3ec43e016 Accepting request 1092141 from home:ecsos:python
- Add %{?sle15_python_module_pythons}

OBS-URL: https://build.opensuse.org/request/show/1092141
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=23
2023-06-11 11:31:28 +00:00
Dominique Leuenberger
83df97fda2 Accepting request 1087264 from devel:languages:python:numeric
- update to 0.13.1:
  * Bump xsimd dependency to 11.0.0, with a backported patch.
  * Improve performance of functions revieving scalar arguments.
    This changes the internal function call API.
  * Improve performance of fix-stride slicing, using a new slice
    representation.
  * Improve numpy.copyto performance, and detect copyto pattern usage.
  * Force internal linkage of generated functions, which gives more
    optimization room to the C++ compiler.
  * Provide entry points pythran.import_pythrancode and
    pythran.import_pythranfile, as a poor man JIT option.
  * Optimize numpy.argmax(cst * val) into numpy.argmax(val) when cst is
    positive.
  * Avoid copies upon numpy.array_split
  * Get rid of unused functions C++ warnings
  * Avoid generating a loop footer when the loop index is not used
    outside of the loop.
- fix the test-flavor splitting for python311

OBS-URL: https://build.opensuse.org/request/show/1087264
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=8
2023-05-16 12:16:05 +00:00
e5871db16d OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=21 2023-05-15 16:13:49 +00:00
cbb6e21bc1 - fix the test-flavor splitting for python311
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=20
2023-05-15 15:49:14 +00:00
4fed4eb6fe OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=19 2023-05-15 15:25:06 +00:00
2212963a8a - update to 0.13.1:
* Bump xsimd dependency to 11.0.0, with a backported patch.
  * Improve performance of functions revieving scalar arguments.
    This changes the internal function call API.
  * Improve performance of fix-stride slicing, using a new slice
    representation.
  * Improve numpy.copyto performance, and detect copyto pattern usage.
  * Force internal linkage of generated functions, which gives more
    optimization room to the C++ compiler.
  * Provide entry points pythran.import_pythrancode and
    pythran.import_pythranfile, as a poor man JIT option.
  * Optimize numpy.argmax(cst * val) into numpy.argmax(val) when cst is
    positive.
  * Avoid copies upon numpy.array_split
  * Get rid of unused functions C++ warnings
  * Avoid generating a loop footer when the loop index is not used
    outside of the loop.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=18
2023-05-15 15:24:30 +00:00
Dominique Leuenberger
17ee322361 Accepting request 1060837 from devel:languages:python:numeric
- update to 0.12.1:
  * Bump xsimd depdency to 10.0.0
  * Correctly raise KeyError when getting an unset dict item
  * Fix negative binomial implementation
  * Correctly convert strided array with offset
  * Support np.clip(v, None, x) and np.clip(v, x, None)
  * Support scipy.special.ndtr, scipy.special.ndtri, scipy.special.gammaincinv
  * Fix set intersection
  * Support numpy.fft.fftn
  * Support axis parameter in numpy.argsort

OBS-URL: https://build.opensuse.org/request/show/1060837
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=7
2023-01-26 12:56:56 +00:00
3b913b8990 - update to 0.12.1:
* Bump xsimd depdency to 10.0.0
  * Correctly raise KeyError when getting an unset dict item
  * Fix negative binomial implementation
  * Correctly convert strided array with offset
  * Support np.clip(v, None, x) and np.clip(v, x, None)
  * Support scipy.special.ndtr, scipy.special.ndtri, scipy.special.gammaincinv
  * Fix set intersection
  * Support numpy.fft.fftn
  * Support axis parameter in numpy.argsort

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=16
2023-01-25 10:23:22 +00:00
Dominique Leuenberger
5c1938bb2e Accepting request 1045509 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/1045509
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=6
2022-12-29 12:08:46 +00:00
4cb5ff030c Accepting request 1045277 from home:bnavigator:branches:devel:languages:python:numeric
factory-maintainer: bad bot!

OBS-URL: https://build.opensuse.org/request/show/1045277
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=14
2022-12-27 14:31:44 +00:00
75fe01d8a9 - Add 2046-fix-cli-doc-test.patch to fix failing tests
(gh#serge-sans-paille/pythran#2046).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=13
2022-12-17 14:37:24 +00:00
Dominique Leuenberger
a0a7b00ead Accepting request 1038177 from devel:languages:python:numeric
- Skip also failing test_toolchain and test_cli
  (gh#serge-sans-paille/pythran#2044) tests.

OBS-URL: https://build.opensuse.org/request/show/1038177
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=5
2022-11-26 17:45:02 +00:00
9b82a25a73 - Skip also failing test_toolchain and test_cli
(gh#serge-sans-paille/pythran#2044) tests.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=11
2022-11-25 10:26:08 +00:00
f7a3262d62 - Skip also test_toolchain (gh#serge-sans-paille/pythran#2044) test.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=10
2022-11-25 01:55:31 +00:00
Dominique Leuenberger
579bd59446 Accepting request 1009791 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/1009791
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=4
2022-10-22 12:11:56 +00:00
69fb40c00c Accepting request 1009771 from home:bnavigator:branches:devel:languages:python:numeric
- Update to 0.12.0
  * Improve numpy expression computation speed
  * Decent ICC support (fixing an issue from 2018!)
  * Much faster C++ code generation
  * Complete rework of constant folder
  * Support C++-time evaluation of numpy.ndarray.ndim
  * Improved omp declare reduction support
  * Allow indexing of ndarray by integers of mixed types
  * A lot of small pesty bug fixes in the C++ headers
- Drop patches
  * gcc12-fixes.patch
  * pythran-pr1984-fixdistutils.patch

OBS-URL: https://build.opensuse.org/request/show/1009771
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=8
2022-10-11 12:42:02 +00:00
Dominique Leuenberger
8f9543b5fd Accepting request 990028 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/990028
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=3
2022-08-08 06:44:53 +00:00
7c69c9c95f Accepting request 989982 from home:bnavigator:branches:devel:languages:python
- Add pythran-pr1984-fixdistutils.patch
  * gh#serge-sans-paille/pythran#1984
  * Fixes gh#serge-sans-paille/pythran#1984 with setuptools >= 60

OBS-URL: https://build.opensuse.org/request/show/989982
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=6
2022-07-18 18:46:41 +00:00
Dominique Leuenberger
f2fe90f983 Accepting request 961960 from devel:languages:python:numeric
OBS-URL: https://build.opensuse.org/request/show/961960
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=2
2022-03-16 20:30:30 +00:00
8d2b055f70 Accepting request 961802 from home:marxin:branches:devel:languages:python:numeric
- Add gcc12-fixes.patch in order to fix GCC 12 building issues.

OBS-URL: https://build.opensuse.org/request/show/961802
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=4
2022-03-15 15:51:14 +00:00
Dominique Leuenberger
ab0570a88a Accepting request 949968 from devel:languages:python:numeric
build requirement of scipy 1.7

now with fixed empty debuginfo extraction

OBS-URL: https://build.opensuse.org/request/show/949968
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pythran?expand=0&rev=1
2022-02-03 22:16:07 +00:00
3a6ba38613 Accepting request 949789 from home:bnavigator:branches:devel:languages:python:numeric
- Fix errors uncovered by staging:
  * Mention python-pythran-rpmlintrc
  * also make :test-py* noarch so that no debuginfo package fails

- Required by scipy 1.7

OBS-URL: https://build.opensuse.org/request/show/949789
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=2
2022-01-30 01:20:23 +00:00
de3ed981e5 Accepting request 948422 from home:bnavigator:branches:devel:languages:python:numeric
now a mandatory build requirement of scipy 1.7

OBS-URL: https://build.opensuse.org/request/show/948422
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=1
2022-01-25 07:19:24 +00:00
7 changed files with 21 additions and 222 deletions

View File

@ -1,33 +0,0 @@
From 6b61e8a6b3dddab13b88e51309cbdf2f28247960 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
Date: Thu, 22 Aug 2024 08:20:25 +0200
Subject: [PATCH] Fix docstring and implementation of Interval.power
This makes the code more resilient to future numpy changes.
---
pythran/interval.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/pythran/interval.py b/pythran/interval.py
index 4e5dff8fd..b8ef42e69 100644
--- a/pythran/interval.py
+++ b/pythran/interval.py
@@ -196,13 +196,15 @@ def __pow__(range1, range2):
>>> Interval(1, 5) ** Interval(-5, -4)
Interval(low=1.0, high=1.0)
>>> Interval(-1, 5) ** Interval(-5, 3)
- Interval(low=-1.0, high=125.0)
+ Interval(low=-1.0, high=125)
>>> Interval(1, 5) ** Interval(3, 8)
- Interval(low=1.0, high=390625.0)
+ Interval(low=1, high=390625)
"""
res = [v1 ** v2 for v1, v2 in
itertools.product(range1.bounds(), range2.bounds())]
- return Interval(numpy.ceil(min(res)), numpy.floor(max(res)))
+ minres, maxres = min(res), max(res)
+ return Interval(type(minres)(numpy.ceil(minres)),
+ type(maxres)(numpy.floor(maxres)))
def __lshift__(range1, range2):
"""

View File

@ -1,105 +0,0 @@
From 9261d30aa9618cb2a5a698d39752263b076f2d4b Mon Sep 17 00:00:00 2001
From: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
Date: Tue, 20 Aug 2024 23:50:55 +0200
Subject: [PATCH] Fix numpy.fix output type
This one changed with recent numpy upgrade, see
https://github.com/numpy/numpy/pull/26766
---
pythran/pythonic/include/numpy/fix.hpp | 17 ++++++++++++++---
pythran/pythonic/numpy/fix.hpp | 6 +++---
pythran/tests/test_numpy_func0.py | 5 +++++
3 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/pythran/pythonic/include/numpy/fix.hpp b/pythran/pythonic/include/numpy/fix.hpp
index 2708930d6c..e4a85a5049 100644
--- a/pythran/pythonic/include/numpy/fix.hpp
+++ b/pythran/pythonic/include/numpy/fix.hpp
@@ -1,18 +1,29 @@
#ifndef PYTHONIC_INCLUDE_NUMPY_FIX_HPP
#define PYTHONIC_INCLUDE_NUMPY_FIX_HPP
-#include "pythonic/include/utils/functor.hpp"
#include "pythonic/include/types/ndarray.hpp"
+#include "pythonic/include/utils/functor.hpp"
#include "pythonic/include/utils/numpy_traits.hpp"
PYTHONIC_NS_BEGIN
namespace numpy
{
+ namespace wrapper
+ {
+ template <class E>
+ E fix(E const &e)
+ {
+ if (std::is_integral<E>::value)
+ return e;
+ else
+ return std::trunc(e);
+ }
+ } // namespace wrapper
#define NUMPY_NARY_FUNC_NAME fix
-#define NUMPY_NARY_FUNC_SYM std::trunc
+#define NUMPY_NARY_FUNC_SYM wrapper::fix
#include "pythonic/include/types/numpy_nary_expr.hpp"
-}
+} // namespace numpy
PYTHONIC_NS_END
#endif
diff --git a/pythran/pythonic/numpy/fix.hpp b/pythran/pythonic/numpy/fix.hpp
index 5b1b020dc2..84773b61cf 100644
--- a/pythran/pythonic/numpy/fix.hpp
+++ b/pythran/pythonic/numpy/fix.hpp
@@ -3,8 +3,8 @@
#include "pythonic/include/numpy/fix.hpp"
-#include "pythonic/utils/functor.hpp"
#include "pythonic/types/ndarray.hpp"
+#include "pythonic/utils/functor.hpp"
#include "pythonic/utils/numpy_traits.hpp"
PYTHONIC_NS_BEGIN
@@ -13,9 +13,9 @@ namespace numpy
{
#define NUMPY_NARY_FUNC_NAME fix
-#define NUMPY_NARY_FUNC_SYM std::trunc
+#define NUMPY_NARY_FUNC_SYM wrapper::fix
#include "pythonic/types/numpy_nary_expr.hpp"
-}
+} // namespace numpy
PYTHONIC_NS_END
#endif
diff --git a/pythran/tests/test_numpy_func0.py b/pythran/tests/test_numpy_func0.py
index 3e11133fec..41f716d900 100644
--- a/pythran/tests/test_numpy_func0.py
+++ b/pythran/tests/test_numpy_func0.py
@@ -1,12 +1,16 @@
import unittest
from pythran.tests import TestEnv
import numpy
+from packaging import version
import tempfile
import os
from pythran.typing import NDArray, List, Tuple
+np_version = version.parse(numpy.version.version)
+
+
class TestNumpyFunc0(TestEnv):
def test_extended_sum0(self):
@@ -910,6 +914,7 @@ def test_flatnonzero1(self):
def test_fix0(self):
self.run_test("def np_fix0(x): from numpy import fix ; return fix(x)", 3.14, np_fix0=[float])
+ @unittest.skipIf(np_version <= version.Version("2.1"), reason="np.fix used to return float on integral input")
def test_fix1(self):
self.run_test("def np_fix1(x): from numpy import fix ; return fix(x)", 3, np_fix1=[int])

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Mon Nov 18 18:01:06 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Update to 0.17.0
* Support parsing annotated statement
* Document and test Meson integration
* Update / improve Blas detection, including scipy-openblas
* Fix usage of Blas library
* Improve error reporting
* Support array module
* Reduce dependency on setuptools
* Faster forward substitution
* Enforce default optimization level to `-O2`
- Drop upstreamed numpy-2.1-interval.patch
- Drop upstreamed numpy-2.1-support.patch
- Drop upstreamed support-gast-0.6.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Sep 1 13:28:40 UTC 2024 - Dirk Müller <dmueller@suse.com> Sun Sep 1 13:28:40 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@ -47,7 +47,7 @@ ExclusiveArch: x86_64
%endif %endif
Name: python-pythran%{psuffix} Name: python-pythran%{psuffix}
Version: 0.16.1 Version: 0.17.0
Release: 0 Release: 0
Summary: Ahead of Time compiler for numeric kernels Summary: Ahead of Time compiler for numeric kernels
License: BSD-3-Clause License: BSD-3-Clause
@ -55,10 +55,6 @@ URL: https://github.com/serge-sans-paille/pythran
# Tests are only availble from the github archive # Tests are only availble from the github archive
Source0: https://github.com/serge-sans-paille/pythran/archive/refs/tags/%{version}.tar.gz#/pythran-%{version}-gh.tar.gz Source0: https://github.com/serge-sans-paille/pythran/archive/refs/tags/%{version}.tar.gz#/pythran-%{version}-gh.tar.gz
Source99: python-pythran-rpmlintrc Source99: python-pythran-rpmlintrc
# PATCH-FIX-UPSTREAM gh#serge-sans-paille/pythran#840a0e706ec39963aec6bcd1f118bf33177c20b4
Patch0: support-gast-0.6.patch
Patch1: https://github.com/serge-sans-paille/pythran/pull/2231/commits/9261d30aa9618cb2a5a698d39752263b076f2d4b.patch#/numpy-2.1-support.patch
Patch2: https://github.com/serge-sans-paille/pythran/commit/6b61e8a6b3dddab13b88e51309cbdf2f28247960.patch#/numpy-2.1-interval.patch
BuildRequires: %{python_module pip} BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel} BuildRequires: %{python_module wheel}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a2510f370a7d62761844daa112a455785e5a6a216cf9ae704c3926fe68eb65ce
size 3680817

3
pythran-0.17.0-gh.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b1f13ca239625579a92bc915bd0abae3747d96063ce55790eead2a072667fcb3
size 3697173

View File

@ -1,76 +0,0 @@
From 840a0e706ec39963aec6bcd1f118bf33177c20b4 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
Date: Sat, 29 Jun 2024 19:13:02 +0200
Subject: [PATCH] Bump gast requirement to 0.6.0
This mostly helps for harmonious behavior wrt. gast.dump
---
docs/TUTORIAL.rst | 8 ++++----
pythran/utils.py | 2 +-
requirements.txt | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/docs/TUTORIAL.rst b/docs/TUTORIAL.rst
index 09f6902f9..7692547eb 100644
--- a/docs/TUTORIAL.rst
+++ b/docs/TUTORIAL.rst
@@ -20,7 +20,7 @@ Python ships a standard module, ``ast`` to turn Python code into an AST. For ins
>>> code = "a=1"
>>> tree = ast.parse(code) # turn the code into an AST
>>> print(ast.dump(tree)) # view it as a string
- Module(body=[Assign(targets=[Name(id='a', ctx=Store(), annotation=None, type_comment=None)], value=Constant(value=1, kind=None), type_comment=None)], type_ignores=[])
+ Module(body=[Assign(targets=[Name(id='a', ctx=Store())], value=Constant(value=1, kind=None))])
Deciphering the above line, one learns that the single assignment is parsed as
a module containing a single statement, which is an assignment to a single
@@ -33,7 +33,7 @@ Eventually, one needs to parse more complex codes, and things get a bit more cry
... return n if n< 2 else fib(n-1) + fib(n-2)"""
>>> tree = ast.parse(fib_src)
>>> print(ast.dump(tree))
- Module(body=[FunctionDef(name='fib', args=arguments(args=[Name(id='n', ctx=Param(), annotation=None, type_comment=None)], posonlyargs=[], vararg=None, kwonlyargs=[], kw_defaults=[], kwarg=None, defaults=[]), body=[Return(value=IfExp(test=Compare(left=Name(id='n', ctx=Load(), annotation=None, type_comment=None), ops=[Lt()], comparators=[Constant(value=2, kind=None)]), body=Name(id='n', ctx=Load(), annotation=None, type_comment=None), orelse=BinOp(left=Call(func=Name(id='fib', ctx=Load(), annotation=None, type_comment=None), args=[BinOp(left=Name(id='n', ctx=Load(), annotation=None, type_comment=None), op=Sub(), right=Constant(value=1, kind=None))], keywords=[]), op=Add(), right=Call(func=Name(id='fib', ctx=Load(), annotation=None, type_comment=None), args=[BinOp(left=Name(id='n', ctx=Load(), annotation=None, type_comment=None), op=Sub(), right=Constant(value=2, kind=None))], keywords=[]))))], decorator_list=[], returns=None, type_comment=None)], type_ignores=[])
+ Module(body=[FunctionDef(name='fib', args=arguments(args=[Name(id='n', ctx=Param())]), body=[Return(value=IfExp(test=Compare(left=Name(id='n', ctx=Load()), ops=[Lt()], comparators=[Constant(value=2, kind=None)]), body=Name(id='n', ctx=Load()), orelse=BinOp(left=Call(func=Name(id='fib', ctx=Load()), args=[BinOp(left=Name(id='n', ctx=Load()), op=Sub(), right=Constant(value=1, kind=None))]), op=Add(), right=Call(func=Name(id='fib', ctx=Load()), args=[BinOp(left=Name(id='n', ctx=Load()), op=Sub(), right=Constant(value=2, kind=None))]))))])])
The idea remains the same. The whole Python syntax is described in
http://docs.python.org/2/library/ast.html and is worth a glance, otherwise
@@ -199,7 +199,7 @@ constant expressions. In the previous code, there is only two constant
>>> ce = pm.gather(analyses.ConstantExpressions, tree)
>>> sorted(map(ast.dump, ce))
- ["Attribute(value=Name(id='math', ctx=Load(), annotation=None, type_comment=None), attr='cos', ctx=Load())", 'Constant(value=3, kind=None)']
+ ["Attribute(value=Name(id='math', ctx=Load()), attr='cos', ctx=Load())", 'Constant(value=3, kind=None)']
One of the most critical analyse of Pythran is the points-to analysis. There
are two flavors of this analyse, one that computes an over-set of the aliased
@@ -210,7 +210,7 @@ variable, and one that computes an under set. ``Aliases`` computes an over-set::
>>> al = pm.gather(analyses.Aliases, tree)
>>> returned = tree.body[-1].body[-1].value
>>> print(ast.dump(returned))
- Name(id='b', ctx=Load(), annotation=None, type_comment=None)
+ Name(id='b', ctx=Load())
>>> sorted(a.id for a in al[returned])
['c', 'd']
diff --git a/pythran/utils.py b/pythran/utils.py
index 2d7a67327..55a7e8ad6 100644
--- a/pythran/utils.py
+++ b/pythran/utils.py
@@ -106,7 +106,7 @@ def get_variable(assignable):
... slice=ast.Name('j', ast.Load(), None, None),
... ctx=ast.Load())
>>> ast.dump(get_variable(ref))
- "Name(id='a', ctx=Load(), annotation=None, type_comment=None)"
+ "Name(id='a', ctx=Load())"
"""
msg = "Only name and subscript can be assigned."
assert isinstance(assignable, (ast.Name, ast.Subscript)), msg
diff --git a/requirements.txt b/requirements.txt
index fd6a738e5..c7a25c52a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
ply>=3.4
setuptools
-gast~=0.5.0
+gast~=0.6.0
numpy
beniget~=0.4.0