2011-09-02 09:55:13 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package python-Cython
|
|
|
|
|
#
|
2023-01-14 19:31:22 +00:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2011-09-02 09:55:13 +00:00
|
|
|
#
|
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
|
# published by the Open Source Initiative.
|
2011-09-05 14:38:13 +00:00
|
|
|
|
2019-02-04 20:22:05 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2011-09-02 09:55:13 +00:00
|
|
|
#
|
|
|
|
|
|
2018-02-03 14:36:57 +00:00
|
|
|
|
2023-07-12 15:26:05 +00:00
|
|
|
%bcond_with test
|
2023-08-18 17:27:27 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
2012-11-28 13:32:53 +00:00
|
|
|
Name: python-Cython
|
Accepting request 1118531 from devel:languages:python
- update to version 3.0.4:
* Features added
- A new compiler directive show_performance_hints was added to
disable the newly added performance hint output. (Github issue
:issue:`5748`)
* Bugs fixed
- `cythonize` required ``distutils even for operations that did not
build binaries. (Github issue :issue:`5751`)
- A regression in 3.0.3 was fixed that prevented calling inline
functions from another inline function in .pxd files. (Github
issue :issue:`5748`)
- Some C compiler warnings were resolved. Patch by Pierre Jolivet.
(Github issue :issue:`5756`)
- update to version 3.0.3:
* Features added
- More warnings were added to help users migrate and avoid bugs.
(Github issue #5650)
- A warning-like category for performance hints was added that
bypasses -Werror. (Github issue #5673)
- FastGIL now uses standard thread_local in C++. (Github issue
#5640)
- reference_wrapper was added to libcpp.functional. Patch by Vyas
Ramasubramani. (Github issue #5671)
- The cythonize command now supports the --cplus option known from
the cython command. (Github issue #5736)
* Bug fixed
- Performance regressions where the GIL was needlessly acquired
were fixed. (Github issues #5670, #5700)
- A reference leak for exceptions in Python 3.12 was resolved.
Patch by Eric Johnson. (Github issue #5724)
- fastcall calls with keyword arguments generated incorrect C
code. (Github issue #5665)
- Assigning the type converted result of a conditional (if-else)
expression to int or bool variables could lead to incorrect C
code. (Github issue #5731)
- Early (unlikely) failures in Python function wrappers no longer
set a traceback in order to simplify the C code flow. Being
mostly memory allocation errors, they probably would never have
created a traceback anyway. (Github issue #5681)
- Relative cimports from packages with __init__.py files could
fail. (Github issue #5715)
- Several issues with the Limited API support were resolved.
(Github issues #5641, #5648, #5689)
- The code generated for special-casing both Cython functions and
PyCFunctions was cleaned up to avoid calling C-API functions
that were not meant for the other type respectively. This could
previously trigger assertions in CPython debug builds and now
also plays better with the Limited API. (Github issues #4804,
#5739)
- Fix some C compiler warnings. Patches by Ralf Gommers, Oleksandr
Pavlyk, Sebastian Koslowski et al. (Github issues #5651, #5663,
#5668, #5717, #5726, #5734)
- Generating gdb debugging information failed when using generator
expressions. Patch by Oleksandr Pavlyk. (Github issue #5552)
- Passing a setuptools.Extension into cythonize() instead of a
distutils.Extension could make it miss the matching extensions.
- cython -M needlessly required distutils, which made it fail in
Python 3.12. (Github issue #5681)
* Other changes
- The visible deprecation warning for DEF was removed again since
it proved difficult for some users to migrate away from it. The
statement is still meant to be removed at some point (and thus,
like IF, should not be used in new code), but the time for
sunset is probably not around the corner. (Github issue #4310)
- The np_pythran option raise a DeprecationWarning if it receives
other values than True and False. This will eventually be
disallowed (in line with all other boolean options).
OBS-URL: https://build.opensuse.org/request/show/1118531
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-Cython?expand=0&rev=75
2023-10-19 20:47:18 +00:00
|
|
|
Version: 3.0.4
|
2011-09-22 08:48:07 +00:00
|
|
|
Release: 0
|
2011-09-02 09:55:13 +00:00
|
|
|
Summary: The Cython compiler for writing C extensions for the Python language
|
|
|
|
|
License: Apache-2.0
|
2022-03-23 19:15:19 +00:00
|
|
|
URL: https://cython.org/
|
2023-08-18 17:27:27 +00:00
|
|
|
# SourceRepository: https://github.com/cython/cython
|
2016-11-01 08:49:53 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/C/Cython/Cython-%{version}.tar.gz
|
2014-08-05 11:00:01 +00:00
|
|
|
Source1: python-Cython-rpmlintrc
|
2017-03-17 14:04:53 +00:00
|
|
|
BuildRequires: %{python_module devel}
|
2023-07-12 15:26:05 +00:00
|
|
|
BuildRequires: %{python_module pip}
|
|
|
|
|
BuildRequires: %{python_module wheel}
|
2012-05-29 09:37:16 +00:00
|
|
|
BuildRequires: fdupes
|
2015-01-10 22:07:06 +00:00
|
|
|
BuildRequires: gcc-c++
|
2017-03-17 14:04:53 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2015-08-21 06:24:51 +00:00
|
|
|
Requires: python-devel
|
2013-10-17 12:31:03 +00:00
|
|
|
Requires(post): update-alternatives
|
2021-04-24 21:06:35 +00:00
|
|
|
Requires(postun):update-alternatives
|
Accepting request 1107857 from devel:languages:python
- update to version 3.0.2:
* Bugs fixed
+ Using None as default value for arguments annotated as int could
crash Cython. (Github issue :issue:`5643`)
+ Default values of fused types that include complex could
generate invalid C code with -DCYTHON_CCOMPLEX=0. (Github issue
:issue:`5644`)
+ Using C++ enum class types in extension type method signatures
could generate invalid C code. (Github issue :issue:`5637`)
- changes from version 3.0.1:
* Features added
+ The error messages regarding exception declarations were
improved in order to give better help about possible reasons and
fixes. (Github issue :issue:`5547`)
* Bugs fixed
+ Memory view types in Python argument annotations no longer
accept None. They now require an explicit Optional[] or a None
default value in order to allow None to be passed. This was an
oversight in the 3.0.0 release and is a BACKWARDS INCOMPATIBLE
change. However, since it only applies to code using Python
syntax, it probably only applies to newly written code that was
written for Cython 3.0 and can easily be adapted. In most cases,
we expect that this change will avoid bugs in user code rather
than produce problems. (Github issue :issue:`5612`)
+ nogil functions using parallel code could freeze when called
with the GIL held. (Github issues :issue:`5564`, :issue:`5573`)
+ Relative cimports could end up searching globally and find the
same package installed elsewhere, potentially in another
version. (Github issue :issue:`5511`)
+ Attribute lookups on known standard library modules could
accidentally search in the module namespace instead. (Github
issue :issue:`5536`)
+ Using constructed C++ default arguments could generate invalid
C++ code. (Github issue :issue:`5553`)
+ libcpp.memory.make_unique() was lacking C++ exception
handling. (Github issue :issue:`5560`)
+ Some non-public and deprecated CAPI usages were replaced by
public (and thus more future proof) API code.
+ Many issues with the Limited API support were resolved. Patches
by Lisandro Dalcin et al. (Github issues :issue:`5549`,
:issue:`5550`, :issue:`5556`, :issue:`5605`, :issue:`5617`)
+ Some C compiler warnings were resolved. Patches by Matti Picus
et al. (Github issues :issue:`5557`, :issue:`5555`)
+ Large Python integers are now stored in hex instead of decimal
strings to work around security limits in Python and generally
speed up their Python object creation.
+ NULL could not be used as default for fused type pointer
arguments. (Github issue :issue:`5554`)
+ C functions that return pointer types now return NULL as default
exception value. Previously, calling code wasn't aware of this
and always tested for raised exceptions. (Github issue
:issue:`5554`)
+ Untyped literal default arguments in fused functions could
generate invalid C code. (Github issue :issue:`5614`)
+ C variables declared as const could generate invalid C code when
used in closures, generator expressions, ctuples, etc. (Github
issues :issue:`5558`, :issue:`5333`)
+ Enums could not refer to previously defined enums in their
definition. (Github issue :issue:`5602`)
+ The Python conversion code for anonymous C enums conflicted with
regular int conversion. (Github issue :issue:`5623`)
+ Using memory views for property methods (and other special
methods) could lead to refcounting problems. (Github issue
:issue:`5571`)
+ Star-imports could generate code that tried to assign to
constant C macros like PY_SSIZE_T_MAX and PY_SSIZE_T_MIN. Patch
by Philipp Wagner. (Github issue :issue:`5562`)
+ CYTHON_USE_TYPE_SPECS can now be (explicitly) enabled in PyPy.
+ The template parameter "delimeters" in the Tempita Template
class was corrected to "delimiters". The old spelling is still
available in the main template API but now issues a
DeprecationWarning. (Github issue :issue:`5608`)
+ The cython --version output is now less likely to reach both
stdout and stderr. Patch by Eli Schwartz. (Github issue
:issue:`5504`)
+ The sdist was missing the Shadow.pyi stub file.
OBS-URL: https://build.opensuse.org/request/show/1107857
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-Cython?expand=0&rev=74
2023-08-30 08:18:07 +00:00
|
|
|
Conflicts: python-Cython < 3
|
|
|
|
|
Provides: python-Cython3 = %{version}
|
|
|
|
|
Obsoletes: python-Cython3 <= %{version}
|
2017-03-17 14:04:53 +00:00
|
|
|
%python_subpackages
|
|
|
|
|
|
2011-09-02 09:55:13 +00:00
|
|
|
%description
|
2017-10-05 09:49:21 +00:00
|
|
|
The Cython language allows for writing C extensions for the Python
|
|
|
|
|
language. Cython is a source code translator based on Pyrex, but
|
|
|
|
|
supports more cutting edge functionality and optimizations.
|
2011-09-02 09:55:13 +00:00
|
|
|
|
|
|
|
|
The Cython language is very close to the Python language (and most Python
|
|
|
|
|
code is also valid Cython code), but Cython additionally supports calling C
|
|
|
|
|
functions and declaring C types on variables and class attributes. This
|
|
|
|
|
allows the compiler to generate very efficient C code from Cython code.
|
|
|
|
|
|
|
|
|
|
%prep
|
2012-11-28 13:32:53 +00:00
|
|
|
%setup -q -n Cython-%{version}
|
2015-08-06 22:20:33 +00:00
|
|
|
# Fix non-executable scripts
|
|
|
|
|
sed -i "s|^#!.*||" Cython/Debugger/{libpython,Cygdb}.py cython.py
|
2011-09-02 09:55:13 +00:00
|
|
|
|
|
|
|
|
%build
|
2018-02-25 11:20:57 +00:00
|
|
|
export CFLAGS="%{optflags} -fno-strict-aliasing"
|
2023-07-12 15:26:05 +00:00
|
|
|
%pyproject_wheel
|
2011-09-02 09:55:13 +00:00
|
|
|
|
|
|
|
|
%install
|
2023-07-12 15:26:05 +00:00
|
|
|
%pyproject_install
|
2015-08-06 22:20:33 +00:00
|
|
|
for p in cython cythonize cygdb ; do
|
2022-10-27 11:52:16 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/$p
|
2015-08-06 22:20:33 +00:00
|
|
|
done
|
2015-01-10 22:07:06 +00:00
|
|
|
|
2017-10-13 12:07:01 +00:00
|
|
|
%{python_expand chmod a+x %{buildroot}%{$python_sitearch}/Cython/Build/Cythonize.py
|
2018-02-25 11:20:57 +00:00
|
|
|
sed -i "s|^#!%{_bindir}/env python$|#!%{__$python}|" %{buildroot}%{$python_sitearch}/Cython/Build/Cythonize.py
|
2017-10-13 12:07:01 +00:00
|
|
|
$python -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/Cython/Build/
|
|
|
|
|
$python -O -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/Cython/Build/
|
|
|
|
|
%fdupes %{buildroot}%{$python_sitearch}
|
|
|
|
|
}
|
2013-10-17 12:31:03 +00:00
|
|
|
|
2022-02-03 22:16:15 +00:00
|
|
|
%check
|
|
|
|
|
%if %{with test}
|
|
|
|
|
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch} PYTHONDONTWRITEBYTECODE=1
|
|
|
|
|
$python runtests.py -v
|
|
|
|
|
}
|
|
|
|
|
%endif
|
|
|
|
|
|
2013-10-17 12:31:03 +00:00
|
|
|
%post
|
2017-03-17 14:04:53 +00:00
|
|
|
%python_install_alternative cython cythonize cygdb
|
2013-10-17 12:31:03 +00:00
|
|
|
|
2015-08-06 22:20:33 +00:00
|
|
|
%postun
|
2017-03-17 14:04:53 +00:00
|
|
|
%python_uninstall_alternative cython
|
2013-10-17 12:31:03 +00:00
|
|
|
|
2017-03-17 14:04:53 +00:00
|
|
|
%files %{python_files}
|
2018-02-25 11:20:57 +00:00
|
|
|
%license LICENSE.txt COPYING.txt
|
2018-03-22 10:56:09 +00:00
|
|
|
%doc README.rst ToDo.txt USAGE.txt
|
2017-03-17 14:04:53 +00:00
|
|
|
%python_alternative %{_bindir}/cygdb
|
|
|
|
|
%python_alternative %{_bindir}/cython
|
|
|
|
|
%python_alternative %{_bindir}/cythonize
|
2012-11-28 13:32:53 +00:00
|
|
|
%{python_sitearch}/Cython/
|
2023-08-18 17:27:27 +00:00
|
|
|
%{python_sitearch}/Cython-%{version}.dist-info
|
2012-11-28 13:32:53 +00:00
|
|
|
%{python_sitearch}/cython.py*
|
2017-10-13 12:07:01 +00:00
|
|
|
%pycache_only %{python_sitearch}/__pycache__/cython*.py*
|
2012-05-29 09:37:16 +00:00
|
|
|
%{python_sitearch}/pyximport/
|
2011-09-02 09:55:13 +00:00
|
|
|
|
|
|
|
|
%changelog
|