From e9df221ad01afefd3038d092d4f4fedb669009b1 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: May 29 2018 15:43:08 +0000 Subject: Update to 2.0.0dev0, move python2-pylint to it's own SPRM --- diff --git a/.gitignore b/.gitignore index 992b53e..6b49bb2 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ pylint-0.21.1.tar.gz /pylint-1.7.2.tar.gz /pylint-1.7.4.tar.gz /pylint-1.7.5.tar.gz +/pylint-2.0.dev.tar.gz diff --git a/0001-Remove-module-that-wasn-t-actually-moved.-Close-1565.patch b/0001-Remove-module-that-wasn-t-actually-moved.-Close-1565.patch deleted file mode 100644 index 498ff59..0000000 --- a/0001-Remove-module-that-wasn-t-actually-moved.-Close-1565.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 2e50e9ee1806bb019c3cdc79bfe594a923fa483d Mon Sep 17 00:00:00 2001 -From: Claudiu Popa -Date: Sat, 8 Jul 2017 11:46:39 +0300 -Subject: [PATCH 1/2] Remove module that wasn't actually moved. Close #1565 - ---- - pylint/checkers/python3.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pylint/checkers/python3.py b/pylint/checkers/python3.py -index f70aa28..f38e6f4 100644 ---- a/pylint/checkers/python3.py -+++ b/pylint/checkers/python3.py -@@ -500,7 +500,7 @@ class Python3Checker(checkers.BaseChecker): - 'dircache', 'dl', 'exception', 'fpformat', 'htmllib', 'ihooks', 'imageop', 'imputil', - 'linuxaudiodev', 'md5', 'mhlib', 'mimetools', 'MimeWriter', 'mimify', 'multifile', - 'mutex', 'new', 'popen2', 'posixfile', 'pure', 'rexec', 'rfc822', 'sha', 'sgmllib', -- 'sre', 'stat', 'stringold', 'sunaudio', 'sv', 'test.testall', 'thread', 'timing', -+ 'sre', 'stringold', 'sunaudio', 'sv', 'test.testall', 'thread', 'timing', - 'toaiff', 'user', 'urllib2', 'urlparse' - ]), - 'deprecated-string-function': { --- -2.9.5 - diff --git a/pylint.spec b/pylint.spec index aecf3eb..bcc4ddb 100644 --- a/pylint.spec +++ b/pylint.spec @@ -1,72 +1,31 @@ -%if 0%{?rhel} > 7 -# disable python2 by default -%bcond_with python2 -%else -%bcond_without python2 -%endif - -# On all Fedoras, use Python 3 for executables -# On RHEL > 7, use Python 3 for executables -# If there is no Python 2 build, use Python 3 for executables -%global py3_executables (0%{?fedora} || 0%{?rhel} > 7 || %{without python2}) - Name: pylint -Version: 1.7.5 -Release: 3%{?dist} +Version: 2.0.0 +%global tag pylint-2.0.dev +Release: 0.1dev0%{?dist} Summary: Analyzes Python code looking for bugs and signs of poor quality License: GPLv2+ URL: http://www.pylint.org/ -Source0: https://github.com/PyCQA/pylint/archive/pylint-%{version}.tar.gz +Source0: https://github.com/PyCQA/pylint/archive/%{tag}.tar.gz -# Fix for rhbz#1483869 -#Patch0: 0001-Remove-module-that-wasn-t-actually-moved.-Close-1565.patch +# https://github.com/PyCQA/pylint/issues/2129 +Patch0: test-absolute-paths.patch BuildArch: noarch -%if %py3_executables -Requires: python%{python3_pkgversion}-%{name} = %{version}-%{release} -%else -Requires: python2-%{name} = %{version}-%{release} -%endif -Obsoletes: pylint-gui < 1.7 +BuildRequires: python3-devel +BuildRequires: python3-setuptools +# For tests +BuildRequires: python3-astroid >= %{version} +BuildRequires: python3-isort +BuildRequires: python3-mccabe +BuildRequires: python3-pytest +BuildRequires: python3-pytest-runner +BuildRequires: python3-six -%description -Pylint is a Python source code analyzer which looks for programming -errors, helps enforcing a coding standard and sniffs for some code -smells (as defined in Martin Fowler's Refactoring book). -Pylint can be seen as another PyChecker since nearly all tests you -can do with PyChecker can also be done with Pylint. However, Pylint -offers some more features, like checking length of lines of code, -checking if variable names are well-formed according to your coding -standard, or checking if declared interfaces are truly implemented, -and much more. -Additionally, it is possible to write plugins to add your own checks. +# For the main pylint package +Requires: python3-%{name} = %{version}-%{release} -%if %{with python2} -%package -n python2-pylint -Summary: Analyzes Python code looking for bugs and signs of poor quality -BuildRequires: python2-devel -BuildRequires: python2-configparser -BuildRequires: python2-mccabe -BuildRequires: python2-setuptools -BuildRequires: python2-six -BuildRequires: python2-astroid >= 1.4.5 -# For tests -BuildRequires: python2-isort -BuildRequires: python2-backports-functools_lru_cache -BuildRequires: python2-pytest-runner -Requires: python2-astroid >= 1.4.5 -Requires: python2-setuptools -Requires: python2-six -Requires: python2-mccabe -Requires: python2-isort -Requires: python2-backports-functools_lru_cache -Requires: python2-configparser -Requires: python2-pytest-runner -Obsoletes: python2-pylint-gui < 1.7 -%{?python_provide:%python_provide python2-pylint} - -%description -n python2-pylint +%description Pylint is a Python source code analyzer which looks for programming errors, helps enforcing a coding standard and sniffs for some code smells (as defined in Martin Fowler's Refactoring book). @@ -77,27 +36,18 @@ checking if variable names are well-formed according to your coding standard, or checking if declared interfaces are truly implemented, and much more. Additionally, it is possible to write plugins to add your own checks. -%endif -%package -n python%{python3_pkgversion}-pylint -Summary: Analyzes Python code looking for bugs and signs of poor quality -BuildRequires: python%{python3_pkgversion}-devel python%{python3_pkgversion}-setuptools python%{python3_pkgversion}-tools -BuildRequires: python%{python3_pkgversion}-six -BuildRequires: python%{python3_pkgversion}-astroid >= 1.4.5 -# For tests -BuildRequires: python%{python3_pkgversion}-isort -BuildRequires: python%{python3_pkgversion}-mccabe -BuildRequires: python%{python3_pkgversion}-pytest-runner -Requires: python%{python3_pkgversion}-astroid >= 1.4.5 -Requires: python%{python3_pkgversion}-setuptools -Requires: python%{python3_pkgversion}-six -Requires: python%{python3_pkgversion}-mccabe -Requires: python%{python3_pkgversion}-isort -Requires: python%{python3_pkgversion}-pytest-runner -Obsoletes: python%{python3_pkgversion}-pylint-gui < 1.7 -%{?python_provide:%python_provide python%{python3_pkgversion}-pylint} - -%description -n python%{python3_pkgversion}-pylint +%package -n python3-%{name} +Summary: %{summary} +Requires: python3-astroid >= %{version} +Requires: python3-setuptools +Requires: python3-six +Requires: python3-mccabe +Requires: python3-isort +Obsoletes: python3-pylint-gui < 1.7 +%{?python_provide:%python_provide python3-%{name}} + +%description -n python3-%{name} Pylint is a Python source code analyzer which looks for programming errors, helps enforcing a coding standard and sniffs for some code smells (as defined in Martin Fowler's Refactoring book). @@ -110,62 +60,35 @@ and much more. Additionally, it is possible to write plugins to add your own checks. %prep -%setup -q -n pylint-pylint-%{version} -#%patch0 -p1 +%autosetup -n pylint-%{tag} -p1 + +# Convert DOS line endings to Unix +sed -i 's/\r//g' README.rst %build -%{?with_python2:%py2_build} %py3_build %install %py3_install rm -rf %{buildroot}%{python3_sitelib}/pylint/test + mkdir -pm 755 %{buildroot}%{_mandir}/man1 install -pm 644 man/*.1 %{buildroot}%{_mandir}/man1/ -# Add -%{python3_version} to the binaries and manpages + +# Add -%%{python3_version} to the binaries and manpages for backwards compatibility for NAME in epylint pylint pyreverse symilar; do mv %{buildroot}%{_bindir}/{$NAME,${NAME}-%{python3_version}} ln -s ${NAME}-%{python3_version} %{buildroot}%{_bindir}/${NAME}-3 mv %{buildroot}%{_mandir}/man1/{${NAME}.1,${NAME}-%{python3_version}.1} ln -s ${NAME}-%{python3_version}.1 %{buildroot}%{_mandir}/man1/${NAME}-3.1 -done - -%if %{with python2} -%py2_install -rm -rf %{buildroot}%{python2_sitelib}/pylint/test -mkdir -pm 755 %{buildroot}%{_mandir}/man1 -install -pm 644 man/*.1 %{buildroot}%{_mandir}/man1/ -# Add -%{python2_version} to the binaries and manpages -for NAME in epylint pylint pyreverse symilar; do - mv %{buildroot}%{_bindir}/{$NAME,${NAME}-%{python2_version}} - ln -s ${NAME}-%{python2_version} %{buildroot}%{_bindir}/${NAME}-2 - mv %{buildroot}%{_mandir}/man1/{${NAME}.1,${NAME}-%{python2_version}.1} - ln -s ${NAME}-%{python2_version}.1 %{buildroot}%{_mandir}/man1/${NAME}-2.1 -done -%endif - -for NAME in epylint pylint pyreverse symilar; do -%if %py3_executables ln -s ${NAME}-%{python3_version} %{buildroot}%{_bindir}/${NAME} ln -s ${NAME}-%{python3_version}.1 %{buildroot}%{_mandir}/man1/${NAME}.1 -%else - ln -s ${NAME}-%{python2_version} %{buildroot}%{_bindir}/${NAME} - ln -s ${NAME}-%{python2_version}.1 %{buildroot}%{_mandir}/man1/${NAME}.1 -%endif done -# remove pylint-gui manpage, as we have no pylint-gui anymore (removed upstream) -rm -f %{buildroot}%{_mandir}/man1/pylint-gui* %check -%if %{with python2} -export PYTHONPATH=%{buildroot}%{python2_sitelib} -%{__python2} bin/pylint -rn --rcfile=pylintrc --load-plugins=pylint.extensions.docparams, pylint.extensions.mccabe pylint || : -%{__python2} -Wi -m unittest discover -s pylint/test || : -%endif - export PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} bin/pylint -rn --rcfile=pylintrc --load-plugins=pylint.extensions.docparams, pylint.extensions.mccabe pylint || : -%{__python3} -Wi -m unittest discover -s pylint/test || : +%{__python3} -m pytest -v %files %doc README.rst ChangeLog examples elisp @@ -179,27 +102,20 @@ export PYTHONPATH=%{buildroot}%{python3_sitelib} %{_mandir}/man1/pyreverse.1* %{_mandir}/man1/symilar.1* -%if %{with python2} -%files -n python2-pylint -%doc README.rst ChangeLog examples elisp -%license COPYING -%{_bindir}/*-2 -%{_bindir}/*-%{python2_version} -%{_mandir}/man1/*-2.1* -%{_mandir}/man1/*-%{python2_version}.1* -%{python2_sitelib}/pylint* -%endif - -%files -n python%{python3_pkgversion}-pylint -%doc README.rst ChangeLog examples elisp +%files -n python3-%{name} %license COPYING %{python3_sitelib}/pylint* +# backwards compatible versioned executables and manpages: %{_bindir}/*-3 %{_bindir}/*-%{python3_version} %{_mandir}/man1/*-3.1* %{_mandir}/man1/*-%{python3_version}.1* %changelog +* Mon May 21 2018 Miro Hrončok - 2.0.0-0.1dev0 +- Update to 2.0.0dev0 +- Drop python2-pylint (to it's own source RPM) + * Sun Apr 15 2018 Miro Hrončok - 1.7.5-3 - Conditionalize python2 subpackage, don't build it on RHEL > 7 diff --git a/sources b/sources index 3bc564a..2d4e95c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pylint-1.7.5.tar.gz) = 59770340acf41600ee148d963269f6348eda12c9da6c09b84df5bd4c3e506f53996804377de9e42588e848370faf480f4591d53e92d3aa59f0840e8ed2bf94ea +SHA512 (pylint-2.0.dev.tar.gz) = bf77057fe09314802510174c6591276bd6cef5a970599787af5435b3fee4ae55f260da09d80026f02b6e146ceb4c399fa2da949c457f12ae058ef33b65f267b8 diff --git a/test-absolute-paths.patch b/test-absolute-paths.patch new file mode 100644 index 0000000..4b24a47 --- /dev/null +++ b/test-absolute-paths.patch @@ -0,0 +1,46 @@ +From bf258d2d9a30385f62e4c77158fa0427134e7603 Mon Sep 17 00:00:00 2001 +From: Claudiu Popa +Date: Tue, 22 May 2018 09:47:12 +0200 +Subject: [PATCH] Use the absolute paths for tests and adapt the codes to the + right ones. Close #2129 + +--- + pylint/test/test_self.py | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/pylint/test/test_self.py b/pylint/test/test_self.py +index 3ac6b73db..1cc9eeff2 100644 +--- a/pylint/test/test_self.py ++++ b/pylint/test/test_self.py +@@ -94,7 +94,7 @@ def linter(self, value): + + class TestRunTC(object): + +- def _runtest(self, args, reporter=None, out=None, code=28): ++ def _runtest(self, args, reporter=None, out=None, code=None): + if out is None: + out = six.StringIO() + pylint_code = self._run_pylint(args, reporter=reporter, out=out) +@@ -140,8 +140,8 @@ def test_all(self): + ColorizedTextReporter(six.StringIO()), + JSONReporter(six.StringIO()) + ] +- self._runtest(['pylint/test/functional/arguments.py'], +- reporter=MultiReporter(reporters), code=1) ++ self._runtest([join(HERE, 'functional/arguments.py')], ++ reporter=MultiReporter(reporters), code=2) + + def test_no_ext_file(self): + self._runtest([join(HERE, 'input', 'noext')], code=0) +@@ -221,8 +221,9 @@ def test_no_out_encoding(self): + out=strio, code=28) + + def test_parallel_execution(self): +- self._runtest(['-j 2', 'pylint/test/functional/arguments.py', +- 'pylint/test/functional/bad_continuation.py'], code=1) ++ self._runtest(['-j 2', ++ join(HERE, 'functional/arguments.py'), ++ join(HERE, 'functional/bad_continuation.py')], code=18) + + def test_parallel_execution_missing_arguments(self): + self._runtest(['-j 2', 'not_here', 'not_here_too'], code=1)