From 02dab468c4bf27401f1ffeb812d4b51155947f21860a1fbe963c138d2842ae74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 18 Feb 2019 11:03:15 +0000 Subject: [PATCH] - 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 --- dummy.py | 127 ++++++++++++++++++++++++++++++++++++++++++ pylama-7.4.3.tar.gz | 3 - pylama-7.6.6.tar.gz | 3 + python-pylama.changes | 8 +++ python-pylama.spec | 54 ++++++++---------- 5 files changed, 162 insertions(+), 33 deletions(-) create mode 100644 dummy.py delete mode 100644 pylama-7.4.3.tar.gz create mode 100644 pylama-7.6.6.tar.gz diff --git a/dummy.py b/dummy.py new file mode 100644 index 0000000..06306fd --- /dev/null +++ b/dummy.py @@ -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 diff --git a/pylama-7.4.3.tar.gz b/pylama-7.4.3.tar.gz deleted file mode 100644 index c5b8fa2..0000000 --- a/pylama-7.4.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:390c1dab1daebdf3d6acc923e551b035c3faa77d8b96b98530c230493f9ec712 -size 28631 diff --git a/pylama-7.6.6.tar.gz b/pylama-7.6.6.tar.gz new file mode 100644 index 0000000..8b5945f --- /dev/null +++ b/pylama-7.6.6.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f81bf3bbd15db802b620903df491e5cd6469dcd542424ce6718425037dcc4d10 +size 32401 diff --git a/python-pylama.changes b/python-pylama.changes index 13cea18..d5ae5a7 100644 --- a/python-pylama.changes +++ b/python-pylama.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Feb 18 10:47:20 UTC 2019 - Tomáš Chvátal + +- 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 diff --git a/python-pylama.spec b/python-pylama.spec index bdcaec6..7a942fa 100644 --- a/python-pylama.spec +++ b/python-pylama.spec @@ -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, -* 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