14
0
forked from pool/python-pylama

- Update to version 7.6.6:

* various async and tests fixes
  * no actual upstream changelog updated since 7.4 release
- Actually run tests

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylama?expand=0&rev=5
This commit is contained in:
Tomáš Chvátal
2019-02-18 11:03:15 +00:00
committed by Git OBS Bridge
parent ff363883ba
commit 02dab468c4
5 changed files with 162 additions and 33 deletions

127
dummy.py Normal file
View File

@@ -0,0 +1,127 @@
#!/usr/bin/env python
# coding: utf-8
# (c) 2005 Divmod, Inc. See LICENSE file for details
# commented code
#import os
# from foo import junk
# a = 3
a = 4
#foo(1, 2, 3)
class Message(object):
message = ''
message_args = ()
def __init__(self, filename, loc, use_column=True):
self.filename = filename
self.lineno = loc.lineno
self.col = getattr(loc, 'col_offset', None) if use_column else None
test = 1
if test == 1:
if test == 1:
return 28
elif test == 2:
return 28
return 28
elif test == 2:
return 28
def __str__(self):
return '%s:%s: %s' % (self.filename, self.lineno, self.message % self.message_args)
class UnusedImport(Message):
message = 'W402 %r imported but unused'
def __init__(self, filename, lineno, name):
Message.__init__(self, filename, lineno)
self.message_args = (name,)
class RedefinedWhileUnused(Message):
message = 'W801 redefinition of unused %r from line %r'
def __init__(self, filename, lineno, name, orig_lineno):
Message.__init__(self, filename, lineno)
self.message_args = (name, orig_lineno)
class ImportShadowedByLoopVar(Message):
message = 'W403 import %r from line %r shadowed by loop variable'
def __init__(self, filename, lineno, name, orig_lineno):
Message.__init__(self, filename, lineno)
self.message_args = (name, orig_lineno)
class ImportStarUsed(Message):
message = "W404 'from %s import *' used; unable to detect undefined names"
def __init__(self, filename, lineno, modname):
Message.__init__(self, filename, lineno)
self.message_args = (modname,)
class UndefinedName(Message):
message = 'W802 undefined name %r'
def __init__(self, filename, lineno, name):
Message.__init__(self, filename, lineno)
self.message_args = (name,)
class UndefinedExport(Message):
message = 'W803 undefined name %r in __all__'
def __init__(self, filename, lineno, name):
Message.__init__(self, filename, lineno)
self.message_args = (name,)
class UndefinedLocal(Message):
message = "W804 local variable %r (defined in enclosing scope on line " \
"%r) referenced before assignment"
def __init__(self, filename, lineno, name, orig_lineno):
Message.__init__(self, filename, lineno)
self.message_args = (name, orig_lineno)
class DuplicateArgument(Message):
message = 'W805 duplicate argument %r in function definition'
def __init__(self, filename, lineno, name):
Message.__init__(self, filename, lineno)
self.message_args = (name,)
class RedefinedFunction(Message):
message = 'W806 redefinition of function %r from line %r'
def __init__(self, filename, lineno, name, orig_lineno):
Message.__init__(self, filename, lineno)
self.message_args = (name, orig_lineno)
class LateFutureImport(Message):
message = 'W405 future import(s) %r after other statements'
def __init__(self, filename, lineno, names):
Message.__init__(self, filename, lineno)
self.message_args = (names,)
class UnusedVariable(Message):
"""
Indicates that a variable has been explicitly assigned to but not actually
used.
"""
message = 'W806 local variable %r is assigned to but never used'
def __init__(self, filename, lineno, names):
Message.__init__(self, filename, lineno)
self.message_args = (names,)
error = 1 # noQa and some comments

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:390c1dab1daebdf3d6acc923e551b035c3faa77d8b96b98530c230493f9ec712
size 28631

3
pylama-7.6.6.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f81bf3bbd15db802b620903df491e5cd6469dcd542424ce6718425037dcc4d10
size 32401

View File

