public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/makefun/files/, dev-python/makefun/
@ 2022-02-21 11:34 Marek Szuba
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Szuba @ 2022-02-21 11:34 UTC (permalink / raw
  To: gentoo-commits

commit:     0f1e3b4c9ed83ab13a54d398368470de451bb4a0
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 21 11:32:26 2022 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Mon Feb 21 11:32:26 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f1e3b4c

dev-python/makefun: initial import

Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 dev-python/makefun/Manifest                        |  1 +
 .../files/makefun-1.13.1-no_pytest-runner.patch    | 10 +++++++++
 dev-python/makefun/makefun-1.13.1.ebuild           | 25 ++++++++++++++++++++++
 dev-python/makefun/metadata.xml                    | 13 +++++++++++
 4 files changed, 49 insertions(+)

diff --git a/dev-python/makefun/Manifest b/dev-python/makefun/Manifest
new file mode 100644
index 000000000000..e64a9b497cde
--- /dev/null
+++ b/dev-python/makefun/Manifest
@@ -0,0 +1 @@
+DIST makefun-1.13.1.tar.gz 72170 BLAKE2B b1b5e76277e742ef51bcdf2bf6f1d1e761010d75bc3f20d7a8c079b368972b90775bd3bb23cf1787911a8d858549d72d4a2c9379675e59f359486bf1c49566e2 SHA512 ae103d3827673c4124d051e3c76d3d0d126c783ac7a1ea09de3801fd695439eaa549c297bd5c262184a3ee6fdf7b046065081fa3183642778148c2134d7bfc06

diff --git a/dev-python/makefun/files/makefun-1.13.1-no_pytest-runner.patch b/dev-python/makefun/files/makefun-1.13.1-no_pytest-runner.patch
new file mode 100644
index 000000000000..659717903361
--- /dev/null
+++ b/dev-python/makefun/files/makefun-1.13.1-no_pytest-runner.patch
@@ -0,0 +1,10 @@
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -27,7 +27,6 @@
+ [options]
+ setup_requires = 
+ 	setuptools_scm
+-	pytest-runner
+ install_requires = 
+ 	funcsigs;python_version<'3.3'
+ tests_require = 

diff --git a/dev-python/makefun/makefun-1.13.1.ebuild b/dev-python/makefun/makefun-1.13.1.ebuild
new file mode 100644
index 000000000000..3a44d2732c4a
--- /dev/null
+++ b/dev-python/makefun/makefun-1.13.1.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+DISTUTILS_USE_PEP517=setuptools
+
+inherit distutils-r1
+
+DESCRIPTION="Small library to dynamically create Python functions"
+HOMEPAGE="https://pypi.org/project/makefun/ https://github.com/smarie/python-makefun"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+
+BDEPEND="dev-python/setuptools_scm[${PYTHON_USEDEP}]"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.13.1-no_pytest-runner.patch
+)
+
+distutils_enable_tests pytest

diff --git a/dev-python/makefun/metadata.xml b/dev-python/makefun/metadata.xml
new file mode 100644
index 000000000000..0a2fbcffabe0
--- /dev/null
+++ b/dev-python/makefun/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>marecki@gentoo.org</email>
+		<name>Marek Szuba</name>
+	</maintainer>
+	<stabilize-allarches/>
+	<upstream>
+		<remote-id type="github">smarie/python-makefun</remote-id>
+		<remote-id type="pypi">makefun</remote-id>
+	</upstream>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/makefun/files/, dev-python/makefun/
@ 2024-06-28 17:33 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2024-06-28 17:33 UTC (permalink / raw
  To: gentoo-commits

commit:     9ef577a37dd20e634bd433e3fe1fa2e094357442
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 28 17:32:22 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jun 28 17:32:52 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9ef577a3

dev-python/makefun: Fix tests, enable py3.13

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/makefun/files/makefun-1.15.2-test.patch | 98 ++++++++++++++++++++++
 dev-python/makefun/makefun-1.15.2.ebuild           | 13 ++-
 2 files changed, 108 insertions(+), 3 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 e422b0555e2d..29cd2d63889b 100644
--- a/dev-python/makefun/makefun-1.15.2.ebuild
+++ b/dev-python/makefun/makefun-1.15.2.ebuild
@@ -1,10 +1,10 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
 DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_COMPAT=( python3_{10..13} )
 
 inherit distutils-r1 pypi
 
@@ -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
 }


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-28 17:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-21 11:34 [gentoo-commits] repo/gentoo:master commit in: dev-python/makefun/files/, dev-python/makefun/ Marek Szuba
  -- strict thread matches above, loose matches on Subject: below --
2024-06-28 17:33 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox