aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptrcnull <git@ptrcnull.me>2024-03-28 11:58:22 +0100
committerptrcnull <git@ptrcnull.me>2024-03-28 11:58:22 +0100
commita953f98e657c4d5245f987b8d2a8e85c503923a2 (patch)
tree438f1e922642314615d9d7dddb91fe59a2b89e86
parent18293a5ee0feff686790375eab336eb6060a1f8f (diff)
community/py3-python-editor: fix tests with python 3.12HEADmaster
-rw-r--r--community/py3-python-editor/APKBUILD11
-rw-r--r--community/py3-python-editor/distutils.patch23
2 files changed, 31 insertions, 3 deletions
diff --git a/community/py3-python-editor/APKBUILD b/community/py3-python-editor/APKBUILD
index 6b3966589e5..101fbf920c4 100644
--- a/community/py3-python-editor/APKBUILD
+++ b/community/py3-python-editor/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-python-editor
pkgver=1.0.4
-pkgrel=6
+pkgrel=7
pkgdesc="Programmatically open an editor, capture the result"
url="https://github.com/fmoo/python-editor"
arch="noarch"
@@ -11,7 +11,9 @@ depends="python3"
makedepends="py3-setuptools"
options="!check" # tests are interactive
subpackages="$pkgname-pyc"
-source="https://files.pythonhosted.org/packages/source/p/python-editor/python-editor-$pkgver.tar.gz"
+source="https://files.pythonhosted.org/packages/source/p/python-editor/python-editor-$pkgver.tar.gz
+ distutils.patch
+ "
builddir="$srcdir/python-editor-$pkgver"
build() {
@@ -26,4 +28,7 @@ package() {
python3 setup.py install --skip-build --root="$pkgdir"
}
-sha512sums="c8ce2403bfe6c93935c7f4c384a8618a39cdaefe1ff5b1ff2cf4562866d8b3caa616e428c0a1634a56db934caeb474e7f84f8d5e009b9ed664189fdece8146f6 python-editor-1.0.4.tar.gz"
+sha512sums="
+c8ce2403bfe6c93935c7f4c384a8618a39cdaefe1ff5b1ff2cf4562866d8b3caa616e428c0a1634a56db934caeb474e7f84f8d5e009b9ed664189fdece8146f6 python-editor-1.0.4.tar.gz
+f9c872bf80e30a4f9a93d27ada61fbbe8aaa3a38d407e8bcbc154a5e0decb5bf315908b1f9ba36f917866771aaea51c8bb93a87a3d5b17e6839eda5587c5c14f distutils.patch
+"
diff --git a/community/py3-python-editor/distutils.patch b/community/py3-python-editor/distutils.patch
new file mode 100644
index 00000000000..6fef35ebccb
--- /dev/null
+++ b/community/py3-python-editor/distutils.patch
@@ -0,0 +1,23 @@
+Patch-Source: https://github.com/fmoo/python-editor/commit/5023fafd265add111b29baca59b07f140daf75b7
+From 5023fafd265add111b29baca59b07f140daf75b7 Mon Sep 17 00:00:00 2001
+From: Branch Vincent <branchevincent@gmail.com>
+Date: Sun, 8 Oct 2023 12:52:53 -0700
+Subject: [PATCH] support python 3.12
+
+Python 3.12 has removed `distutils`: https://docs.python.org/3.12/whatsnew/3.12.html#removed
+---
+ editor.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/editor.py b/editor.py
+index 6fc73f1..eafc189 100755
+--- a/editor.py
++++ b/editor.py
+@@ -10,3 +10,6 @@ import subprocess
+ import tempfile
+-from distutils.spawn import find_executable
++try:
++ from distutils.spawn import find_executable
++except ImportError:
++ from shutil import which as find_executable
+