diff --git a/no-more-pathlib2.patch b/no-more-pathlib2.patch new file mode 100644 index 0000000..8ca4015 --- /dev/null +++ b/no-more-pathlib2.patch @@ -0,0 +1,104 @@ +From 16370c44b65acf5e53c4d27a9ce298ca25df6fc6 Mon Sep 17 00:00:00 2001 +From: Steve Kowalik +Date: Wed, 3 Aug 2022 15:03:39 +1000 +Subject: [PATCH] Remove use of pathlib2 + +pathlib has been included in the Python standard library since 3.4, +and since the lowest supported version of Python is now above that, we +can remove the external dependency and use pathlib directly. As a +drive-by, also remove a bunch of __future__ imports. +--- + requirements/pypi.txt | 1 - + setup.cfg | 2 +- + src/pylint_ignore/__main__.py | 2 +- + src/pylint_ignore/ignorefile.py | 2 +- + test/test_ignorefile.py | 7 +------ + test/test_main.py | 7 +------ + 6 files changed, 5 insertions(+), 16 deletions(-) + +diff --git a/requirements/pypi.txt b/requirements/pypi.txt +index e652814..392001a 100644 +--- a/requirements/pypi.txt ++++ b/requirements/pypi.txt +@@ -9,5 +9,4 @@ + + astroid>2.1.0 + pylint<2.13 +-pathlib2 + pylev +diff --git a/src/pylint_ignore/__main__.py b/src/pylint_ignore/__main__.py +index f17c12b..03021a5 100755 +--- a/src/pylint_ignore/__main__.py ++++ b/src/pylint_ignore/__main__.py +@@ -23,8 +23,8 @@ + import functools as ft + import subprocess as sp + import multiprocessing as mp ++import pathlib as pl + +-import pathlib2 as pl + import pylint.lint + from pylint.lint.pylinter import PyLinter + +diff --git a/src/pylint_ignore/ignorefile.py b/src/pylint_ignore/ignorefile.py +index a26139b..df2c5a7 100644 +--- a/src/pylint_ignore/ignorefile.py ++++ b/src/pylint_ignore/ignorefile.py +@@ -9,9 +9,9 @@ + import hashlib + import logging + import collections ++import pathlib as pl + + import pylev +-import pathlib2 as pl + + logger = logging.getLogger('pylint_ignore') + +diff --git a/test/test_ignorefile.py b/test/test_ignorefile.py +index d7835a4..5b4fd3f 100644 +--- a/test/test_ignorefile.py ++++ b/test/test_ignorefile.py +@@ -2,18 +2,13 @@ + # pylint:disable=redefined-outer-name ; pytest.fixture tmp_ignorefile + # pylint:disable=protected-access ; ok for testing + +-from __future__ import division +-from __future__ import print_function +-from __future__ import absolute_import +-from __future__ import unicode_literals +- + import os + import time + import shutil + import textwrap ++import pathlib as pl + + import pytest +-import pathlib2 as pl + + from pylint_ignore import ignorefile + +diff --git a/test/test_main.py b/test/test_main.py +index f224a6e..5215bc7 100644 +--- a/test/test_main.py ++++ b/test/test_main.py +@@ -2,17 +2,12 @@ + # pylint:disable=redefined-outer-name ; pytest.fixture ignore_file + # pylint:disable=protected-access ; ok for testing + +-from __future__ import division +-from __future__ import print_function +-from __future__ import absolute_import +-from __future__ import unicode_literals +- + import os + import sys + import shutil ++import pathlib as pl + + import pytest +-import pathlib2 as pl + + import pylint_ignore.__main__ as main + diff --git a/pylint-ignore-2021.1024.tar.gz b/pylint-ignore-2021.1024.tar.gz deleted file mode 100644 index 90f8d6f..0000000 --- a/pylint-ignore-2021.1024.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:06abefb1de9401ad6c02a8ade1dd8630989eaf3f4393d0fffc2dc5ba819e5ef9 -size 36151 diff --git a/pylint-ignore-2022.1025.tar.gz b/pylint-ignore-2022.1025.tar.gz new file mode 100644 index 0000000..63e8a3e --- /dev/null +++ b/pylint-ignore-2022.1025.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a85c5c6df163a2bb91b41175070948b93abc2452380b5d20ebd8a02461216ac +size 36283 diff --git a/python-pylint-ignore.changes b/python-pylint-ignore.changes index 2ff42f3..1ad1afc 100644 --- a/python-pylint-ignore.changes +++ b/python-pylint-ignore.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Aug 3 05:32:29 UTC 2022 - Steve Kowalik + +- Update to 2022.1025: + * Pin pylint to <2.13 +- Add patch no-more-pathlib2.patch: + * Use pathlib rather than pathlib2. +- Drop {Build,}Requires on pathlib2 + ------------------------------------------------------------------- Wed Feb 23 14:35:03 UTC 2022 - pgajdos@suse.com diff --git a/python-pylint-ignore.spec b/python-pylint-ignore.spec index 73ed3e9..1833948 100644 --- a/python-pylint-ignore.spec +++ b/python-pylint-ignore.spec @@ -18,23 +18,23 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pylint-ignore -Version: 2021.1024 +Version: 2022.1025 Release: 0 Summary: Start with silence, not with noise But do start! License: MIT URL: https://github.com/mbarkhau/pylint-ignore Source: https://files.pythonhosted.org/packages/source/p/pylint-ignore/pylint-ignore-%{version}.tar.gz +# PATCH-FIX-UPSTREAM gh#mbarkhau/pylint-ignore#15 +Patch0: no-more-pathlib2.patch BuildRequires: %{python_module setuptools} BuildRequires: python-rpm-macros # SECTION test requirements -BuildRequires: %{python_module pathlib2} BuildRequires: %{python_module pylev} BuildRequires: %{python_module pylint > 2.4} BuildRequires: %{python_module pytest} # /SECTION BuildRequires: fdupes Requires: python-astroid > 2.1.0 -Requires: python-pathlib2 Requires: python-pylev Requires: python-pylint > 2.4 BuildArch: noarch @@ -48,7 +48,7 @@ This file is used to ignore Pylint messages without adding comments to the source code itself. It's similar to Rupocop's .rubocop_todo.yml. %prep -%setup -q -n pylint-ignore-%{version} +%autosetup -p1 -n pylint-ignore-%{version} %build %python_build