[packages/python-pylint] - updated to 1.9.5 - added rc patch use python version specific rc file

qboosh qboosh at pld-linux.org
Sat Nov 16 11:20:55 CET 2019


commit e541e8cd2ab979e4f7d92ffcfac175dd49a3cd8f
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Nov 16 11:20:58 2019 +0100

    - updated to 1.9.5
    - added rc patch use python version specific rc file

 python-pylint-rc.patch            |  13 +++
 pylint.spec => python-pylint.spec | 221 ++++++++++++++++++++++----------------
 2 files changed, 141 insertions(+), 93 deletions(-)
---
diff --git a/pylint.spec b/python-pylint.spec
similarity index 52%
rename from pylint.spec
rename to python-pylint.spec
index cbe3bcb..ccbaba5 100644
--- a/pylint.spec
+++ b/python-pylint.spec
@@ -1,85 +1,97 @@
-# TODO:
-# - include examples in package
-
+#
 # Conditional build:
-%bcond_without  python2 # Python 2.x version
-%bcond_without  python3 # Python 3.x version (available as 'py3lint')
+%bcond_without	python2	# Python 2.x version (available as 'py2lint')
+%bcond_with	python3	# Python 3.x version (available as 'py3lint')
+%bcond_without	doc	# Sphinx documentation
 
 Summary:	Python 2 tool that checks if a module satisfy a coding standard
 Summary(pl.UTF-8):	Narzędzie Pythona 2 sprawdzające zgodność modułu ze standardem kodowania
-Name:		pylint
-Version:	1.8.2
-Release:	2
+Name:		python-pylint
+Version:	1.9.5
+Release:	1
 License:	GPL v2+
 Group:		Development/Languages/Python
-#Source0Download: https://pypi.python.org/pypi/pylint
-Source0:	https://github.com/PyCQA/pylint/archive/%{name}-%{version}.tar.gz
-# Source0-md5:	573874b242a49af0682c29badc5cf1b9
+#Source0Download: https://pypi.org/simple/pylint
+Source0:	https://github.com/PyCQA/pylint/archive/pylint-%{version}.tar.gz
+# Source0-md5:	3db0fde1876d50ad313fd707ecd6562b
+Patch0:		%{name}-rc.patch
 URL:		http://www.pylint.org/
 %if %{with python2}
-BuildRequires:	python-astroid >= 1.5.3
-BuildRequires:	python-certifi >= 2017.4.17
-BuildRequires:	python-chardet >= 3.0.2
-BuildRequires:	python-devel
-BuildRequires:	python-idna >= 2.5
-BuildRequires:	python-isort
-BuildRequires:	python-lazy-object-proxy
-BuildRequires:	python-mccabe
-BuildRequires:	python-modules >= 1:2.5
+BuildRequires:	python-devel >= 1:2.7
+BuildRequires:	python-modules >= 1:2.7
+BuildRequires:	python-pytest-runner
 BuildRequires:	python-setuptools >= 7.0
-BuildRequires:	python-wrapt
-BuildConflicts:	python-chardet >= 3.1.0
-BuildConflicts:	python-idna >= 2.7
+%if %{with tests}
+BuildRequires:	python-astroid >= 1.6.0
+BuildRequires:	python-astroid < 2.0
+BuildRequires:	python-backports.functools_lru_cache
+BuildRequires:	python-configparser
+BuildRequires:	python-isort >= 4.2.5
+BuildRequires:	python-mccabe
+BuildRequires:	python-pytest
+BuildRequires:	python-pytest-xdist
+BuildRequires:	python-singledispatch
 %endif
 %if %{with python3}
-BuildRequires:	python3-2to3
-BuildRequires:	python3-astroid >= 1.5.3
-BuildRequires:	python3-certifi >= 2017.4.17
-BuildRequires:	python3-chardet >= 3.0.2
-BuildRequires:	python3-devel
-BuildRequires:	python3-idna >= 2.5
-BuildRequires:	python3-isort
-BuildRequires:	python3-lazy-object-proxy
-BuildRequires:	python3-mccabe
-BuildRequires:	python3-modules >= 1:3.2
+BuildRequires:	python3-devel >= 1:3.4
+BuildRequires:	python3-modules >= 1:3.4
+BuildRequires:	python3-modules < 1:3.7
+BuildRequires:	python3-pytest-runner
 BuildRequires:	python3-setuptools >= 7.0
