forked from pool/python-python-editor
Accepting request 1287805 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1287805 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-python-editor?expand=0&rev=8
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Jun 20 11:51:56 UTC 2025 - Nico Krapp <nico.krapp@suse.com>
|
||||||
|
|
||||||
|
- Add support-python312.patch to not depend on distutils (boo#1245108)
|
||||||
|
- clean up duplicate files
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Jun 10 12:56:27 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
Tue Jun 10 12:56:27 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
||||||
|
|
||||||
|
@@ -24,9 +24,12 @@ License: Apache-2.0
|
|||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
URL: https://github.com/fmoo/python-editor
|
URL: https://github.com/fmoo/python-editor
|
||||||
Source: https://files.pythonhosted.org/packages/source/p/python-editor/python-editor-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/p/python-editor/python-editor-%{version}.tar.gz
|
||||||
|
# PATCH-FIX-UPSTREAM support-python312.patch https://github.com/fmoo/python-editor/commit/5023fafd265add111b29baca59b07f140daf75b7
|
||||||
|
Patch0: support-python312.patch
|
||||||
BuildRequires: %{python_module pip}
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: %{python_module wheel}
|
BuildRequires: %{python_module wheel}
|
||||||
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%if 0%{?is_opensuse}
|
%if 0%{?is_opensuse}
|
||||||
@@ -40,7 +43,7 @@ programmatically interfacing with the editor defined in the EDITOR
|
|||||||
environment variable.
|
environment variable.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n python-editor-%{version}
|
%autosetup -p1 -n python-editor-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
find -type f -exec chmod 644 {} +
|
find -type f -exec chmod 644 {} +
|
||||||
@@ -49,13 +52,12 @@ find -type f -exec chmod 644 {} +
|
|||||||
%install
|
%install
|
||||||
%pyproject_install
|
%pyproject_install
|
||||||
%python_expand sed -i -e '/^#!\/usr\/bin\/env/d' %{buildroot}%{$python_sitelib}/editor.py
|
%python_expand sed -i -e '/^#!\/usr\/bin\/env/d' %{buildroot}%{$python_sitelib}/editor.py
|
||||||
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}/
|
||||||
|
|
||||||
%if 0%{?is_opensuse}
|
|
||||||
# the example does not look like an unit test
|
# the example does not look like an unit test
|
||||||
# %check
|
# %%check
|
||||||
# export EDITOR='nano'
|
# export EDITOR='nano'
|
||||||
# Xpython_exec test.py
|
# Xpython_exec test.py
|
||||||
%endif
|
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
|
33
support-python312.patch
Normal file
33
support-python312.patch
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
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(-)
|
||||||
|
|
||||||
|
Index: python-editor-1.0.4/editor.py
|
||||||
|
===================================================================
|
||||||
|
--- python-editor-1.0.4.orig/editor.py
|
||||||
|
+++ python-editor-1.0.4/editor.py
|
||||||
|
@@ -8,7 +8,6 @@ import locale
|
||||||
|
import os.path
|
||||||
|
import subprocess
|
||||||
|
import tempfile
|
||||||
|
-from distutils.spawn import find_executable
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
@@ -52,6 +51,10 @@ def get_editor_args(editor):
|
||||||
|
|
||||||
|
|
||||||
|
def get_editor():
|
||||||
|
+ try:
|
||||||
|
+ from distutils.spawn import find_executable
|
||||||
|
+ except ImportError:
|
||||||
|
+ from shutil import which as find_executable
|
||||||
|
# Get the editor from the environment. Prefer VISUAL to EDITOR
|
||||||
|
editor = os.environ.get('VISUAL') or os.environ.get('EDITOR')
|
||||||
|
if editor:
|
Reference in New Issue
Block a user