LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File python3-pylint.spec of Package python3-pylint (Project devel:languages:python3)

# spec file for package python3-pylint
# Copyright (c) 2012 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:           python3-%{modname}
Version:        0.25.1
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/
Source:         http://download.logilab.org/pub/%{modname}/%{modname}-%{version}.tar.gz
BuildRequires:  python3
BuildRequires:  python3-2to3
BuildRequires:  python3-devel
Requires:       python3-logilab-astng >= 0.21.1
Requires:       python3-logilab-common >= 0.55
Provides:       pylint = %{version}
Obsoletes:      pylint < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} <= 1140
%{!?python3_sitelib: %global python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?py3_ver: %global py3_ver %(python3 -c "import sys; version=str(sys.version_info[0]) + '.' + str(sys.version_info[1]); print(version)" 2>/dev/null || echo PYTHON-NOT-FOUND)}
%ifarch x86_64
# to allow ownership of noarch python directories
BuildRequires:  python3-32bit
BuildArch:      noarch
Requires:       python3 >= %{py3_ver}

Pylint analyzes Python source code looking for bugs and signs of poor

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

%setup -q -n %{modname}-%{version}

python3 setup.py build

# build failes without --no-compile
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} --no-compile
for f in %{buildroot}%{_bindir}/*; do mv $f $f-python%{py3_ver}; done
# fix non-executable rpmlint warning
chmod +x %{buildroot}%{python3_sitelib}/%{modname}/epylint.py

rm -rf %{buildroot}

%doc README ChangeLog examples/ doc/
%if 0%{?suse_version} <= 1140
%dir %{python3_sitelib}