summaryrefslogtreecommitdiff
path: root/dev-python/makefun
diff options
context:
space:
mode:
authorLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2024-06-28 19:27:32 +0000
committerLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2024-06-28 19:27:32 +0000
commit8ef377af5ef816aa545180f193fbbc7fd58d27a8 (patch)
treec8e987270cc981bddd5cd6e1ca6c1ca67e235c1b /dev-python/makefun
parent09b1e5b5d33e3720e9269c30b93490da01da4cd2 (diff)
downloadbaldeagleos-repo-8ef377af5ef816aa545180f193fbbc7fd58d27a8.tar.gz
baldeagleos-repo-8ef377af5ef816aa545180f193fbbc7fd58d27a8.tar.xz
baldeagleos-repo-8ef377af5ef816aa545180f193fbbc7fd58d27a8.zip
Adding metadata
Diffstat (limited to 'dev-python/makefun')
-rw-r--r--dev-python/makefun/files/makefun-1.15.2-test.patch98
-rw-r--r--dev-python/makefun/makefun-1.15.2.ebuild11
-rw-r--r--dev-python/makefun/metadata.xml6
3 files changed, 110 insertions, 5 deletions
diff --git a/dev-python/makefun/files/makefun-1.15.2-test.patch b/dev-python/makefun/files/makefun-1.15.2-test.patch
new file mode 100644
index 000000000000..ab43045809d9
--- /dev/null
+++ b/dev-python/makefun/files/makefun-1.15.2-test.patch
@@ -0,0 +1,98 @@
+diff --git a/tests/test_partial_and_macros.py b/tests/test_partial_and_macros.py
+index 6fd4503..3ce0a33 100644
+--- a/tests/test_partial_and_macros.py
++++ b/tests/test_partial_and_macros.py
+@@ -1,5 +1,6 @@
+ import functools
+ import pytest
++import re
+ import sys
+
+ import makefun
+@@ -11,6 +12,11 @@ except ImportError:
+
+ PY2 = sys.version_info < (3, )
+
++# Python 3.13 dedents docstrings, earlier versions just strip initial
++# whitespace. Use a regexp to get a consistently dedented docstring
++# for comparison across Python versions.
++DOCSTRING_NORMALIZE_RE = re.compile(r"^ +", re.MULTILINE)
++
+
+ def test_doc():
+ def foo(x, y):
+@@ -41,15 +47,15 @@ def test_doc():
+
+ sig_actual_call = ref_sig_str.replace("*, ", "")
+
+- assert bar.__doc__ \
++ assert DOCSTRING_NORMALIZE_RE.sub("", bar.__doc__) \
+ == """<This function is equivalent to 'foo%s', see original 'foo' doc below.>
+
+- a `foo` function
++a `foo` function
+
+- :param x:
+- :param y:
+- :return:
+- """ % sig_actual_call
++:param x:
++:param y:
++:return:
++""" % sig_actual_call
+
+
+ def test_partial():
+@@ -78,16 +84,16 @@ def test_partial():
+
+ sig_actual_call = "(x, y='hello', a)" # if PY2 else "(x, *, y='hello', a)"
+
+- assert foo.__doc__.replace("=KW_ONLY_ARG!", "") \
++ assert DOCSTRING_NORMALIZE_RE.sub("", foo.__doc__.replace("=KW_ONLY_ARG!", "")) \
+ == """<This function is equivalent to 'foo%s', see original 'foo' doc below.>
+
+- a `foo` function
++a `foo` function
+
+- :param x:
+- :param y:
+- :param a:
+- :return:
+- """ % sig_actual_call
++:param x:
++:param y:
++:param a:
++:return:
++""" % sig_actual_call
+
+
+ def test_issue_57():
+@@ -127,9 +133,7 @@ def test_create_with_partial():
+ assert m() == -1
+ assert m.i == 1
+ # the doc remains untouched in create_function as opposed to wraps, this is normal
+- assert m.__doc__ == """partial(func, *args, **keywords) - new function with partial application
+- of the given arguments and keywords.
+-"""
++ assert m.__doc__ == functools.partial.__doc__
+
+
+ def test_args_order_and_kind():
+@@ -161,11 +165,12 @@ def test_args_order_and_kind():
+ # it is possible to keyword-partialize a positional-only argument...
+ fp_ref = functools.partial(f, b=0)
+
+- # but 'signature' does not support it !
+- with pytest.raises(ValueError):
+- signature(fp_ref)
+-
+- # assert str(signature(fp_ref)) == "(c, /, *, d, **e)"
++ # but 'signature' does not support it before Python 3.12.4 !
++ if sys.version_info < (3, 12, 4):
++ with pytest.raises(ValueError):
++ signature(fp_ref)
++ else:
++ assert str(signature(fp_ref)) == "(a, c, /, *, d, **e)"
+
+ # so we do not support it
+ with pytest.raises(NotImplementedError):
diff --git a/dev-python/makefun/makefun-1.15.2.ebuild b/dev-python/makefun/makefun-1.15.2.ebuild
index 483bc3af964d..bcf12ff168bc 100644
--- a/dev-python/makefun/makefun-1.15.2.ebuild
+++ b/dev-python/makefun/makefun-1.15.2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -25,6 +25,13 @@ BDEPEND="
distutils_enable_tests pytest
src_prepare() {
- sed -e '/pytest-runner/d' -i setup.cfg || die
+ local PATCHES=(
+ # https://github.com/smarie/python-makefun/pull/103
+ # https://github.com/smarie/python-makefun/pull/104
+ "${FILESDIR}/${P}-test.patch"
+ )
+
distutils-r1_src_prepare
+
+ sed -e '/pytest-runner/d' -i setup.cfg || die
}
diff --git a/dev-python/makefun/metadata.xml b/dev-python/makefun/metadata.xml
index 615915853c8d..ea8988e8af6a 100644
--- a/dev-python/makefun/metadata.xml
+++ b/dev-python/makefun/metadata.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://liguros.gitlab.io/dtd/metadata.dtd">
<pkgmetadata>
- <maintainer type="person">
- <email>marecki@gentoo.org</email>
- <name>Marek Szuba</name>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
</maintainer>
<origin>gentoo-staging</origin>