diff --git a/ignore-deprecation.patch b/ignore-deprecation.patch new file mode 100644 index 0000000..e765bd2 --- /dev/null +++ b/ignore-deprecation.patch @@ -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 + diff --git a/python-autopep8.changes b/python-autopep8.changes index 8188845..0a4d1ef 100644 --- a/python-autopep8.changes +++ b/python-autopep8.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jan 25 12:46:02 UTC 2023 - Daniel Garcia + +- 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 diff --git a/python-autopep8.spec b/python-autopep8.spec index 590f13b..430e3a6 100644 --- a/python-autopep8.spec +++ b/python-autopep8.spec @@ -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