-BuildRequires:	python3-wrapt
-BuildConflicts:	python3-chardet >= 3.1.0
-BuildConflicts:	python3-idna >= 2.7
+%if %{with tests}
+BuildRequires:	python3-astroid >= 1.6.0
+BuildRequires:	python3-astroid < 2.0
+BuildRequires:	python3-isort >= 4.2.5
+BuildRequires:	python3-pytest
+BuildRequires:	python3-pytest-xdist
+BuildRequires:	python3-mccabe
+%endif
 %endif
 BuildRequires:	rpm-pythonprov
-BuildRequires:	rpmbuild(macros) >= 1.219
-BuildRequires:	sphinx-pdg
-Requires:	python-pylint = %{version}-%{release}
+BuildRequires:	rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires:	sphinx-pdg >= 1
+%endif
 Suggests:	python-devel-src
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-# /etc/pylintrc is deliberately packaged to both packages with same name
-%define		_duplicate_files_terminate_build	0
-
-# current Python 3.x provides all these
-%define		_noautoreq	python3egg.backports.functools-lru-cache python3egg.configparser python3egg.singledispatch
-
 %description
 Python 2 tool that checks if a module satisfy a coding standard.
 
+This package contains only the Python modules used by the tool.
+
 %description -l pl.UTF-8
 Narzędzie Pythona 2 sprawdzające zgodność modułów napisanych w języku
 Python z regułami tworzenia kodu źródłowego.
 
-%package -n python-pylint
+Ten pakiet zawiera tylko moduły Pythona używane przez to narzędzie.
+
+%package -n py2lint
 Summary:	Python 2 tool that checks if a module satisfy a coding standard (modules)
 Summary(pl.UTF-8):	Narzędzie Pythona sprawdzające zgodność modułu ze standardem kodowania (moduły)
 Group:		Libraries/Python
+Requires:	%{name} = %{version}-%{release}
 
-%description -n python-pylint
+%description -n py2lint
 Python 2 tool that checks if a module satisfy a coding standard.
 
+%description -n py2lint -l pl.UTF-8
+Narzędzie Pythona 2 sprawdzające zgodność modułów napisanych w języku
+Python z regułami tworzenia kodu źródłowego.
+
+%package -n python3-pylint
+Summary:	Python 3 tool that checks if a module satisfy a coding standard (moduły)
+Summary(pl.UTF-8):	Narzędzie Pythona 3 sprawdzające zgodność modułu ze standardem kodowania (modules)
+Group:		Libraries/Python
+
+%description -n python3-pylint
+Python 3 tool that checks if a module satisfy a coding standard.
+
 This package contains only the Python modules used by the tool.
 
-%description -n python-pylint -l pl.UTF-8
-Narzędzie Pythona 2 sprawdzające zgodność modułów napisanych w języku
+%description -n python3-pylint -l pl.UTF-8
+Narzędzie Pythona 3 sprawdzające zgodność modułów napisanych w języku
 Python z regułami tworzenia kodu źródłowego.
 
 Ten pakiet zawiera tylko moduły Pythona używane przez to narzędzie.
@@ -102,24 +114,20 @@ Python z regułami tworzenia kodu źródłowego.
 
 Wersja dla Pythona 3.x, dostępna przez polecenie 'py3lint'.
 
-%package -n python3-pylint
-Summary:	Python 3 tool that checks if a module satisfy a coding standard (moduły)
-Summary(pl.UTF-8):	Narzędzie Pythona 3 sprawdzające zgodność modułu ze standardem kodowania (modules)
-Group:		Libraries/Python
-
-%description -n python3-pylint
-Python 3 tool that checks if a module satisfy a coding standard.
-
-This package contains only the Python modules used by the tool.
+%package doc
+Summary:	Documentation for pylint module and tool
+Summary(pl.UTF-8):	Dokumentacja do modułu i narzędzia pylint
+Group:		Documentation
 
