diff options
Diffstat (limited to 'dev-python')
-rw-r--r-- | dev-python/argh/argh-0.31.2.ebuild | 8 | ||||
-rw-r--r-- | dev-python/argh/files/argh-0.31.2-py313.patch | 164 | ||||
-rw-r--r-- | dev-python/cattrs/cattrs-23.2.4_pre20240627.ebuild (renamed from dev-python/cattrs/cattrs-23.2.3_p20240627.ebuild) | 2 | ||||
-rw-r--r-- | dev-python/cattrs/files/cattrs-23.2.4_pre20240627-py313.patch (renamed from dev-python/cattrs/files/cattrs-23.2.3_p20240627-py313.patch) | 0 | ||||
-rw-r--r-- | dev-python/executing/Manifest | 1 | ||||
-rw-r--r-- | dev-python/executing/executing-2.0.2_pre20240626.ebuild | 65 |
6 files changed, 237 insertions, 3 deletions
diff --git a/dev-python/argh/argh-0.31.2.ebuild b/dev-python/argh/argh-0.31.2.ebuild index fb61d011ee2d..0c53e95bef20 100644 --- a/dev-python/argh/argh-0.31.2.ebuild +++ b/dev-python/argh/argh-0.31.2.ebuild @@ -4,8 +4,7 @@ EAPI=8 DISTUTILS_USE_PEP517=flit -# py3.13: https://github.com/neithere/argh/issues/228 -PYTHON_COMPAT=( python3_{10..12} pypy3 ) +PYTHON_COMPAT=( python3_{10..13} pypy3 ) inherit distutils-r1 pypi @@ -27,3 +26,8 @@ BDEPEND=" " distutils_enable_tests pytest + +PATCHES=( + # https://github.com/neithere/argh/commit/cdb70d5ac7d8a5a5dff3c55100e5f67b68b26826 + "${FILESDIR}/${P}-py313.patch" +) diff --git a/dev-python/argh/files/argh-0.31.2-py313.patch b/dev-python/argh/files/argh-0.31.2-py313.patch new file mode 100644 index 000000000000..4049fedc0d0d --- /dev/null +++ b/dev-python/argh/files/argh-0.31.2-py313.patch @@ -0,0 +1,164 @@ +From cdb70d5ac7d8a5a5dff3c55100e5f67b68b26826 Mon Sep 17 00:00:00 2001 +From: Andy Mikhaylenko <neithere@gmail.com> +Date: Sun, 16 Jun 2024 22:38:21 +0200 +Subject: [PATCH] fix: tests under Python 3.13 (fixes #228) + +diff --git a/tests/test_integration.py b/tests/test_integration.py +index f863386..258a148 100644 +--- a/tests/test_integration.py ++++ b/tests/test_integration.py +@@ -724,18 +724,34 @@ def remind( + help_normalised = re.sub(r"\s+", " ", parser.format_help()) + + assert "name 'Basil'" in help_normalised +- assert "-t TASK, --task TASK 'hang the Moose'" in help_normalised +- assert ( +- "-r REASON, --reason REASON 'there are creatures living in it'" +- in help_normalised +- ) + +- # explicit help message is not obscured by the implicit one +- # but is still present +- assert ( +- "-n NOTE, --note NOTE why is it a remarkable animal? " +- "(default: 'it can speak English')" +- ) in help_normalised ++ # argh#228 — argparse in Python before 3.13 duplicated the placeholder in help ++ if sys.version_info < (3, 13): ++ assert "-t TASK, --task TASK 'hang the Moose'" in help_normalised ++ assert ( ++ "-r REASON, --reason REASON 'there are creatures living in it'" ++ in help_normalised ++ ) ++ ++ # explicit help message is not obscured by the implicit one ++ # but is still present ++ assert ( ++ "-n NOTE, --note NOTE why is it a remarkable animal? " ++ "(default: 'it can speak English')" ++ ) in help_normalised ++ else: ++ assert "-t, --task TASK 'hang the Moose'" in help_normalised ++ assert ( ++ "-r, --reason REASON 'there are creatures living in it'" ++ in help_normalised ++ ) ++ ++ # explicit help message is not obscured by the implicit one ++ # but is still present ++ assert ( ++ "-n, --note NOTE why is it a remarkable animal? " ++ "(default: 'it can speak English')" ++ ) in help_normalised + + + def test_default_arg_values_in_help__regression(): +@@ -750,9 +766,16 @@ def foo(*, bar=""): + # doesn't break + parser.format_help() + ++ # argh#228 — argparse in Python before 3.13 duplicated the placeholder in help ++ if sys.version_info < (3, 13): ++ expected_line = "-b BAR, --bar BAR ''" ++ # note the empty str repr ^^^ ++ else: ++ expected_line = "-b, --bar BAR ''" ++ # note the empty str repr ^^^ ++ + # now check details +- assert "-b BAR, --bar BAR ''" in parser.format_help() +- # note the empty str repr ^^^ ++ assert expected_line in parser.format_help() + + + def test_help_formatting_is_preserved(): +@@ -868,6 +891,19 @@ def second_func(): + + run(parser, "first-func --help", exit=True) + captured = capsys.readouterr() ++ ++ # argh#228 — argparse in Python before 3.13 duplicated the placeholder in help ++ if sys.version_info < (3, 13): ++ arg_help_lines = ( ++ " -h, --help show this help message and exit\n" ++ " -f FOO, --foo FOO 123" ++ ) ++ else: ++ arg_help_lines = ( ++ " -h, --help show this help message and exit\n" ++ " -f, --foo FOO 123" ++ ) ++ + assert ( + captured.out + == unindent( +@@ -877,8 +913,7 @@ def second_func(): + Owl stretching time + + {HELP_OPTIONS_LABEL}: +- -h, --help show this help message and exit +- -f FOO, --foo FOO 123 ++ {arg_help_lines} + """ + )[1:] + ) +@@ -997,6 +1032,19 @@ def second_func(): + + run(parser, "my-group first-func --help", exit=True) + captured = capsys.readouterr() ++ ++ # argh#228 — argparse in Python before 3.13 duplicated the placeholder in help ++ if sys.version_info < (3, 13): ++ arg_help_lines = ( ++ " -h, --help show this help message and exit\n" ++ " -f FOO, --foo FOO 123" ++ ) ++ else: ++ arg_help_lines = ( ++ " -h, --help show this help message and exit\n" ++ " -f, --foo FOO 123" ++ ) ++ + assert ( + captured.out + == unindent( +@@ -1006,8 +1054,7 @@ def second_func(): + Owl stretching time + + {HELP_OPTIONS_LABEL}: +- -h, --help show this help message and exit +- -f FOO, --foo FOO 123 ++ {arg_help_lines} + """ + )[1:] + ) +@@ -1079,6 +1126,19 @@ def second_func(): + + run(parser, "first-func --help", exit=True) + captured = capsys.readouterr() ++ ++ # argh#228 — argparse in Python before 3.13 duplicated the placeholder in help ++ if sys.version_info < (3, 13): ++ arg_help_lines = ( ++ " -h, --help show this help message and exit\n" ++ " -f FOO, --foo FOO 123" ++ ) ++ else: ++ arg_help_lines = ( ++ " -h, --help show this help message and exit\n" ++ " -f, --foo FOO 123" ++ ) ++ + assert ( + captured.out + == unindent( +@@ -1088,8 +1148,7 @@ def second_func(): + func description override + + {HELP_OPTIONS_LABEL}: +- -h, --help show this help message and exit +- -f FOO, --foo FOO 123 ++ {arg_help_lines} + """ + )[1:] + ) diff --git a/dev-python/cattrs/cattrs-23.2.3_p20240627.ebuild b/dev-python/cattrs/cattrs-23.2.4_pre20240627.ebuild index e2d1c45b9ba8..92b15ea9501b 100644 --- a/dev-python/cattrs/cattrs-23.2.3_p20240627.ebuild +++ b/dev-python/cattrs/cattrs-23.2.4_pre20240627.ebuild @@ -61,7 +61,7 @@ PATCHES=( "${FILESDIR}/${P}-py313.patch" ) -export SETUPTOOLS_SCM_PRETEND_VERSION=${PV/_p/+} +export SETUPTOOLS_SCM_PRETEND_VERSION=${PV/_pre/.dev} python_test() { local EPYTEST_IGNORE=( diff --git a/dev-python/cattrs/files/cattrs-23.2.3_p20240627-py313.patch b/dev-python/cattrs/files/cattrs-23.2.4_pre20240627-py313.patch index 1ea85a653a32..1ea85a653a32 100644 --- a/dev-python/cattrs/files/cattrs-23.2.3_p20240627-py313.patch +++ b/dev-python/cattrs/files/cattrs-23.2.4_pre20240627-py313.patch diff --git a/dev-python/executing/Manifest b/dev-python/executing/Manifest index d2ce7ff6f380..8ba7530c201b 100644 --- a/dev-python/executing/Manifest +++ b/dev-python/executing/Manifest @@ -1 +1,2 @@ DIST executing-2.0.1.gh.tar.gz 837355 BLAKE2B 7d38890eb322809c2b705f51731fe7537f81a0775d99bebb4b4ae67453930daedd947b249385babbc2373969344b643f288441fc28f3588264e4ebc23e1c389d SHA512 8a753aab42ea2d3b61764ee77de3bb52ea7fcc2818298281180ffc47c7b22ee84974ee98b2137250f722ad559be92e72e8fc01d7b2d38ab6a01512618b65d4f3 +DIST executing-b3821ddf99132b61d8d32adfdae450e2418610ca.gh.tar.gz 983168 BLAKE2B 6f305aff1ff027efc5dc18288a1373623dc8e87f0a66f35ad6c92954fa1e6fc2422d50aaec128216efd1e090f1f69428447700b0adc8d4b61f40a777b3768c29 SHA512 049f95e363660052538b9d4c07123705663680d1c415ee43895678e4b740b3b2697c62c78e150fd14f75836727512e138c312ece7a48b2d3d11393f522b2ce60 diff --git a/dev-python/executing/executing-2.0.2_pre20240626.ebuild b/dev-python/executing/executing-2.0.2_pre20240626.ebuild new file mode 100644 index 000000000000..2773da51d616 --- /dev/null +++ b/dev-python/executing/executing-2.0.2_pre20240626.ebuild @@ -0,0 +1,65 @@ +# Copyright 2020-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( pypy3 python3_{10..13} ) + +inherit distutils-r1 optfeature + +# https://github.com/alexmojaki/executing/commits/3.13 +EGIT_COMMIT="b3821ddf99132b61d8d32adfdae450e2418610ca" +MY_P="${PN}-${EGIT_COMMIT}" + +DESCRIPTION="Get information about what a Python frame is currently doing" +HOMEPAGE=" + https://github.com/alexmojaki/executing/ + https://pypi.org/project/executing/ +" +SRC_URI=" + https://github.com/alexmojaki/executing/archive/${EGIT_COMMIT}.tar.gz + -> ${MY_P}.gh.tar.gz +" +S=${WORKDIR}/${MY_P} + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos" + +BDEPEND=" + dev-python/setuptools-scm[${PYTHON_USEDEP}] + test? ( + >=dev-python/asttokens-2.1.0[${PYTHON_USEDEP}] + dev-python/littleutils[${PYTHON_USEDEP}] + dev-python/rich[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests pytest + +export SETUPTOOLS_SCM_PRETEND_VERSION=${PV/_pre/.dev} + +python_test() { + local EPYTEST_DESELECT=() + case ${EPYTHON} in + pypy3) + EPYTEST_DESELECT+=( + "tests/test_main.py::test_small_samples[22bc344a43584c051d8962116e8fd149d72e7e68bcb54caf201ee6e78986b167.py]" + "tests/test_main.py::test_small_samples[46597f8f896f11c5d7f432236344cc7e5645c2a39836eb6abdd2437c0422f0f4.py]" + ) + ;; + esac + if ! has_version "dev-python/ipython[${PYTHON_USEDEP}]"; then + EPYTEST_DESELECT+=( + tests/test_ipython.py + ) + fi + + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + epytest +} + +pkg_postinst() { + optfeature "getting node's source code" dev-python/asttokens +} |