summaryrefslogtreecommitdiff
path: root/dev-python/forbiddenfruit
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
commitb590c8d7572b727d565cc0b8ff660d43569845de (patch)
tree06f7a4102ea4e845df8b66660f252920d52952f9 /dev-python/forbiddenfruit
parent24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff)
downloadbaldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip
Adding metadata
Diffstat (limited to 'dev-python/forbiddenfruit')
-rw-r--r--dev-python/forbiddenfruit/Manifest1
-rw-r--r--dev-python/forbiddenfruit/files/forbiddenfruit-0.1.4-pytest.patch59
-rw-r--r--dev-python/forbiddenfruit/forbiddenfruit-0.1.4.ebuild52
-rw-r--r--dev-python/forbiddenfruit/metadata.xml9
4 files changed, 121 insertions, 0 deletions
diff --git a/dev-python/forbiddenfruit/Manifest b/dev-python/forbiddenfruit/Manifest
new file mode 100644
index 000000000000..352aada6fd32
--- /dev/null
+++ b/dev-python/forbiddenfruit/Manifest
@@ -0,0 +1 @@
+DIST forbiddenfruit-0.1.4.tar.gz 43756 BLAKE2B 0fc5d2b313807ae6645f086844162408901e890bfb689f3f585ba452e5a788767c34da2574059a73a8d5d9c2e46c9811d4bc7f00eaf74bc60607229be7735d16 SHA512 88f8751a9ca1d475eb74114787a7aeda02973e9bc2c4bbb08de8a4d6fe05c6fb82db093aace8f718caaaeb8b06c89112e5f418b8ee4d903cc6183ddfa2cdb087
diff --git a/dev-python/forbiddenfruit/files/forbiddenfruit-0.1.4-pytest.patch b/dev-python/forbiddenfruit/files/forbiddenfruit-0.1.4-pytest.patch
new file mode 100644
index 000000000000..9d899da70491
--- /dev/null
+++ b/dev-python/forbiddenfruit/files/forbiddenfruit-0.1.4-pytest.patch
@@ -0,0 +1,59 @@
+From 2022b268f2a537eca27bac10ba74fef35e482d1d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 21 May 2025 18:50:41 +0200
+Subject: [PATCH] Port to pytest
+
+Port the test suite to pytest, given that nose is unmaintained
+and does not work with modern Python versions. This is roughly based
+on #47, except that I've modified the `skip_legacy` decorator-variable
+in place to make the changes smaller.
+---
+ Makefile | 3 +--
+ development.txt | 3 ++-
+ tests/unit/test_forbidden_fruit.py | 7 ++++---
+ 3 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/tests/unit/test_forbidden_fruit.py b/tests/unit/test_forbidden_fruit.py
+index f8a1b62..7315d1b 100644
+--- a/tests/unit/test_forbidden_fruit.py
++++ b/tests/unit/test_forbidden_fruit.py
+@@ -2,7 +2,7 @@ import sys
+ from datetime import datetime
+ from forbiddenfruit import cursed, curses, curse, reverse
+ from types import FunctionType
+-from nose.tools import nottest, istest
++import pytest
+
+ # Our stub! :)
+ from . import ffruit
+@@ -14,7 +14,8 @@ def almost_equal(a, b, e=0.001):
+ return abs(a - b) < e
+
+
+-skip_legacy = nottest if sys.version_info < (3, 3) else istest
++skip_legacy = pytest.mark.skipif(sys.version_info < (3, 3),
++ reason="requires Python < 3.3")
+
+ def test_cursing_a_builtin_class():
+
+@@ -186,7 +187,7 @@ def test_dir_without_args_returns_names_in_local_scope():
+
+ # Then I see that `dir()` correctly returns a sorted list of those names
+ assert 'some_name' in dir()
+- assert dir() == sorted(locals().keys())
++ assert 'z' in dir()
+
+
+ @skip_legacy
+diff --git a/tests/unit/test_forbidden_fruit.py b/tests/unit/test_forbidden_fruit.py
+index 56b09ce..dd182c6 100644
+--- a/tests/unit/test_forbidden_fruit.py
++++ b/tests/unit/test_forbidden_fruit.py
+@@ -319,6 +319,7 @@ def test_dunder_str():
+ return 'one'
+ curse(int, '__str__', always_one)
+ assert str(1) == "one"
++ reverse(int, '__str__')
+
+ @skip_legacy
+ def test_dunder_reverse():
diff --git a/dev-python/forbiddenfruit/forbiddenfruit-0.1.4.ebuild b/dev-python/forbiddenfruit/forbiddenfruit-0.1.4.ebuild
new file mode 100644
index 000000000000..3cefd61682c4
--- /dev/null
+++ b/dev-python/forbiddenfruit/forbiddenfruit-0.1.4.ebuild
@@ -0,0 +1,52 @@
+# Copyright 2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_TESTED=( python3_{13..14} )
+# tests crash on 3.13+
+# https://github.com/clarete/forbiddenfruit/issues/78
+PYTHON_COMPAT=( python3_{13..14} )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Patch built-in Python objects"
+HOMEPAGE="
+ https://github.com/clarete/forbiddenfruit/
+ https://pypi.org/project/forbiddenfruit/
+"
+
+LICENSE="|| ( GPL-3 MIT )"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ test? (
+ $(python_gen_cond_dep '
+ dev-python/pytest[${PYTHON_USEDEP}]
+ ' "${PYTHON_TESTED[@]}")
+ )
+"
+
+PATCHES=(
+ # https://github.com/clarete/forbiddenfruit/pull/79
+ # + test case fix from
+ # https://github.com/clarete/forbiddenfruit/commit/6eb07cb77bcd3d54c7f09f23f176706d7dfccdef
+ "${FILESDIR}/${P}-pytest.patch"
+)
+
+python_test() {
+ if ! has "${EPYTHON/./_}" "${PYTHON_TESTED[@]}"; then
+ einfo "Skipping tests on ${EPYTHON}, as they are broken"
+ return
+ fi
+
+ local -x FFRUIT_EXTENSION=true
+ esetup.py build_ext -b tests/unit
+
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ epytest
+}
diff --git a/dev-python/forbiddenfruit/metadata.xml b/dev-python/forbiddenfruit/metadata.xml
new file mode 100644
index 000000000000..d34971a915e9
--- /dev/null
+++ b/dev-python/forbiddenfruit/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ </maintainer>
+ <stabilize-allarches />
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>