#7 Update to 0.9.8
Merged 3 years ago by churchyard. Opened 3 years ago by sergesanspaille.
rpms/ sergesanspaille/pythran master  into  master

file removed
-73
@@ -1,73 +0,0 @@ 

- From d7b9d509458a0945d1d314b4d93fd2aaac30de96 Mon Sep 17 00:00:00 2001

- From: serge-sans-paille <serge.guelton@telecom-bretagne.eu>

- Date: Tue, 15 Sep 2020 22:19:32 +0200

- Subject: [PATCH 1/2] Fix several testing issues on m32 architectures

- 

- - Do not overflow using 2**32

- - Be explicit about array type

- 

- This is a partial fix for #1639

- ---

-  pythran/tests/test_numpy_func0.py | 4 ++--

-  pythran/tests/test_numpy_func2.py | 2 +-

-  2 files changed, 3 insertions(+), 3 deletions(-)

- 

- diff --git a/pythran/tests/test_numpy_func0.py b/pythran/tests/test_numpy_func0.py

- index 0ab6f26cc..ed6c26285 100644

- --- a/pythran/tests/test_numpy_func0.py

- +++ b/pythran/tests/test_numpy_func0.py

- @@ -420,7 +420,7 @@ def test_tofile1(self):

-  

-      def test_tofile2(self):

-          temp_name = tempfile.mkstemp()[1]

- -        x = numpy.random.randint(0,2**32,1000).astype(numpy.uint32)

- +        x = numpy.random.randint(0,2**31,1000).astype(numpy.uint32)

-          try:

-              self.run_test("def np_tofile2(x,file): import numpy ; x.tofile(file); return numpy.fromfile(file)", x, temp_name, np_tofile2=[NDArray[numpy.uint32,:], str])

-          finally:

- @@ -462,7 +462,7 @@ def test_fromfile1(self):

-  

-      def test_fromfile2(self):

-          temp_name = tempfile.mkstemp()[1]

- -        x = numpy.random.randint(0,2**32,1000).astype(numpy.uint32)

- +        x = numpy.random.randint(0,2**31,1000).astype(numpy.uint32)

-          x.tofile(temp_name)

-          try:

-              self.run_test("def np_fromfile2(file): from numpy import fromfile, uint32 ; return fromfile(file, uint32)", temp_name, np_fromfile2=[str])

- diff --git a/pythran/tests/test_numpy_func2.py b/pythran/tests/test_numpy_func2.py

- index e378b6501..0ff090a55 100644

- --- a/pythran/tests/test_numpy_func2.py

- +++ b/pythran/tests/test_numpy_func2.py

- @@ -491,7 +491,7 @@ def test_asarray4(self):

-          self.run_test("def np_asarray4(a):\n from numpy import asarray\n return asarray(a[1:])", [(1,2),(3,4)], np_asarray4=[List[Tuple[int, int]]])

-  

-      def test_asarray5(self):

- -        self.run_test("def np_asarray5(a):\n from numpy import asarray\n return asarray(a)", 1, np_asarray5=[int])

- +        self.run_test("def np_asarray5(a):\n from numpy import asarray\n return asarray(a)", 1., np_asarray5=[float])

-  

-      def test_asarray6(self):

-          self.run_test("def np_asarray6(a):\n from numpy import asarray\n return asarray(a, dtype=int)", 1.5, np_asarray6=[float])

- 

- From f59b69c9f08bfb69c391bf3c4ddfa10e3612ac84 Mon Sep 17 00:00:00 2001

- From: serge-sans-paille <serge.guelton@telecom-bretagne.eu>

- Date: Wed, 16 Sep 2020 09:47:17 +0200

- Subject: [PATCH 2/2] Avoid overflow when comparing ranges

- 

- ---

-  pythran/pythonic/builtins/range.hpp | 3 ++-

-  1 file changed, 2 insertions(+), 1 deletion(-)

- 

- diff --git a/pythran/pythonic/builtins/range.hpp b/pythran/pythonic/builtins/range.hpp

- index 75ace78d1..3214ddbbe 100644

- --- a/pythran/pythonic/builtins/range.hpp

- +++ b/pythran/pythonic/builtins/range.hpp

- @@ -64,7 +64,8 @@ namespace builtins

-  

-    bool range_iterator::operator<(range_iterator const &other) const

-    {

- -    return step_ * value_ < step_ * other.value_;

- +    const long sign = +1 | (step_ >> (sizeof(long) * CHAR_BIT - 1));

- +    return sign * value_ < sign * other.value_;

-    }

-  

-    long range_iterator::operator-(range_iterator const &other) const

@@ -0,0 +1,29 @@ 

+ From 4d317755a3b908cc2dada13619f08bae6d741944 Mon Sep 17 00:00:00 2001

+ From: serge-sans-paille <serge.guelton@telecom-bretagne.eu>

+ Date: Sun, 13 Dec 2020 22:12:16 +0100

+ Subject: [PATCH] Make RNG adaptor compatible with libstdc++

+ 

+ ---

+  pythran/pythonic/random/shuffle.hpp | 4 ++--

+  1 file changed, 2 insertions(+), 2 deletions(-)

