summaryrefslogtreecommitdiff
path: root/dev-python/bpython
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/bpython')
-rw-r--r--dev-python/bpython/Manifest1
-rw-r--r--dev-python/bpython/bpython-0.26.ebuild49
-rw-r--r--dev-python/bpython/files/bpython-0.26-urwid-3.patch36
-rw-r--r--dev-python/bpython/metadata.xml25
4 files changed, 111 insertions, 0 deletions
diff --git a/dev-python/bpython/Manifest b/dev-python/bpython/Manifest
new file mode 100644
index 000000000000..72efaf50fb7c
--- /dev/null
+++ b/dev-python/bpython/Manifest
@@ -0,0 +1 @@
+DIST bpython-0.26.tar.gz 207564 BLAKE2B fce515c05a98a47f8271670d20eb77f98e8a7c33e234c0ad3277696229c2705593b66d79f080a3f1f7b1be45f81576a9fdf6a3ec642c76e29466b4d54bd3ad40 SHA512 02bd2b7b42e89bec9327509e2db463eeb609ddb5cacea7e58e0d033af11aacdc11b9e3c8555a8e280e7d7e6fa518b34142a89446b60326857b872f454e2034fe
diff --git a/dev-python/bpython/bpython-0.26.ebuild b/dev-python/bpython/bpython-0.26.ebuild
new file mode 100644
index 000000000000..ccd9fc7adc95
--- /dev/null
+++ b/dev-python/bpython/bpython-0.26.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{13..14} )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Syntax highlighting and autocompletion for the Python interpreter"
+HOMEPAGE="
+ https://bpython-interpreter.org/
+ https://github.com/bpython/bpython/
+ https://pypi.org/project/bpython/
+"
+
+LICENSE="MIT BSD-2 PSF-2"
+SLOT="0"
+KEYWORDS="amd64 arm64 ~riscv x86"
+IUSE="clipboard +jedi watch"
+
+# see https://github.com/bpython/bpython/issues/641 wrt greenlet
+RDEPEND="
+ >=dev-python/curtsies-0.4.0[${PYTHON_USEDEP}]
+ dev-python/cwcwidth[${PYTHON_USEDEP}]
+ dev-python/greenlet[${PYTHON_USEDEP}]
+ dev-python/pygments[${PYTHON_USEDEP}]
+ dev-python/pyxdg[${PYTHON_USEDEP}]
+ dev-python/requests[${PYTHON_USEDEP}]
+ clipboard? ( dev-python/pyperclip[${PYTHON_USEDEP}] )
+ jedi? ( dev-python/jedi[${PYTHON_USEDEP}] )
+ watch? ( dev-python/watchdog[${PYTHON_USEDEP}] )
+"
+# sphinx is used implicitly to build manpages
+BDEPEND="
+ dev-python/wheel[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+"
+
+distutils_enable_sphinx doc/sphinx/source --no-autodoc
+distutils_enable_tests unittest
+
+DOCS=( AUTHORS.rst CHANGELOG.rst )
+
+PATCHES=(
+ # https://github.com/bpython/bpython/commit/bbc9438a2638d60f131ede56d7c21a6f96592927
+ "${FILESDIR}/${P}-urwid-3.patch"
+)
diff --git a/dev-python/bpython/files/bpython-0.26-urwid-3.patch b/dev-python/bpython/files/bpython-0.26-urwid-3.patch
new file mode 100644
index 000000000000..4a563a455877
--- /dev/null
+++ b/dev-python/bpython/files/bpython-0.26-urwid-3.patch
@@ -0,0 +1,36 @@
+From bbc9438a2638d60f131ede56d7c21a6f96592927 Mon Sep 17 00:00:00 2001
+From: Sebastian Ramacher <sebastian@ramacher.at>
+Date: Tue, 28 Oct 2025 23:12:28 +0100
+Subject: [PATCH] Fix compatibility with urwid 3.0 (fixes #1043)
+
+--- a/bpython/urwid.py
++++ b/bpython/urwid.py
+@@ -411,7 +411,7 @@ def keypress(self, size, key):
+ return key
+
+
+-class Tooltip(urwid.BoxWidget):
++class Tooltip(urwid.Widget):
+ """Container inspired by Overlay to position our tooltip.
+
+ bottom_w should be a BoxWidget.
+@@ -423,6 +423,9 @@ class Tooltip(urwid.BoxWidget):
+ from the bottom window and hides it if there is no cursor.
+ """
+
++ _sizing = frozenset(['box'])
++ _selectable = True
++
+ def __init__(self, bottom_w, listbox):
+ super().__init__()
+
+@@ -1322,7 +1325,8 @@ def run_find_coroutine():
+
+ run_find_coroutine()
+
+- myrepl.main_loop.screen.run_wrapper(run_with_screen_before_mainloop)
++ with myrepl.main_loop.screen.start():
++ run_with_screen_before_mainloop()
+
+ if config.flush_output and not options.quiet:
+ sys.stdout.write(myrepl.getstdout())
diff --git a/dev-python/bpython/metadata.xml b/dev-python/bpython/metadata.xml
new file mode 100644
index 000000000000..78a1f182aec0
--- /dev/null
+++ b/dev-python/bpython/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>grozin@gentoo.org</email>
+ <name>Andrey Grozin</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <stabilize-allarches/>
+ <use>
+ <flag name="clipboard">Enable copying to clipboard
+ using <pkg>dev-python/pyperclip</pkg></flag>
+ <flag name="jedi">Enable autocompletion
+ using <pkg>dev-python/jedi</pkg></flag>
+ <flag name="watch">Enable watching paths
+ using <pkg>dev-python/watchdog</pkg></flag>
+ </use>
+ <upstream>
+ <remote-id type="pypi">bpython</remote-id>
+ <remote-id type="github">bpython/bpython</remote-id>
+ </upstream>
+</pkgmetadata>