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:
committed by
Git OBS Bridge
parent
ff363883ba
commit
02dab468c4
127
dummy.py
Normal file
127
dummy.py
Normal 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
|
@@ -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
3
pylama-7.6.6.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f81bf3bbd15db802b620903df491e5cd6469dcd542424ce6718425037dcc4d10
|
||||
size 32401
|
@@ -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>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# 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
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -17,53 +17,49 @@
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
%bcond_with test
|
||||
Name: python-pylama
|
||||
Version: 7.4.3
|
||||
Version: 7.6.6
|
||||
Release: 0
|
||||
Summary: Code audit tool for python
|
||||
License: LGPL-3.0-only
|
||||
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
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
%if %{with test}
|
||||
Source1: https://raw.githubusercontent.com/klen/pylama/develop/dummy.py
|
||||
BuildRequires: %{python_module eradicate >= 0.2}
|
||||
BuildRequires: %{python_module mccabe >= 0.5.2}
|
||||
BuildRequires: %{python_module pycodestyle >= 2.3.1}
|
||||
BuildRequires: %{python_module pydocstyle >= 2.0.0}
|
||||
BuildRequires: %{python_module pyflakes >= 1.5.0}
|
||||
BuildRequires: %{python_module pylint}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module py}
|
||||
BuildRequires: %{python_module radon}
|
||||
BuildRequires: python-configparser
|
||||
%endif
|
||||
Requires: python-py
|
||||
BuildRequires: %{python_module radon >= 1.4.2}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: git-core
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-setuptools
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
Recommends: python-mccabe >= 0.5.2
|
||||
Recommends: python-pycodestyle >= 2.3.1
|
||||
Recommends: python-pydocstyle >= 2.0.0
|
||||
Recommends: python-pyflakes >= 1.5.0
|
||||
Recommends: python-radon
|
||||
%ifpython2
|
||||
Requires: python-configparser
|
||||
%endif
|
||||
Recommends: python-pylint
|
||||
Recommends: python-radon >= 1.4.2
|
||||
BuildArch: noarch
|
||||
Requires(post): update-alternatives
|
||||
Requires(postun): update-alternatives
|
||||
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
Code audit tool for Python and JavaScript. Pylama wraps these tools:
|
||||
|
||||
* PEP8_ © 2012-2013, Florent Xicluna;
|
||||
* PEP257_ © 2012, GreenSteam, <http://greensteam.dk/>
|
||||
* PyFlakes_ © 2005-2013, Kevin Watters;
|
||||
* Mccabe_ © Ned Batchelder;
|
||||
Audit tool for Python and JavaScript. Pylama wraps these tools:
|
||||
* PEP8
|
||||
* PEP257
|
||||
* PyFlakes
|
||||
* Mccabe
|
||||
|
||||
%prep
|
||||
%setup -q -n pylama-%{version}
|
||||
cp %{SOURCE1} .
|
||||
|
||||
%build
|
||||
export LANG=en_US.UTF-8
|
||||
@@ -72,15 +68,14 @@ export LANG=en_US.UTF-8
|
||||
%install
|
||||
export LANG=en_US.UTF-8
|
||||
%python_install
|
||||
%python_expand rm -rf %{buildroot}%{$python_sitelib}/tests
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%python_clone -a %{buildroot}%{_bindir}/pylama
|
||||
|
||||
%if %{with test}
|
||||
%check
|
||||
export LANG=en_US.UTF-8
|
||||
%python_expand py.test-%{$python_bin_suffix} pylama/pytest.py
|
||||
%endif
|
||||
%python_expand py.test-%{$python_bin_suffix} -v tests/
|
||||
|
||||
%post
|
||||
%python_install_alternative pylama
|
||||
@@ -89,7 +84,6 @@ export LANG=en_US.UTF-8
|
||||
%python_uninstall_alternative pylama
|
||||
|
||||
%files %{python_files}
|
||||
%defattr(-,root,root,-)
|
||||
%doc AUTHORS Changelog README.rst
|
||||
%license LICENSE
|
||||
%python_alternative %{_bindir}/pylama
|
||||
|
Reference in New Issue
Block a user