+ 

+ diff --git a/pythran/pythonic/random/shuffle.hpp b/pythran/pythonic/random/shuffle.hpp

+ index 3d3b9eb91..19b74344f 100644

+ --- a/pythran/pythonic/random/shuffle.hpp

+ +++ b/pythran/pythonic/random/shuffle.hpp

+ @@ -30,13 +30,13 @@ namespace random

+        }

+  

+        typedef unsigned result_type;

+ -      result_type min()

+ +      static constexpr result_type min()

+        {

+          return 0;

+        }

+        /* -1 because of the floor() operation performed by the float->unsigned

+         * conversion */

+ -      result_type max()

+ +      static constexpr result_type max()

+        {

+          return std::numeric_limits<result_type>::max() - 1;

+        }

file modified
+10 -7
@@ -1,5 +1,6 @@ 

  Name:           pythran

- Version:        0.9.7

+ Version:        0.9.8^post3

+ %global uver    0.9.8post3

  Release:        1%{?dist}

  Summary:        Ahead of Time Python compiler for numeric kernels

  
@@ -14,10 +15,10 @@ 

  %py_provides    python3-%{name}

  

  URL:            https://github.com/serge-sans-paille/pythran

- Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz

+ Source0:        %{url}/archive/%{uver}/%{name}-%{uver}.tar.gz

  

- # 32bit tests fixes (merged upstream, but not part of 0.9.7)

- Patch1:         %{url}/pull/1640.patch

+ # Make RNG adaptor compatible with libstdc++

+ Patch1:         %{url}/commit/4d317755a3b908cc.patch

  

  # there is no actual arched content

  # yet we want to test on all architectures
@@ -45,8 +46,6 @@ 

  Requires:       boost-devel

  Requires:       xsimd-devel

  

- Recommends:     python%{python3_version}dist(scipy)

- 

  %description

  Pythran is an ahead of time compiler for a subset of the Python language, with

  a focus on scientific computing. It takes a Python module annotated with a few
@@ -57,7 +56,7 @@ 

  

  

  %prep

- %autosetup -p1

+ %autosetup -p1 -n %{name}-%{uver}

  find -name '*.hpp' -exec chmod -x {} +

  sed -i '1{/#!/d}' pythran/run.py

  
@@ -108,6 +107,10 @@ 

  

  

  %changelog

+ * Sun Dec 13 2020 sguelton@redhat.com - 0.9.8^post3-1

+ - Update to 0.9.8post3

+ - No longer recommend SciPy

+ 

  * Wed Sep 23 2020 Miro Hrončok <mhroncok@redhat.com> - 0.9.7-1

  - Update to 0.9.7

  - Rebuilt for Python 3.9

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (pythran-0.9.7.tar.gz) = 25a0afefcdf53b1c72c37bda48133ec6adfc29473b966992ea781bebac7e8b75c4ef05f045467e329caa6bdd3249a924a5b48eddb5b8b4202ce292fd5f15580f

+ SHA512 (pythran-0.9.8post3.tar.gz) = 2c81745157ffc61018c234f9cae7d1b78bb1f55ae08594fbcf05b3a1025c14ac734457da6724f5778e217ac19913274fdf9e7b77a40f81f3bd28e4ef12257778

no initial comment

With Python 310, I get:

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/sphinx/config.py", line 319, in eval_config_file
    execfile_(filename, namespace)
  File "/usr/lib/python3.10/site-packages/sphinx/util/pycompat.py", line 89, in execfile_
    exec(code, _globals)
  File "/builddir/build/BUILD/pythran-0.9.8/docs/conf.py", line 52, in <module>
    with open("../Changelog") as changelog:
FileNotFoundError: [Errno 2] No such file or directory: '../Changelog'

Do you happen to have a regular scratchbuild with Python 3.9?

rebased onto 48e6c2f84116b67961dec0547bfe604e398fb718

3 years ago

@churchyard patch updated, alongside a post-release upstream. Should work now, thanks for spotting this!

Thanks!

https://koji.fedoraproject.org/koji/taskinfo?taskID=57414242

The new patch should probably have a link to upstream commit / PR in the spec.

The post part of the version needs to be after ^. I can make that change.

patch updated with the appropriate sha1. I leave the post par to you :-)

rebased onto b704fb7372eca7e726d2aedb3a8dbdcc9157b62a

3 years ago

rebased onto 145222a50a3b7b7ab14c0978aa531359028c85d6

3 years ago

This was removed on purpose?

the only error is due to the flaky testsuite, looks good. And yeah scipy recommends got removed because, well it's just that pythran supports some scipy constructs but I don't feel it mandates a Recommends.

I've amended the commit message / changelog. Also submitted a couple scratch build to see how flaky it is (whether it builds on armv7hl at least once).

As a side note, a flaky tests suite times 6 architectures times 2+ hours build can be very annoying, should I open an upstream issue?

rebased onto bee3222

3 years ago

should I open an upstream issue?

filtering out all random-related tests in the specfile is a decent alternative, the problem is well known upstream (you can still open a PR, just to keep track of the issue)

Pull-Request has been merged by churchyard

3 years ago