diff options
| author | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2026-04-17 19:13:38 +0000 |
|---|---|---|
| committer | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2026-04-17 19:13:38 +0000 |
| commit | c8dcb274f379713bdd93a32b91c9c3e5310ea5c8 (patch) | |
| tree | 8d6725af04672951d3f39c188441a4127f4c4d3f /dev-python | |
| parent | ca125481edd74de829bb375eebaa362b99ad85ca (diff) | |
| download | baldeagleos-repo-c8dcb274f379713bdd93a32b91c9c3e5310ea5c8.tar.gz baldeagleos-repo-c8dcb274f379713bdd93a32b91c9c3e5310ea5c8.tar.xz baldeagleos-repo-c8dcb274f379713bdd93a32b91c9c3e5310ea5c8.zip | |
Adding metadata
Diffstat (limited to 'dev-python')
| -rw-r--r-- | dev-python/array-api-compat/array-api-compat-1.14.0.ebuild | 2 | ||||
| -rw-r--r-- | dev-python/gfloat/files/gfloat-0.5.2-32bit.patch | 97 | ||||
| -rw-r--r-- | dev-python/gfloat/gfloat-0.5.2-r1.ebuild | 77 | ||||
| -rw-r--r-- | dev-python/httpretty/files/httpretty-1.1.4-py314.patch | 41 | ||||
| -rw-r--r-- | dev-python/httpretty/httpretty-1.1.4-r4.ebuild | 89 |
5 files changed, 305 insertions, 1 deletions
diff --git a/dev-python/array-api-compat/array-api-compat-1.14.0.ebuild b/dev-python/array-api-compat/array-api-compat-1.14.0.ebuild index f5d8c5a0d149..cf116d4d1f31 100644 --- a/dev-python/array-api-compat/array-api-compat-1.14.0.ebuild +++ b/dev-python/array-api-compat/array-api-compat-1.14.0.ebuild @@ -17,7 +17,7 @@ HOMEPAGE=" LICENSE="MIT" SLOT="0" -KEYWORDS="amd64 arm64" +KEYWORDS="amd64 ~arm arm64 ~x86" BDEPEND=" dev-python/setuptools-scm[${PYTHON_USEDEP}] diff --git a/dev-python/gfloat/files/gfloat-0.5.2-32bit.patch b/dev-python/gfloat/files/gfloat-0.5.2-32bit.patch new file mode 100644 index 000000000000..8394329b4fa3 --- /dev/null +++ b/dev-python/gfloat/files/gfloat-0.5.2-32bit.patch @@ -0,0 +1,97 @@ +From 0d48e9df6870bfa9ffeceef86d26fdae70535e5a Mon Sep 17 00:00:00 2001 +From: Andrew Fitzgibbon <awf@fitzgibbon.ie> +Date: Fri, 17 Apr 2026 11:40:37 +0100 +Subject: [PATCH 3/3] 32-bit fixes + +--- + src/gfloat/decode_ndarray.py | 6 ++++-- + src/gfloat/encode_ndarray.py | 11 ++++++----- + test/test_array_api.py | 2 +- + test/test_round.py | 4 ++-- + 4 files changed, 13 insertions(+), 10 deletions(-) + +diff --git a/src/gfloat/decode_ndarray.py b/src/gfloat/decode_ndarray.py +index 7d93c13..0e79b77 100644 +--- a/src/gfloat/decode_ndarray.py ++++ b/src/gfloat/decode_ndarray.py +@@ -78,10 +78,12 @@ def decode_ndarray( + + issubnormal = (exp == 0) & (significand != 0) & fi.has_subnormals + expval = np.where(issubnormal, 1 - bias, exp - bias) +- fsignificand = np.where(issubnormal, 0.0, 1.0) + np.ldexp(significand, -t) ++ fsignificand = np.where(issubnormal, 0.0, 1.0) + np.ldexp( ++ significand.astype(np.float64), np.int32(-t) ++ ) + + # Normal/Subnormal/Zero case, other values will be overwritten +- expval_safe = np.where(isspecial | iszero, 0, expval) ++ expval_safe = np.where(isspecial | iszero, 0, expval).astype(np.int32) + fval_finite_safe = sign * np.ldexp(fsignificand, expval_safe) + fval = np.where(~(iszero | isspecial), fval_finite_safe, fval) + +diff --git a/src/gfloat/encode_ndarray.py b/src/gfloat/encode_ndarray.py +index 183865d..af883e4 100644 +--- a/src/gfloat/encode_ndarray.py ++++ b/src/gfloat/encode_ndarray.py +@@ -66,11 +66,11 @@ def encode_ndarray(fi: FormatInfo, v: npt.NDArray) -> npt.NDArray: + biased_exp = exp.astype(np.int64) + (fi.bias - 1) + subnormal_mask = (biased_exp < 1) & fi.has_subnormals + +- biased_exp_safe = np.where(subnormal_mask, biased_exp, 0) ++ biased_exp_safe = np.where(subnormal_mask, biased_exp, 0).astype(np.int32) + tsig = np.where(subnormal_mask, np.ldexp(sig, biased_exp_safe), sig * 2 - 1.0) + biased_exp[subnormal_mask] = 0 + +- isig = np.floor(np.ldexp(tsig, t)).astype(np.int64) ++ isig = np.floor(np.ldexp(tsig, np.int32(t))).astype(np.int64) + + zero_mask = fi.has_zero & (isig == 0) & (biased_exp == 0) + if not fi.has_nz: +@@ -80,8 +80,9 @@ def encode_ndarray(fi: FormatInfo, v: npt.NDArray) -> npt.NDArray: + if fi.is_twos_complement: + isig[finite_sign] = (1 << t) - isig[finite_sign] + +- code[finite_mask] = ( +- (finite_sign.astype(int) << (k - 1)) | (biased_exp << t) | (isig << 0) +- ) ++ sign_field = np.left_shift(finite_sign.astype(np.uint64), np.uint64(k - 1)) ++ exp_field = np.left_shift(biased_exp.astype(np.uint64), np.uint64(t)) ++ sig_field = isig.astype(np.uint64) ++ code[finite_mask] = sign_field | exp_field | sig_field + + return code +diff --git a/test/test_array_api.py b/test/test_array_api.py +index 832c2d7..7de8f70 100644 +--- a/test/test_array_api.py ++++ b/test/test_array_api.py +@@ -25,7 +25,7 @@ def test_array_api(fi: FormatInfo, rnd: RoundMode, sat: bool) -> None: + a = xp.asarray(a0) + + srnumbits = 32 +- srbits0 = np.random.randint(0, 2**srnumbits, a.shape) ++ srbits0 = np.random.randint(0, 2**srnumbits, a.shape, dtype=np.int64) + srbits = xp.asarray(srbits0) + + round_ndarray(fi, a, rnd, sat, srbits=srbits, srnumbits=srnumbits) # type: ignore +diff --git a/test/test_round.py b/test/test_round.py +index 27c798e..dbde64e 100644 +--- a/test/test_round.py ++++ b/test/test_round.py +@@ -537,7 +537,7 @@ def test_stochastic_rounding( + n = 10_000 + expected_up_count = expected_up * n + +- srbits = np.random.randint(0, 2**srnumbits, size=(n,)) ++ srbits = np.random.randint(0, 2**srnumbits, size=(n,), dtype=np.int64) + if impl == "scalar": + count_v1 = 0 + for k in range(n): +@@ -591,7 +591,7 @@ def test_stochastic_rounding_scalar_eq_array( + for alpha in (0, 0.3, 0.5, 0.6, 0.7, 0.9, 1.25): + v = _linterp(v0, v1, alpha) + assert np.isfinite(v).all() +- srbits = np.random.randint(0, 2**srnumbits, v.shape) ++ srbits = np.random.randint(0, 2**srnumbits, v.shape, dtype=np.int64) + + val_array = round_ndarray( + fi, diff --git a/dev-python/gfloat/gfloat-0.5.2-r1.ebuild b/dev-python/gfloat/gfloat-0.5.2-r1.ebuild new file mode 100644 index 000000000000..eb1739a0b36c --- /dev/null +++ b/dev-python/gfloat/gfloat-0.5.2-r1.ebuild @@ -0,0 +1,77 @@ +# Copyright 2024-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..14} ) + +inherit distutils-r1 pypi + +DESCRIPTION="Generic floating-point types in Python" +HOMEPAGE=" + https://github.com/graphcore-research/gfloat/ + https://pypi.org/project/gfloat/ +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~x86" +IUSE="test-rust" + +RDEPEND=" + dev-python/array-api-compat[${PYTHON_USEDEP}] + dev-python/more-itertools[${PYTHON_USEDEP}] + dev-python/numpy[${PYTHON_USEDEP}] +" +BDEPEND=" + test? ( + dev-python/matplotlib[${PYTHON_USEDEP}] + dev-python/ml-dtypes[${PYTHON_USEDEP}] + dev-python/tabulate[${PYTHON_USEDEP}] + test-rust? ( + dev-python/nbval[${PYTHON_USEDEP}] + ) + !arm? ( + dev-python/jinja2[${PYTHON_USEDEP}] + dev-python/pandas[${PYTHON_USEDEP}] + ) + ) +" + +EPYTEST_PLUGINS=() +distutils_enable_tests pytest + +PATCHES=( + # https://github.com/graphcore-research/gfloat/pull/60 + "${FILESDIR}/${P}-32bit.patch" +) + +python_test() { + local EPYTEST_IGNORE=( + # requires array-api-strict (probably not very valuable downstream) + test/test_array_api.py + # require jax + docs/source/03-value-tables.ipynb + docs/source/04-benchmark.ipynb + test/test_jax.py + # requires mx (possibly git version), torch + test/test_microxcaling.py + # requires torch + test/test_torch.py + ) + + if ! has_version "dev-python/jinja2[${PYTHON_USEDEP}]" || + ! has_version "dev-python/pandas[${PYTHON_USEDEP}]" + then + EPYTEST_IGNORE+=( + docs/source + ) + fi + + if has_version "dev-python/nbval[${PYTHON_USEDEP}]"; then + epytest -p nbval + else + epytest -o addopts= + fi +} diff --git a/dev-python/httpretty/files/httpretty-1.1.4-py314.patch b/dev-python/httpretty/files/httpretty-1.1.4-py314.patch new file mode 100644 index 000000000000..43513c0bd044 --- /dev/null +++ b/dev-python/httpretty/files/httpretty-1.1.4-py314.patch @@ -0,0 +1,41 @@ +From 8d10219036ab18462c0a8e35a5aae80e0d284c57 Mon Sep 17 00:00:00 2001 +From: Steve Kowalik <steven@wedontsleep.org> +Date: Fri, 10 Apr 2026 11:36:31 +1000 +Subject: [PATCH] Support Python 3.14 partial() changes + +functools.partial() was changed in Python 3.14 to be a method +descriptor, which means we need to wrap it in staticmethod now. This +change does appear to be backward compatible, so I haven't guarded it +with a version check. +--- + httpretty/core.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/httpretty/core.py b/httpretty/core.py +index 69686458..2cea6a89 100644 +--- a/httpretty/core.py ++++ b/httpretty/core.py +@@ -1852,7 +1852,7 @@ def apply_patch_socket(): + extract_into_urllib3() + + if requests_urllib3_connection is not None: +- urllib3_wrap = partial(fake_wrap_socket, old_requests_ssl_wrap_socket) ++ urllib3_wrap = staticmethod(partial(fake_wrap_socket, old_requests_ssl_wrap_socket)) + requests_urllib3_connection.ssl_wrap_socket = urllib3_wrap + requests_urllib3_connection.__dict__['ssl_wrap_socket'] = urllib3_wrap + +@@ -1867,12 +1867,12 @@ def apply_patch_socket(): + socks.__dict__['socksocket'] = fakesock.socket + + if ssl: +- new_wrap = partial(fake_wrap_socket, old_ssl_wrap_socket) ++ new_wrap = staticmethod(partial(fake_wrap_socket, old_ssl_wrap_socket)) + ssl.wrap_socket = new_wrap + ssl.SSLSocket = FakeSSLSocket + ssl.SSLContext = old_sslcontext_class + try: +- ssl.SSLContext.wrap_socket = partial(fake_wrap_socket, old_ssl_wrap_socket) ++ ssl.SSLContext.wrap_socket = staticmethod(partial(fake_wrap_socket, old_ssl_wrap_socket)) + except AttributeError: + pass + diff --git a/dev-python/httpretty/httpretty-1.1.4-r4.ebuild b/dev-python/httpretty/httpretty-1.1.4-r4.ebuild new file mode 100644 index 000000000000..db9aef003b62 --- /dev/null +++ b/dev-python/httpretty/httpretty-1.1.4-r4.ebuild @@ -0,0 +1,89 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..14} ) + +inherit distutils-r1 pypi + +DESCRIPTION="HTTP client mock for Python" +HOMEPAGE=" + https://github.com/gabrielfalcao/httpretty/ + https://pypi.org/project/httpretty/ +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86" +IUSE="test-rust" + +RDEPEND=" + dev-python/urllib3[${PYTHON_USEDEP}] +" +BDEPEND=" + test? ( + dev-python/freezegun[${PYTHON_USEDEP}] + >=dev-python/requests-1.1[${PYTHON_USEDEP}] + dev-python/sure[${PYTHON_USEDEP}] + >=dev-python/tornado-2.2[${PYTHON_USEDEP}] + ) +" +# These are optional test deps, that are used to test compatibility +# with various HTTP libs. We prefer pulling them in whenever possible +# to increase test coverage but we can live without them. +# We're skipping redis entirely since it requires a running server. +BDEPEND+=" + test? ( + test-rust? ( + dev-python/pyopenssl[${PYTHON_USEDEP}] + ) + >=dev-python/boto3-1.17.72[${PYTHON_USEDEP}] + dev-python/httplib2[${PYTHON_USEDEP}] + >=dev-python/httpx-0.18.1[${PYTHON_USEDEP}] + ) +" + +EPYTEST_PLUGINS=( pytest-httpx ) +distutils_enable_tests pytest + +PATCHES=( + "${FILESDIR}/${P}-pytest.patch" + # https://github.com/gabrielfalcao/HTTPretty/pull/485 + "${FILESDIR}/${P}-urllib3-2.3.patch" + # https://github.com/gabrielfalcao/HTTPretty/pull/488 + "${FILESDIR}/${P}-py314.patch" +) + +python_test() { + local EPYTEST_IGNORE=( + # this seems to be a stress test + tests/bugfixes/pytest/test_426_mypy_segfault.py + # passthrough tests require Internet access + tests/functional/test_passthrough.py + # eventlet is masked for removal + tests/bugfixes/nosetests/test_eventlet.py + ) + local EPYTEST_DESELECT=( + # regressions with newer dev-python/requests + tests/functional/test_requests.py::test_httpretty_should_allow_registering_regexes_with_streaming_responses + tests/functional/test_requests.py::test_httpretty_should_handle_paths_starting_with_two_slashes + ) + + local ignore_by_dep=( + dev-python/boto3:tests/bugfixes/nosetests/test_416_boto3.py + dev-python/httplib2:tests/functional/test_httplib2.py + dev-python/httpx:tests/bugfixes/nosetests/test_414_httpx.py + dev-python/pyopenssl:tests/bugfixes/nosetests/test_417_openssl.py + ) + + local x + for x in "${ignore_by_dep[@]}"; do + if ! has_version "${x%:*}[${PYTHON_USEDEP}]"; then + EPYTEST_IGNORE+=( "${x#*:}" ) + fi + done + + epytest +} |