-%description -n python3-pylint -l pl.UTF-8
-Narzędzie Pythona 3 sprawdzające zgodność modułów napisanych w języku
-Python z regułami tworzenia kodu źródłowego.
+%description doc
+Documentation for pylint module and tool.
 
-Ten pakiet zawiera tylko moduły Pythona używane przez to narzędzie.
+%description doc -l pl.UTF-8
+Dokumentacja do modułu i narzędzia pylint.
 
 %prep
 %setup -q -n pylint-pylint-%{version}
+%patch0 -p1
 
 %build
 %if %{with python2}
@@ -130,31 +138,44 @@ Ten pakiet zawiera tylko moduły Pythona używane przez to narzędzie.
 %py3_build
 %endif
 
+%if %{with doc}
 %{__make} -C doc text \
 	PYTHONPATH=$PWD
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1}
 
-%if %{with python3}
-%py3_install
-
-%{__mv} $RPM_BUILD_ROOT%{_bindir}/epylint $RPM_BUILD_ROOT%{_bindir}/epy3lint
-%{__mv} $RPM_BUILD_ROOT%{_bindir}/pylint $RPM_BUILD_ROOT%{_bindir}/py3lint
-%{__mv} $RPM_BUILD_ROOT%{_bindir}/pyreverse $RPM_BUILD_ROOT%{_bindir}/py3reverse
-cp -p man/epylint.1 $RPM_BUILD_ROOT%{_mandir}/man1/epy3lint.1
-cp -p man/pylint.1 $RPM_BUILD_ROOT%{_mandir}/man1/py3lint.1
-cp -p man/pyreverse.1 $RPM_BUILD_ROOT%{_mandir}/man1/py3reverse.1
-%endif
-
 %if %{with python2}
 %py_install
 %py_postclean
-cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
+
+for tool in epylint pylint pyreverse symilar ; do
+	%{__mv} $RPM_BUILD_ROOT%{_bindir}/${tool} $RPM_BUILD_ROOT%{_bindir}/${tool}-2
+	cp -p man/${tool}.1 $RPM_BUILD_ROOT%{_mandir}/man1/${tool}-2.1
+done
+
+cp -p examples/pylintrc $RPM_BUILD_ROOT%{_sysconfdir}/pylintrc-2
 %endif
 
-cp -p examples/pylintrc $RPM_BUILD_ROOT%{_sysconfdir}/pylintrc
+%if %{with python3}
+%py3_install
+
+for tool in epylint pylint pyreverse symilar ; do
+	%{__mv} $RPM_BUILD_ROOT%{_bindir}/${tool} $RPM_BUILD_ROOT%{_bindir}/${tool}-3
+	cp -p man/${tool}.1 $RPM_BUILD_ROOT%{_mandir}/man1/${tool}-3.1
+done
+# old PLD package compatibility
+ln -s epylint-3 $RPM_BUILD_ROOT%{_bindir}/epy3lint
+ln -s pylint-3 $RPM_BUILD_ROOT%{_bindir}/py3lint
+ln -s pyreverse-3 $RPM_BUILD_ROOT%{_bindir}/py3reverse
+echo '.so epylint-3.1' >$RPM_BUILD_ROOT%{_mandir}/man1/epy3lint.1
+echo '.so pylint-3.1' >$RPM_BUILD_ROOT%{_mandir}/man1/py3lint.1
+echo '.so pyreverse-3.1' >$RPM_BUILD_ROOT%{_mandir}/man1/py3reverse.1
+
+cp -p examples/pylintrc $RPM_BUILD_ROOT%{_sysconfdir}/pylintrc-3
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -162,37 +183,51 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python2}
 %files
 %defattr(644,root,root,755)
