15
0

Accepting request 1060884 from devel:languages:python

- Add ignore-deprecation.patch to make it compatible with python 3.11
  gh#hhatto/autopep8#665

OBS-URL: https://build.opensuse.org/request/show/1060884
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-autopep8?expand=0&rev=26
This commit is contained in:
2023-01-25 16:44:25 +00:00
committed by Git OBS Bridge
3 changed files with 30 additions and 1 deletions

21
ignore-deprecation.patch Normal file
View File

@@ -0,0 +1,21 @@
diff --git a/test/test_autopep8.py b/test/test_autopep8.py
index 5f4dbed8..c6319cfa 100755
--- a/test/test_autopep8.py
+++ b/test/test_autopep8.py
@@ -40,13 +40,14 @@
)
if 'AUTOPEP8_COVERAGE' in os.environ and int(os.environ['AUTOPEP8_COVERAGE']):
- AUTOPEP8_CMD_TUPLE = ('coverage', 'run', '--branch', '--parallel',
+ AUTOPEP8_CMD_TUPLE = (sys.executable, '-Wignore::DeprecationWarning',
+ '-m', 'coverage', 'run', '--branch', '--parallel',
'--omit=*/site-packages/*',
os.path.join(ROOT_DIR, 'autopep8.py'),)
else:
# We need to specify the executable to make sure the correct Python
# interpreter gets used.
- AUTOPEP8_CMD_TUPLE = (sys.executable,
+ AUTOPEP8_CMD_TUPLE = (sys.executable, '-Wignore::DeprecationWarning',
os.path.join(ROOT_DIR,
'autopep8.py'),) # pragma: no cover

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jan 25 12:46:02 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
- Add ignore-deprecation.patch to make it compatible with python 3.11
gh#hhatto/autopep8#665
-------------------------------------------------------------------
Sat Jan 21 18:45:56 UTC 2023 - Ben Greiner <code@bnavigator.de>

View File

@@ -24,6 +24,8 @@ License: MIT
Group: Development/Languages/Python
URL: https://github.com/hhatto/autopep8
Source: https://files.pythonhosted.org/packages/source/a/autopep8/autopep8-%{version}.tar.gz
# PATCH-FIX-UPSTREAM ignore-deprecation.patch gh#hhatto/autopep8#665/files
Patch: ignore-deprecation.patch
BuildRequires: %{python_module base >= 3.6}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pycodestyle >= 2.8}
@@ -45,7 +47,7 @@ Autopep8 is automatic generated to pep8 checked code.
This is old style tool, wrapped pep8 via subprocess module.
%prep
%setup -q -n autopep8-%{version}
%autosetup -p1 -n autopep8-%{version}
sed -i '1s/^#!.*//' autopep8.py # Remove she-bang line
%build