@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon Feb 18 10:47:20 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to version 7.6.6:
* various async and tests fixes
* no actual upstream changelog updated since 7.4 release
- Actually run tests
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Dec 4 12:52:24 UTC 2018 - Matej Cepl <mcepl@suse.com> Tue Dec 4 12:52:24 UTC 2018 - Matej Cepl <mcepl@suse.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-pylama # spec file for package python-pylama
# #
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -17,53 +17,49 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_with test
Name: python-pylama Name: python-pylama
Version: 7.4.3 Version: 7.6.6
Release: 0 Release: 0
Summary: Code audit tool for python Summary: Code audit tool for python
License: LGPL-3.0-only License: LGPL-3.0-only
Group: Development/Languages/Python Group: Development/Languages/Python
Url: https://github.com/klen/pylama URL: https://github.com/klen/pylama
Source: https://files.pythonhosted.org/packages/source/p/pylama/pylama-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/p/pylama/pylama-%{version}.tar.gz
BuildRequires: %{python_module setuptools} Source1: https://raw.githubusercontent.com/klen/pylama/develop/dummy.py
BuildRequires: fdupes BuildRequires: %{python_module eradicate >= 0.2}
BuildRequires: python-rpm-macros
%if %{with test}
BuildRequires: %{python_module mccabe >= 0.5.2} BuildRequires: %{python_module mccabe >= 0.5.2}
BuildRequires: %{python_module pycodestyle >= 2.3.1} BuildRequires: %{python_module pycodestyle >= 2.3.1}
BuildRequires: %{python_module pydocstyle >= 2.0.0} BuildRequires: %{python_module pydocstyle >= 2.0.0}
BuildRequires: %{python_module pyflakes >= 1.5.0} BuildRequires: %{python_module pyflakes >= 1.5.0}
BuildRequires: %{python_module pylint}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
BuildRequires: %{python_module py} BuildRequires: %{python_module radon >= 1.4.2}
BuildRequires: %{python_module radon} BuildRequires: %{python_module setuptools}
BuildRequires: python-configparser BuildRequires: fdupes
%endif BuildRequires: git-core
Requires: python-py BuildRequires: python-rpm-macros
Requires: python-setuptools
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends: python-mccabe >= 0.5.2 Recommends: python-mccabe >= 0.5.2
Recommends: python-pycodestyle >= 2.3.1 Recommends: python-pycodestyle >= 2.3.1
Recommends: python-pydocstyle >= 2.0.0 Recommends: python-pydocstyle >= 2.0.0
Recommends: python-pyflakes >= 1.5.0 Recommends: python-pyflakes >= 1.5.0
Recommends: python-radon Recommends: python-pylint
%ifpython2 Recommends: python-radon >= 1.4.2
Requires: python-configparser
%endif
BuildArch: noarch BuildArch: noarch
Requires(post): update-alternatives
Requires(postun): update-alternatives
%python_subpackages %python_subpackages
%description %description
Code audit tool for Python and JavaScript. Pylama wraps these tools: Audit tool for Python and JavaScript. Pylama wraps these tools:
* PEP8
* PEP8_ © 2012-2013, Florent Xicluna; * PEP257
* PEP257_ © 2012, GreenSteam, <http://greensteam.dk/> * PyFlakes
* PyFlakes_ © 2005-2013, Kevin Watters; * Mccabe
* Mccabe_ © Ned Batchelder;
%prep %prep
%setup -q -n pylama-%{version} %setup -q -n pylama-%{version}
cp %{SOURCE1} .
%build %build
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
@@ -72,15 +68,14 @@ export LANG=en_US.UTF-8
%install %install
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
%python_install %python_install
%python_expand rm -rf %{buildroot}%{$python_sitelib}/tests
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/pylama %python_clone -a %{buildroot}%{_bindir}/pylama
%if %{with test}
%check %check
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
%python_expand py.test-%{$python_bin_suffix} pylama/pytest.py %python_expand py.test-%{$python_bin_suffix} -v tests/
%endif
%post %post
%python_install_alternative pylama %python_install_alternative pylama
@@ -89,7 +84,6 @@ export LANG=en_US.UTF-8
%python_uninstall_alternative pylama %python_uninstall_alternative pylama
%files %{python_files} %files %{python_files}
%defattr(-,root,root,-)
%doc AUTHORS Changelog README.rst %doc AUTHORS Changelog README.rst
%license LICENSE %license LICENSE
%python_alternative %{_bindir}/pylama %python_alternative %{_bindir}/pylama