-%doc ChangeLog README.rst examples/* doc/_build/text/*.txt
-%attr(755,root,root) %{_bindir}/epylint
-%attr(755,root,root) %{_bindir}/pylint
-%attr(755,root,root) %{_bindir}/pyreverse
-%attr(755,root,root) %{_bindir}/symilar
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pylintrc
-%{_mandir}/man1/epylint.1*
-%{_mandir}/man1/pylint.1*
-%{_mandir}/man1/pyreverse.1*
-%{_mandir}/man1/symilar.1*
-
-%files -n python-pylint
-%defattr(644,root,root,755)
+%doc ChangeLog README.rst examples
 %{py_sitescriptdir}/pylint
 %{py_sitescriptdir}/pylint-%{version}-py*.egg-info
+
+%files -n py2lint
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/epylint-2
+%attr(755,root,root) %{_bindir}/pylint-2
+%attr(755,root,root) %{_bindir}/pyreverse-2
+%attr(755,root,root) %{_bindir}/symilar-2
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pylintrc-2
+%{_mandir}/man1/epylint-2.1*
+%{_mandir}/man1/pylint-2.1*
+%{_mandir}/man1/pyreverse-2.1*
+%{_mandir}/man1/symilar-2.1*
 %endif
 
 %if %{with python3}
+%files -n python3-pylint
+%defattr(644,root,root,755)
+%doc ChangeLog README.rst examples
+%{py3_sitescriptdir}/pylint
+%{py3_sitescriptdir}/pylint-%{version}-py*.egg-info
+
 %files -n py3lint
 %defattr(644,root,root,755)
-%doc ChangeLog README.rst examples/* doc/_build/text/*.txt
+%attr(755,root,root) %{_bindir}/epylint-3
+%attr(755,root,root) %{_bindir}/pylint-3
+%attr(755,root,root) %{_bindir}/pyreverse-3
+%attr(755,root,root) %{_bindir}/symilar-3
 %attr(755,root,root) %{_bindir}/epy3lint
 %attr(755,root,root) %{_bindir}/py3lint
 %attr(755,root,root) %{_bindir}/py3reverse
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pylintrc
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pylintrc-3
+%{_mandir}/man1/epylint-3.1*
+%{_mandir}/man1/pylint-3.1*
+%{_mandir}/man1/pyreverse-3.1*
+%{_mandir}/man1/symilar-3.1*
 %{_mandir}/man1/epy3lint.1*
 %{_mandir}/man1/py3lint.1*
 %{_mandir}/man1/py3reverse.1*
+%endif
 
-%files -n python3-pylint
+%if %{with doc}
+%files doc
 %defattr(644,root,root,755)
-%{py3_sitescriptdir}/pylint
-%{py3_sitescriptdir}/pylint-%{version}-py*.egg-info
+%doc doc/_build/text/*
 %endif
diff --git a/python-pylint-rc.patch b/python-pylint-rc.patch
new file mode 100644
index 0000000..aab346d
--- /dev/null
+++ b/python-pylint-rc.patch
@@ -0,0 +1,13 @@
+--- pylint-pylint-1.9.5/pylint/config.py.orig	2019-11-14 17:56:16.034739613 +0100
++++ pylint-pylint-1.9.5/pylint/config.py	2019-11-14 17:57:40.504282002 +0100
+@@ -122,7 +122,9 @@
+             if not os.path.isfile(pylintrc):
+                 pylintrc = os.path.join(user_home, '.config', 'pylintrc')
+     if not os.path.isfile(pylintrc):
+-        if os.path.isfile('/etc/pylintrc'):
++        if os.path.isfile("/etc/pylintrc-%s" % sys.version[0]):
++            pylintrc = "/etc/pylintrc-%s" % sys.version[0]
++        elif os.path.isfile("/etc/pylintrc"):
+             pylintrc = '/etc/pylintrc'
+         else:
+             pylintrc = None
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-pylint.git/commitdiff/e541e8cd2ab979e4f7d92ffcfac175dd49a3cd8f



More information about the pld-cvs-commit mailing list