Skip to content

Commit

Permalink
Merge pull request #244 from LebedevV/master
Browse files Browse the repository at this point in the history
minor
  • Loading branch information
istitov authored Jun 24, 2024
2 parents 79e6401 + ad6e59a commit e32c54b
Show file tree
Hide file tree
Showing 17 changed files with 254 additions and 72 deletions.
1 change: 1 addition & 0 deletions dev-python/abTEM/abTEM-1.0.5.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ RDEPEND="
dev-python/distributed[${PYTHON_USEDEP}]
dev-python/dask-labextension[${PYTHON_USEDEP}]
dev-python/pyFFTW[${PYTHON_USEDEP}]
dev-python/tabulate[${PYTHON_USEDEP}]
"

DEPEND="${RDEPEND}
Expand Down
3 changes: 2 additions & 1 deletion dev-python/cupy/cupy-12.2.0-r1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ DEPEND="
>=sci-libs/hipFFT-${ROCM_VERSION}[${ROCM_USEDEP}]
>=sci-libs/hipRAND-${ROCM_VERSION}[${ROCM_USEDEP}]
>=sci-libs/rocThrust-${ROCM_VERSION}[${ROCM_USEDEP}]
>=sci-libs/hipSPARSE-${ROCM_VERSION}[${ROCM_USEDEP}] )"
>=sci-libs/hipSPARSE-${ROCM_VERSION}[${ROCM_USEDEP}] )
"
RDEPEND=">=dev-python/fastrlock-0.8.1
${DEPEND}"

Expand Down
4 changes: 2 additions & 2 deletions dev-python/cupy/cupy-13.1.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ DEPEND="
>=sci-libs/hipFFT-${ROCM_VERSION}[${ROCM_USEDEP}]
>=sci-libs/hipRAND-${ROCM_VERSION}[${ROCM_USEDEP}]
>=sci-libs/rocThrust-${ROCM_VERSION}[${ROCM_USEDEP}]
>=sci-libs/hipSPARSE-${ROCM_VERSION}[${ROCM_USEDEP}] )"
# <dev-python/cython-3[${PYTHON_USEDEP}]
>=sci-libs/hipSPARSE-${ROCM_VERSION}[${ROCM_USEDEP}] )
<dev-python/cython-3[${PYTHON_USEDEP}]"
RDEPEND=">=dev-python/fastrlock-0.8.1
${DEPEND}"

Expand Down
5 changes: 3 additions & 2 deletions dev-python/cupy/cupy-13.2.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ DEPEND="
>=sci-libs/hipFFT-${ROCM_VERSION}[${ROCM_USEDEP}]
>=sci-libs/hipRAND-${ROCM_VERSION}[${ROCM_USEDEP}]
>=sci-libs/rocThrust-${ROCM_VERSION}[${ROCM_USEDEP}]
>=sci-libs/hipSPARSE-${ROCM_VERSION}[${ROCM_USEDEP}] )"
# <dev-python/cython-3[${PYTHON_USEDEP}]
>=sci-libs/hipSPARSE-${ROCM_VERSION}[${ROCM_USEDEP}] )
<dev-python/cython-3[${PYTHON_USEDEP}]"
#
RDEPEND=">=dev-python/fastrlock-0.8.1
${DEPEND}"

Expand Down
1 change: 1 addition & 0 deletions dev-python/cython/Manifest
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
94 changes: 94 additions & 0 deletions dev-python/cython/cython-0.29.37.1.ebuild
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 dev-python/cython/files/cython-0.29.22-spawn-multiprocessing.patch
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:
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 dev-python/cython/files/cython-0.29.23-test_exceptions-py310.patch
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)
13 changes: 13 additions & 0 deletions dev-python/cython/metadata.xml
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>
37 changes: 6 additions & 31 deletions dev-python/diffpy_structure/diffpy_structure-3.0.1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,23 @@
# Distributed under the terms of the GNU General Public License v2

EAPI=8

MYPN="${PN/_/.}"
MYP="${MYPN}-${PV}"
PYTHON_COMPAT=( python3_{9..12} )

inherit distutils-r1 flag-o-matic

MYPN="${PN/diffpy_structure/diffpy.structure}"
MYP="${MYPN}-${PV}"
inherit distutils-r1 flag-o-matic pypi

DESCRIPTION="Crystal structure container and parsers for structure formats"
HOMEPAGE="https://github.com/diffpy/diffpy.structure"
SRC_URI="mirror://pypi/${MYP:0:1}/${MYPN}/${MYP}.tar.gz"
SRC_URI="$(pypi_sdist_url --no-normalize "${MYPN}" "${PV}")"
S=${WORKDIR}/${MYP}


LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
IUSE="doc python"

RDEPEND="
>=dev-python/numpy-1.5.1[${PYTHON_USEDEP}]
dev-python/setuptools[${PYTHON_USEDEP}]
"

DEPEND="${RDEPEND}
doc? ( dev-util/gtk-doc )
"

REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"

S="${WORKDIR}/${MYP}"

python_compile() {
distutils-r1_python_compile
}

