-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #244 from LebedevV/master
minor
- Loading branch information
Showing
17 changed files
with
254 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DIST cython-0.29.37.1.gh.tar.gz 2115631 BLAKE2B b81e527ee1da7d16d074102378b531e4b0c161a3d66e47df46b624b02464cbd5c3d08d0e32f8175d56807ed8c6603108b85953db9f51892cfdf8952b4d287399 SHA512 6038499f13914b8a1957eee4d04e0499f448c89c3d519320e5218bf518aacb7d345f3c48614839222eaee016edf549b719520500b0088d28163635a74d35f3c6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Copyright 1999-2023 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
|
||
DISTUTILS_EXT=1 | ||
DISTUTILS_USE_PEP517=setuptools | ||
PYTHON_TESTED=( python3_{10..11} ) | ||
# 3.12 not tested yet for https://github.com/cython/cython/issues/5285. | ||
PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" python3_12 pypy3 ) | ||
PYTHON_REQ_USE="threads(+)" | ||
|
||
inherit distutils-r1 multiprocessing toolchain-funcs elisp-common | ||
|
||
DESCRIPTION="A Python to C compiler" | ||
HOMEPAGE=" | ||
https://cython.org/ | ||
https://github.com/cython/cython/ | ||
https://pypi.org/project/Cython/ | ||
" | ||
SRC_URI=" | ||
https://github.com/cython/cython/archive/${PV}.tar.gz | ||
-> ${P}.gh.tar.gz | ||
" | ||
|
||
LICENSE="Apache-2.0" | ||
SLOT="0" | ||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" | ||
IUSE="emacs test" | ||
RESTRICT="!test? ( test )" | ||
|
||
RDEPEND=" | ||
emacs? ( >=app-editors/emacs-23.1:* ) | ||
" | ||
BDEPEND=" | ||
${RDEPEND} | ||
test? ( | ||
$(python_gen_cond_dep ' | ||
dev-python/numpy[${PYTHON_USEDEP}] | ||
' "${PYTHON_TESTED[@]}") | ||
) | ||
" | ||
|
||
PATCHES=( | ||
"${FILESDIR}/${PN}-0.29.22-spawn-multiprocessing.patch" | ||
"${FILESDIR}/${PN}-0.29.23-test_exceptions-py310.patch" | ||
"${FILESDIR}/${PN}-0.29.23-pythran-parallel-install.patch" | ||
) | ||
|
||
SITEFILE=50cython-gentoo.el | ||
|
||
distutils_enable_sphinx docs | ||
|
||
python_compile() { | ||
# Python gets confused when it is in sys.path before build. | ||
local -x PYTHONPATH= | ||
|
||
distutils-r1_python_compile | ||
} | ||
|
||
python_compile_all() { | ||
use emacs && elisp-compile Tools/cython-mode.el | ||
} | ||
|
||
python_test() { | ||
if ! has "${EPYTHON/./_}" "${PYTHON_TESTED[@]}"; then | ||
einfo "Skipping tests on ${EPYTHON} (xfail)" | ||
return | ||
fi | ||
|
||
tc-export CC | ||
# https://github.com/cython/cython/issues/1911 | ||
local -x CFLAGS="${CFLAGS} -fno-strict-overflow" | ||
"${PYTHON}" runtests.py -vv -j "$(makeopts_jobs)" --work-dir "${BUILD_DIR}"/tests || | ||
die "Tests fail with ${EPYTHON}" | ||
} | ||
|
||
python_install_all() { | ||
local DOCS=( CHANGES.rst README.rst ToDo.txt USAGE.txt ) | ||
distutils-r1_python_install_all | ||
|
||
if use emacs; then | ||
elisp-install ${PN} Tools/cython-mode.* | ||
elisp-site-file-install "${FILESDIR}/${SITEFILE}" | ||
fi | ||
} | ||
|
||
pkg_postinst() { | ||
use emacs && elisp-site-regen | ||
} | ||
|
||
pkg_postrm() { | ||
use emacs && elisp-site-regen | ||
} |
27 changes: 27 additions & 0 deletions
27
dev-python/cython/files/cython-0.29.22-spawn-multiprocessing.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Needed to prevent a loop while calling cythonize on macOS - or any platform | ||
defaulting to the 'spawn' method, as Python 3.8 does on Darwin. | ||
|
||
https://github.com/cython/cython/pull/3263 | ||
|
||
[Rebased on 0.29.22] | ||
|
||
From 15ae78bb74a856836dd64828326f4f0812d36520 Mon Sep 17 00:00:00 2001 | ||
From: Marcel Bargull <marcel.bargull@udo.edu> | ||
Date: Fri, 6 Dec 2019 18:21:19 +0100 | ||
Subject: [PATCH] Disable parallel cythonization for "spawn" start method. | ||
|
||
--- | ||
--- a/Cython/Build/Dependencies.py | ||
+++ b/Cython/Build/Dependencies.py | ||
@@ -1071,6 +1071,11 @@ def cythonize(module_list, exclude=None, nthreads=0, aliases=None, quiet=False, | ||
|
||
if N <= 1: | ||
nthreads = 0 | ||
+ if nthreads: | ||
+ import multiprocessing | ||
+ if multiprocessing.get_start_method() == 'spawn': | ||
+ print('Disabling parallel cythonization for "spawn" process start method.') | ||
+ nthreads = 0 | ||
if nthreads: | ||
# Requires multiprocessing (or Python >= 2.6) | ||
try: |
20 changes: 20 additions & 0 deletions
20
dev-python/cython/files/cython-0.29.23-pythran-parallel-install.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
An empty directory in site-packages is a valid Python module, unfortunately, because | ||
of namespaces. If installing packages in parallel, the pythran module might "exist" | ||
but be empty (hence no __version__ attribute). Catch AttributeError to avoid a narrow | ||
race. | ||
|
||
See https://bugs.gentoo.org/902713. | ||
|
||
This might still be a Portage issue if there's a substantial delay between creating | ||
the directory and installing the remaining files though. | ||
--- a/Cython/Compiler/Pythran.py | ||
+++ b/Cython/Compiler/Pythran.py | ||
@@ -10,7 +10,7 @@ try: | ||
import pythran | ||
pythran_is_pre_0_9 = tuple(map(int, pythran.__version__.split('.')[0:2])) < (0, 9) | ||
pythran_is_pre_0_9_6 = tuple(map(int, pythran.__version__.split('.')[0:3])) < (0, 9, 6) | ||
-except ImportError: | ||
+except (AttributeError, ImportError): | ||
pythran = None | ||
pythran_is_pre_0_9 = True | ||
pythran_is_pre_0_9_6 = True |
14 changes: 14 additions & 0 deletions
14
dev-python/cython/files/cython-0.29.23-test_exceptions-py310.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- a/tests/run/test_exceptions.pyx | ||
+++ b/tests/run/test_exceptions.pyx | ||
@@ -188,7 +188,10 @@ | ||
|
||
# should not apply to subclasses, see issue #31161 | ||
s = '''if True:\nprint "No indent"''' | ||
- ckmsg(s, "expected an indented block", IndentationError) | ||
+ if sys.version_info >= (3, 10): | ||
+ ckmsg(s, "expected an indented block after 'if' statement on line 1", IndentationError) | ||
+ else: | ||
+ ckmsg(s, "expected an indented block", IndentationError) | ||
|
||
s = '''if True:\n print()\n\texec "mixed tabs and spaces"''' | ||
ckmsg(s, "inconsistent use of tabs and spaces in indentation", TabError) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> | ||
<pkgmetadata> | ||
<longdescription lang="en"> | ||
Cython is a language that makes writing C extensions for the Python | ||
language as easy as Python itself. It's based on Pyrex, but supports | ||
more cutting edge functionality and optimizations. | ||
</longdescription> | ||
<upstream> | ||
<remote-id type="pypi">Cython</remote-id> | ||
<remote-id type="github">cython/cython</remote-id> | ||
</upstream> | ||
</pkgmetadata> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
DIST zarr-2.13.3.tar.gz 3577628 BLAKE2B a46324937b5d6e9227a19c5fb7a979664a8d7f352dd7a33800705433be02fb368397758c4b023b7e8f1bce4660ff1601e7371f99dbb1c73549e3aa1885580be0 SHA512 fe914b7f94b6ac3703621a79f1b809c68abf9f03c0a682bdb8eb10a1fc428ad6a1fdc5f6a899d311277fccafc0cc88ee01216df34c854d7664954a4577d1262c | ||
DIST zarr-2.16.1.tar.gz 3597771 BLAKE2B 459f8022b3a4e3298b0f9650738713f6c13bb474ae50005b9387fefc87360f6358e4899037b26b9893d87298b14606d7b29bc1539fc8fa1479a08b30f2c8323b SHA512 e3b7c234c6376bea535d47304d83ee5b4d8b4bfc6952dde5e0bf1276833c1f427c98a7af0867f351e0139404d3729024b591a1f9b2242e219846a994e0762ee5 | ||
DIST zarr-2.18.2.tar.gz 3603055 BLAKE2B bf6dd3a9e23f9e6cbb73acabbd07b3ec61b88518c882c207bd7f05da21ae29204ee2f43f797e597fd50063b6054967cb9f631233d59c36bd80a542b80670403d SHA512 57a2fe78d8dc5794b38e89fd4cc7ca9edf17dc767880cf58efa4266771b4e1e4035ed80301081f4057f9a47f0e6387a45853e6f5bc9dcd54f54d4d50872b7791 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.