sympy/sympy-python3.patch
Jerry James cbc69b9ce4 Update to 1.3.
Also:
- Drop upstreamed patches: subexpr-lambdify, test-code-quality, tex-encoding.
- Drop the python2 subpackage.
- Add -python3 patch to ask cython to generate python 3 code.
2018-10-13 13:34:09 -06:00

52 lines
2.4 KiB
Diff

--- sympy-sympy-1.3/sympy/utilities/autowrap.py.orig 2018-09-14 12:51:02.000000000 -0600
+++ sympy-sympy-1.3/sympy/utilities/autowrap.py 2018-10-07 20:17:40.375409612 -0600
@@ -228,6 +228,8 @@ except ImportError:
from distutils.extension import Extension
from Cython.Build import cythonize
cy_opts = {cythonize_options}
+if 'language_level' not in cy_opts or cy_opts['language_level'] == None:
+ cy_opts['language_level'] = 3
{np_import}
ext_mods = [Extension(
{ext_args},
--- sympy-sympy-1.3/sympy/utilities/_compilation/compilation.py.orig 2018-09-14 12:51:02.000000000 -0600
+++ sympy-sympy-1.3/sympy/utilities/_compilation/compilation.py 2018-10-07 20:16:40.951549612 -0600
@@ -292,6 +292,8 @@ def simple_cythonize(src, destdir=None,
try:
cy_options = CompilationOptions(default_options)
cy_options.__dict__.update(cy_kwargs)
+ if cy_options.__dict__['language_level'] == None:
+ cy_options.__dict__['language_level'] = 3
cy_result = cy_compile([src], cy_options)
if cy_result.num_errors > 0:
raise ValueError("Cython compilation failed.")
--- sympy-sympy-1.3/sympy/utilities/tests/test_autowrap.py.orig 2018-09-14 12:51:02.000000000 -0600
+++ sympy-sympy-1.3/sympy/utilities/tests/test_autowrap.py 2018-10-07 21:25:06.458000421 -0600
@@ -104,6 +104,8 @@ except ImportError:
from distutils.extension import Extension
from Cython.Build import cythonize
cy_opts = {}
+if 'language_level' not in cy_opts or cy_opts['language_level'] == None:
+ cy_opts['language_level'] = 3
ext_mods = [Extension(
'wrapper_module_%(num)s', ['wrapper_module_%(num)s.pyx', 'wrapped_code_%(num)s.c'],
@@ -141,6 +143,8 @@ except ImportError:
from distutils.extension import Extension
from Cython.Build import cythonize
cy_opts = {'compiler_directives': {'boundscheck': False}}
+if 'language_level' not in cy_opts or cy_opts['language_level'] == None:
+ cy_opts['language_level'] = 3
ext_mods = [Extension(
'wrapper_module_%(num)s', ['wrapper_module_%(num)s.pyx', 'wrapped_code_%(num)s.c'],
@@ -167,6 +171,8 @@ except ImportError:
from distutils.extension import Extension
from Cython.Build import cythonize
cy_opts = {'compiler_directives': {'boundscheck': False}}
+if 'language_level' not in cy_opts or cy_opts['language_level'] == None:
+ cy_opts['language_level'] = 3
import numpy as np
ext_mods = [Extension(