python_compile_all() {
use doc && setup.py build
}

python_test() {
setup.py test
}

python_install_all() {
distutils-r1_python_install_all
}
37 changes: 6 additions & 31 deletions dev-python/diffpy_structure/diffpy_structure-3.1.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,23 @@
# Distributed under the terms of the GNU General Public License v2

EAPI=8

MYPN="${PN/_/.}"
MYP="${MYPN}-${PV}"
PYTHON_COMPAT=( python3_{9..12} )

inherit distutils-r1 flag-o-matic

MYPN="${PN/diffpy_structure/diffpy.structure}"
MYP="${MYPN}-${PV}"
inherit distutils-r1 flag-o-matic pypi

DESCRIPTION="Crystal structure container and parsers for structure formats"
HOMEPAGE="https://github.com/diffpy/diffpy.structure"
SRC_URI="mirror://pypi/${MYP:0:1}/${MYPN}/${MYP}.tar.gz"
SRC_URI="$(pypi_sdist_url --no-normalize "${MYPN}" "${PV}")"
S=${WORKDIR}/${MYP}


LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
IUSE="doc python"

RDEPEND="
>=dev-python/numpy-1.5.1[${PYTHON_USEDEP}]
dev-python/setuptools[${PYTHON_USEDEP}]
"

DEPEND="${RDEPEND}
doc? ( dev-util/gtk-doc )
"

REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"

S="${WORKDIR}/${MYP}"

python_compile() {
distutils-r1_python_compile
}

python_compile_all() {
use doc && setup.py build
}

python_test() {
setup.py test
}

python_install_all() {
distutils-r1_python_install_all
}
9 changes: 6 additions & 3 deletions dev-python/hyperspy/hyperspy-1.7.3.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ KEYWORDS="~amd64 ~x86"
IUSE="python doc +learning +gui-jupyter speed +gui-traitsui mrcz test"

RDEPEND="
=dev-python/pillow-9.5.0[${PYTHON_USEDEP}]
>=dev-python/numpy-1.17.1[${PYTHON_USEDEP}]
>=dev-python/scipy-1.1[${PYTHON_USEDEP}]
dev-python/natsort[${PYTHON_USEDEP}]
Expand All @@ -38,7 +39,7 @@ RDEPEND="
dev-python/statsmodels[${PYTHON_USEDEP}]
dev-python/numexpr[${PYTHON_USEDEP}]
dev-python/sparse[${PYTHON_USEDEP}]
dev-python/imageio[${PYTHON_USEDEP}]
=dev-python/imageio-2.27.0[${PYTHON_USEDEP}]
dev-python/pyyaml[${PYTHON_USEDEP}]
dev-python/zarr[${PYTHON_USEDEP}]
dev-python/prettytable[${PYTHON_USEDEP}]
Expand All @@ -47,6 +48,8 @@ RDEPEND="
doc? ( >=app-misc/sphinx-1.7 dev-python/sphinx_rtd_theme )
learning? ( dev-python/scikit-learn[${PYTHON_USEDEP}] )
speed? ( dev-python/numba[${PYTHON_USEDEP}] dev-python/cython[${PYTHON_USEDEP}] )
!dev-python/rosettasciio[${PYTHON_USEDEP}]
!dev-python/exspy[${PYTHON_USEDEP}]
"
##
##mrcz? ( >=dev-python/blosc-1.5 >=dev-python/mrcz-0.3.6 )
Expand All @@ -63,8 +66,8 @@ DEPEND="${RDEPEND}
"

PDEPEND="
gui-jupyter? ( >=dev-python/hyperspy-gui-ipywidgets-1.1.0 )
gui-traitsui? ( >=dev-python/hyperspy-gui-traitsui-1.1.0 )
gui-jupyter? ( <=dev-python/hyperspy-gui-ipywidgets-2.0.0 )
gui-traitsui? ( <=dev-python/hyperspy-gui-traitsui-2.0.0 )
"

REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
Expand Down
1 change: 1 addition & 0 deletions dev-python/zarr/Manifest
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
1 change: 1 addition & 0 deletions dev-python/zarr/zarr-2.13.3.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ IUSE="doc python"
RDEPEND="
dev-python/numpy[${PYTHON_USEDEP}]
dev-python/numcodecs[${PYTHON_USEDEP}]
dev-python/asciitree[${PYTHON_USEDEP}]
"
#asciitree==0.3.3
#fasteners==0.18
Expand Down
5 changes: 3 additions & 2 deletions dev-python/zarr/zarr-2.16.1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ IUSE="doc python"
RDEPEND="
dev-python/numpy[${PYTHON_USEDEP}]
dev-python/numcodecs[${PYTHON_USEDEP}]
dev-python/asciitree[${PYTHON_USEDEP}]
dev-python/fasteners[${PYTHON_USEDEP}]
"
#asciitree==0.3.3
#fasteners==0.18

#numcodecs==0.10.2
#msgpack-python==0.5.6
#setuptools-scm==7.0.5
Expand Down
Loading

0 comments on commit e32c54b

Please sign in to comment.