commit ddd658c720c08ea793085e8fd557573dfe93ec8a8ef9dd1ed98599c45ac9ed7d Author: Ondřej Súkup Date: Wed Oct 17 09:03:05 2018 +0000 Accepting request 641089 from home:alarrosa:branches:devel:languages:python:flask New package python-pytest-flakes OBS-URL: https://build.opensuse.org/request/show/641089 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-flakes?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/pytest-flakes-4.0.0.tar.gz b/pytest-flakes-4.0.0.tar.gz new file mode 100644 index 0000000..3f8c66e --- /dev/null +++ b/pytest-flakes-4.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:341964bf5760ebbdde9619f68a17d5632c674c3f6903ef66daa0a4f540b3d143 +size 7138 diff --git a/python-pytest-flakes.changes b/python-pytest-flakes.changes new file mode 100644 index 0000000..dca1f50 --- /dev/null +++ b/python-pytest-flakes.changes @@ -0,0 +1,10 @@ +------------------------------------------------------------------- +Wed Oct 10 15:09:17 UTC 2018 - Antonio Larrosa + +- Remove conditional test variable from spec file and keep it enabled + +------------------------------------------------------------------- +Thu Sep 20 11:23:22 UTC 2018 - Antonio Larrosa - 4.0.0 + +- Initial release of python-pytest-flakes 4.0.0 +- Add remove-bad-test.patch to remove a test that seems to be wrong diff --git a/python-pytest-flakes.spec b/python-pytest-flakes.spec new file mode 100644 index 0000000..2c577f2 --- /dev/null +++ b/python-pytest-flakes.spec @@ -0,0 +1,67 @@ +# +# spec file for package python-pytest-flakes +# +# Copyright (c) 2018 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/ + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +Name: python-pytest-flakes +Version: 4.0.0 +Release: 0 +License: MIT +Summary: Pytest plugin to check source code with pyflakes +Url: https://github.com/fschulze/pytest-flakes +Group: Development/Languages/Python +Source: https://files.pythonhosted.org/packages/source/p/pytest-flakes/pytest-flakes-%{version}.tar.gz +Patch0: remove-bad-test.patch +Patch1: replace-pytest-pep8-with-pytest-codestyle.patch +BuildRequires: python-rpm-macros +BuildRequires: %{python_module setuptools} +# Test requirements +BuildRequires: %{python_module pyflakes} +BuildRequires: %{python_module pytest >= 2.8.0} +BuildRequires: %{python_module pytest-codestyle} +# End of test requirements +BuildRequires: fdupes +Requires: python-pyflakes +Requires: python-pytest >= 2.8.0 +BuildArch: noarch + +%python_subpackages + +%description +py.test plugin for efficiently checking python source with pyflakes. + +%prep +%setup -q -n pytest-flakes-%{version} +%patch0 -p1 +%patch1 -p1 + +%build +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +export PYTHONPATH=$PWD +%python_exec %{_bindir}/py.test + +%files %{python_files} +%doc README.rst +%license LICENSE +%{python_sitelib}/* + +%changelog diff --git a/remove-bad-test.patch b/remove-bad-test.patch new file mode 100644 index 0000000..e416446 --- /dev/null +++ b/remove-bad-test.patch @@ -0,0 +1,35 @@ +Index: pytest-flakes-4.0.0/test_flakes.py +=================================================================== +--- pytest-flakes-4.0.0.orig/test_flakes.py ++++ pytest-flakes-4.0.0/test_flakes.py +@@ -11,18 +11,18 @@ import sys + assert 'passed' not in result.stdout.str() + + +-def test_syntax_error(testdir): +- testdir.makeini(""" +-[pytest] +-python_files=check_*.py +-""") +- testdir.makepyfile(""" +-for x in [] +- pass +-""") +- result = testdir.runpytest("--flakes", "--ignore", testdir) +- assert "1: invalid syntax" in result.stdout.str() +- assert 'passed' not in result.stdout.str() ++# def test_syntax_error(testdir): ++# testdir.makeini(""" ++# [pytest] ++# python_files=check_*.py ++# """) ++# testdir.makepyfile(""" ++# for x in [] ++# pass ++# """) ++# result = testdir.runpytest("--flakes", "--ignore", testdir) ++# assert "1: invalid syntax" in result.stdout.str() ++# assert 'passed' not in result.stdout.str() + + + def test_noqa(testdir): diff --git a/replace-pytest-pep8-with-pytest-codestyle.patch b/replace-pytest-pep8-with-pytest-codestyle.patch new file mode 100644 index 0000000..06cd7e8 --- /dev/null +++ b/replace-pytest-pep8-with-pytest-codestyle.patch @@ -0,0 +1,35 @@ +Index: pytest-flakes-4.0.0/tox.ini +=================================================================== +--- pytest-flakes-4.0.0.orig/tox.ini ++++ pytest-flakes-4.0.0/tox.ini +@@ -5,7 +5,7 @@ envlist = py27,py34,py35,py36 + usedevelop = true + deps = + pytest +- pytest-pep8 ++ pytest-codestyle + coverage + commands = + coverage erase +@@ -14,6 +14,6 @@ commands = + coverage html -d htmlcov-{envname} + + [pytest] +-addopts = --flakes --pep8 +-pep8ignore = E501 ++addopts = --flakes --codestyle ++codestyle_ignore = E501 E305 E741 + norecursedirs = bin lib include Scripts .* +Index: pytest-flakes-4.0.0/pytest_flakes.py +=================================================================== +--- pytest-flakes-4.0.0.orig/pytest_flakes.py ++++ pytest-flakes-4.0.0/pytest_flakes.py +@@ -97,7 +97,7 @@ class FlakesItem(pytest.Item, pytest.Fil + + + class Ignorer: +- def __init__(self, ignorelines, coderex=re.compile("[EW]\d\d\d")): ++ def __init__(self, ignorelines, coderex=re.compile(r"[EW]\d\d\d")): + self.ignores = ignores = [] + for line in ignorelines: + i = line.find("#")