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

117 lines
4.0 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-pylint
#
# Copyright (c) 2016 SUSE LINUX 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/
#
Name: python-pylint
Version: 1.6.1
Release: 0
Summary: Syntax and style checker for Python code
License: GPL-2.0+
Group: Development/Languages/Python
Url: https://github.com/pycqa/pylint
Accepting request 264382 from home:Nijel:branches:devel:languages:python - Lower tk dependency to Recommends as it's only needed for optional GUI - Update to 1.4.0: * Added new options for controlling the loading of C extensions. By default, only C extensions from the stdlib will be loaded into the active Python interpreter for inspection, because they can run arbitrary code on import. The option `--extension-pkg-whitelist` can be used to specify modules or packages that are safe to load. * Change default max-line-length to 100 rather than 80 * Drop BaseRawChecker class which were only there for backward compat for a while now * Don't try to analyze string formatting with objects coming from function arguments. Closes issue #373. * Port source code to be Python 2/3 compatible. This drops the need for 2to3, but does drop support for Python 2.5. * Each message now comes with a confidence level attached, and can be filtered base on this level. This allows to filter out all messages that were emitted even though an inference failure happened during checking. * Improved presenting unused-import message. Closes issue #293. * Add new checker for finding spelling errors. New messages: wrong-spelling-in-comment, wrong-spelling-in-docstring. New options: spelling-dict, spelling-ignore-words. * Add new '-j' option for running checks in sub-processes. * Added new checks for line endings if they are mixed (LF vs CRLF) or if they are not as expected. New messages: mixed-line-endings, unexpected-line-ending-format. New option: expected-line-ending-format. * 'dangerous-default-value' no longer evaluates the value of the arguments, which could result in long error messages or sensitive data being leaked. OBS-URL: https://build.opensuse.org/request/show/264382 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylint?expand=0&rev=58
2014-12-08 10:30:09 +00:00
Source: https://pypi.python.org/packages/source/p/pylint/pylint-%{version}.tar.gz
BuildRequires: python-astroid
BuildRequires: python-six
BuildRequires: python-tk
Requires: python-astroid
Requires: python-six
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 pylint-%{version}
%build
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot} --no-compile
# fix non-executable rpmlint warning
chmod +x %{buildroot}%{python_sitelib}/pylint/epylint.py
# Prepare for update-alternatives usage
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
for p in pylint epylint pylint-gui pyreverse symilar ; do
mv %{buildroot}%{_bindir}/$p %{buildroot}%{_bindir}/$p-%{py_ver}
ln -s -f %{_sysconfdir}/alternatives/$p %{buildroot}%{_bindir}/$p
# create a dummy target for /etc/alternatives/$p
touch %{buildroot}%{_sysconfdir}/alternatives/$p
done
%post
%_sbindir/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}
%postun
if [ $1 -eq 0 ] ; then
%_sbindir/update-alternatives --remove pylint %{_bindir}/pylint-%{py_ver}
fi
%files
%defattr(-,root,root)
%doc ChangeLog COPYING README.rst
%doc examples/
%{_bindir}/pylint
%{_bindir}/epylint
%{_bindir}/pylint-gui
%{_bindir}/pyreverse
%{_bindir}/symilar
%{_bindir}/pylint-%{py_ver}
%{_bindir}/epylint-%{py_ver}
%{_bindir}/pylint-gui-%{py_ver}
%{_bindir}/pyreverse-%{py_ver}
%{_bindir}/symilar-%{py_ver}
%ghost %{_sysconfdir}/alternatives/pylint
%ghost %{_sysconfdir}/alternatives/epylint
%ghost %{_sysconfdir}/alternatives/pylint-gui
%ghost %{_sysconfdir}/alternatives/pyreverse
%ghost %{_sysconfdir}/alternatives/symilar
%{python_sitelib}/pylint/
%{python_sitelib}/pylint-%{version}-py*.egg-info
%changelog