14
0
forked from pool/python-pylint
Files
python-pylint/python-pylint.spec

126 lines
4.8 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-pylint
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define modname pylint
Name: python-%{modname}
Accepting request 244311 from home:Nijel:branches:devel:languages:python - Use zip from pypi as this now the only distribution channel - Add unzip to BuildRequires to above - Adjusted dependencies as pylint 1.3.0 needs atroid 1.2.0 or newer - Update to version 1.3.0 * Allow hanging continued indentation for implicitly concatenated strings. Closes issue #232. * PyLint works under Python 2.5 again, and its test suite passes. * Fix some false positives for the cellvar-from-loop warnings. Closes issue #233. * Return new astroid class nodes when the inferencer can detect that that result of a function invocation on a type (like `type` or `abc.ABCMeta`) is requested. Closes #205. * Emit 'undefined-variable' for undefined names when using the Python 3 `metaclass=` argument. * Checkers respect priority now. Close issue #229. * Fix a false positive regarding W0511. Closes issue #149. * Fix unused-import false positive with Python 3 metaclasses (#143). * Don't warn with 'bad-format-character' when encountering the 'a' format on Python 3. * Add multiple checks for PEP 3101 advanced string formatting: 'bad-format-string', 'missing-format-argument-key', 'unused-format-string-argument', 'format-combined-specification', 'missing-format-attribute' and 'invalid-format-index'. * Issue broad-except and bare-except even if the number of except handlers is different than 1. Fixes issue #113. * Issue attribute-defined-outside-init for all cases, not just for the last assignment. Closes issue #262. * Emit 'not-callable' when calling properties. Closes issue #268. * Fix a false positive with unbalanced iterable unpacking, when encountering starred nodes. Closes issue #273. * Add new checks, 'invalid-slice-index' and 'invalid-sequence-index' OBS-URL: https://build.opensuse.org/request/show/244311 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylint?expand=0&rev=56
2014-08-12 13:50:15 +00:00
Version: 1.3.0
Release: 0
Summary: Syntax and style checker for Python code
License: GPL-2.0+
Group: Development/Languages/Python
Url: http://www.logilab.org/projects/pylint/
Accepting request 244311 from home:Nijel:branches:devel:languages:python - Use zip from pypi as this now the only distribution channel - Add unzip to BuildRequires to above - Adjusted dependencies as pylint 1.3.0 needs atroid 1.2.0 or newer - Update to version 1.3.0 * Allow hanging continued indentation for implicitly concatenated strings. Closes issue #232. * PyLint works under Python 2.5 again, and its test suite passes. * Fix some false positives for the cellvar-from-loop warnings. Closes issue #233. * Return new astroid class nodes when the inferencer can detect that that result of a function invocation on a type (like `type` or `abc.ABCMeta`) is requested. Closes #205. * Emit 'undefined-variable' for undefined names when using the Python 3 `metaclass=` argument. * Checkers respect priority now. Close issue #229. * Fix a false positive regarding W0511. Closes issue #149. * Fix unused-import false positive with Python 3 metaclasses (#143). * Don't warn with 'bad-format-character' when encountering the 'a' format on Python 3. * Add multiple checks for PEP 3101 advanced string formatting: 'bad-format-string', 'missing-format-argument-key', 'unused-format-string-argument', 'format-combined-specification', 'missing-format-attribute' and 'invalid-format-index'. * Issue broad-except and bare-except even if the number of except handlers is different than 1. Fixes issue #113. * Issue attribute-defined-outside-init for all cases, not just for the last assignment. Closes issue #262. * Emit 'not-callable' when calling properties. Closes issue #268. * Fix a false positive with unbalanced iterable unpacking, when encountering starred nodes. Closes issue #273. * Add new checks, 'invalid-slice-index' and 'invalid-sequence-index' OBS-URL: https://build.opensuse.org/request/show/244311 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylint?expand=0&rev=56
2014-08-12 13:50:15 +00:00
Source: https://pypi.python.org/packages/source/p/pylint/pylint-%{version}.zip
BuildRequires: python-astroid >= 1.2.0
BuildRequires: python-devel
BuildRequires: python-logilab-common >= 0.55
BuildRequires: python-tk
Accepting request 244311 from home:Nijel:branches:devel:languages:python - Use zip from pypi as this now the only distribution channel - Add unzip to BuildRequires to above - Adjusted dependencies as pylint 1.3.0 needs atroid 1.2.0 or newer - Update to version 1.3.0 * Allow hanging continued indentation for implicitly concatenated strings. Closes issue #232. * PyLint works under Python 2.5 again, and its test suite passes. * Fix some false positives for the cellvar-from-loop warnings. Closes issue #233. * Return new astroid class nodes when the inferencer can detect that that result of a function invocation on a type (like `type` or `abc.ABCMeta`) is requested. Closes #205. * Emit 'undefined-variable' for undefined names when using the Python 3 `metaclass=` argument. * Checkers respect priority now. Close issue #229. * Fix a false positive regarding W0511. Closes issue #149. * Fix unused-import false positive with Python 3 metaclasses (#143). * Don't warn with 'bad-format-character' when encountering the 'a' format on Python 3. * Add multiple checks for PEP 3101 advanced string formatting: 'bad-format-string', 'missing-format-argument-key', 'unused-format-string-argument', 'format-combined-specification', 'missing-format-attribute' and 'invalid-format-index'. * Issue broad-except and bare-except even if the number of except handlers is different than 1. Fixes issue #113. * Issue attribute-defined-outside-init for all cases, not just for the last assignment. Closes issue #262. * Emit 'not-callable' when calling properties. Closes issue #268. * Fix a false positive with unbalanced iterable unpacking, when encountering starred nodes. Closes issue #273. * Add new checks, 'invalid-slice-index' and 'invalid-sequence-index' OBS-URL: https://build.opensuse.org/request/show/244311 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylint?expand=0&rev=56
2014-08-12 13:50:15 +00:00
BuildRequires: unzip
Requires: python-astroid >= 1.2.0
Requires: python-logilab-common >= 0.55
Requires: python-tk
Provides: pylint = %{version}
Obsoletes: pylint < %{version}
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%description
Pylint analyzes Python source code looking for bugs and signs of poor
quality.
Pylint is a python tool that checks if a module satisfies a coding
standard. Pylint can be seen as another PyChecker since nearly all
tests you can do with PyChecker can also be done with Pylint. But
Pylint offers some more features, like checking line-code's length,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented, and
much more (see the complete check list).
The big advantage with Pylint is that it is highly configurable,
customizable, and you can easily write a small plugin to add a personal
feature.
%prep
%setup -q -n %{modname}-%{version}
%build
python setup.py build
%install
#export PYTHONOPTIMIZE=1 #--optimize=1
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
# fix non-executable rpmlint warning
chmod +x %{buildroot}%{python_sitelib}/%{modname}/epylint.py
# update-alternatives
mv %{buildroot}%{_bindir}/pylint %{buildroot}%{_bindir}/pylint-%{py_ver}
mv %{buildroot}%{_bindir}/epylint %{buildroot}%{_bindir}/epylint-%{py_ver}
mv %{buildroot}%{_bindir}/pylint-gui %{buildroot}%{_bindir}/pylint-gui-%{py_ver}
mv %{buildroot}%{_bindir}/pyreverse %{buildroot}%{_bindir}/pyreverse-%{py_ver}
mv %{buildroot}%{_bindir}/symilar %{buildroot}%{_bindir}/symilar-%{py_ver}
ln -s %{_bindir}/pylint-%{py_ver} %{buildroot}%{_bindir}/pylint
ln -s %{_bindir}/epylint-%{py_ver} %{buildroot}%{_bindir}/epylint
ln -s %{_bindir}/pylint-gui-%{py_ver} %{buildroot}%{_bindir}/pylint-gui
ln -s %{_bindir}/pyreverse-%{py_ver} %{buildroot}%{_bindir}/pyreverse
ln -s %{_bindir}/symilar-%{py_ver} %{buildroot}%{_bindir}/symilar
%pre
# Since /usr/bin/pylint, etc. became ghosted to be used with update-alternatives, we have to get rid
# of the old binary resulting from the non-update-alternativies-ified package:
[[ ! -L %{_bindir}/pylint ]] && rm -f %{_bindir}/pylint
[[ ! -L %{_bindir}/epylint ]] && rm -f %{_bindir}/epylint
[[ ! -L %{_bindir}/pylint-gui ]] && rm -f %{_bindir}/pylint-gui
[[ ! -L %{_bindir}/pyreverse ]] && rm -f %{_bindir}/pyreverse
[[ ! -L %{_bindir}/symilar ]] && rm -f %{_bindir}/symilar
exit 0
%post
update-alternatives \
--install %{_bindir}/pylint pylint %{_bindir}/pylint-%{py_ver} 30 \
--slave %{_bindir}/epylint epylint %{_bindir}/epylint-%{py_ver} \
--slave %{_bindir}/pylint-gui pylint-gui %{_bindir}/pylint-gui-%{py_ver} \
--slave %{_bindir}/pyreverse pyreverse %{_bindir}/pyreverse-%{py_ver} \
--slave %{_bindir}/symilar symilar %{_bindir}/symilar-%{py_ver}
%preun
if [ $1 -eq 0 ] ; then
update-alternatives --remove pylint %{_bindir}/pylint-%{py_ver}
fi
%files
%defattr(-,root,root)
%doc ChangeLog COPYING README examples/
%{_bindir}/pylint-%{py_ver}
%{_bindir}/epylint-%{py_ver}
%{_bindir}/pylint-gui-%{py_ver}
%{_bindir}/pyreverse-%{py_ver}
%{_bindir}/symilar-%{py_ver}
%ghost %{_bindir}/pylint
%ghost %{_bindir}/epylint
%ghost %{_bindir}/pylint-gui
%ghost %{_bindir}/pyreverse
%ghost %{_bindir}/symilar
%{python_sitelib}/%{modname}/
%{python_sitelib}/%{modname}-%{version}-py%{py_ver}.egg-info
%changelog