From ec3e15bc42eecef09908cd14990d970b1222a51237a846941de3f7bc350e3b33 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 19 Apr 2021 04:42:51 +0000 Subject: [PATCH] Accepting request 886264 from home:bnavigator:branches:devel:languages:python:pytest - Update to 3.7.0 * Drop dependency on backports.entry-points-selectable by depending on importlib-metadata version 3.6.0+. - Release 3.6.0 * Fix deprecation warning from importlib-metadata 3.9.0+. * Stop distributing tests to reduce package size. Tests are not intended to be run outside of the tox setup in the repository. Repackagers can use GitHub's tarballs per tag. * Drop Python 3.5 support. - Release 3.5.0 * Support Python 3.9. * Move license from BSD to MIT License - Drop pytest6.patch merged upstream - Don't try test with non-existent python36-numpy OBS-URL: https://build.opensuse.org/request/show/886264 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-randomly?expand=0&rev=22 --- 3.4.1.tar.gz | 3 -- pytest-randomly-3.7.0.tar.gz | 3 ++ pytest6.patch | 71 ---------------------------------- python-pytest-randomly.changes | 18 +++++++++ python-pytest-randomly.spec | 30 +++++++------- 5 files changed, 36 insertions(+), 89 deletions(-) delete mode 100644 3.4.1.tar.gz create mode 100644 pytest-randomly-3.7.0.tar.gz delete mode 100644 pytest6.patch diff --git a/3.4.1.tar.gz b/3.4.1.tar.gz deleted file mode 100644 index 062aa45..0000000 --- a/3.4.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6760ded053c4b7457a2d49e10cb63b3ff45624a2d7fed4a832c86efe2ac5f3aa -size 32468 diff --git a/pytest-randomly-3.7.0.tar.gz b/pytest-randomly-3.7.0.tar.gz new file mode 100644 index 0000000..bedf708 --- /dev/null +++ b/pytest-randomly-3.7.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:475cfbbfe6bbdc06f629f72b2d4a4f1ac6e9761f839be0fa1f50fde397434ebe +size 26200 diff --git a/pytest6.patch b/pytest6.patch deleted file mode 100644 index f57ba3c..0000000 --- a/pytest6.patch +++ /dev/null @@ -1,71 +0,0 @@ -From c89ba6bb4458704f47e08d3f2fcc7cf0ebb8f9da Mon Sep 17 00:00:00 2001 -From: Adam Johnson -Date: Mon, 27 Jul 2020 12:06:57 +0100 -Subject: [PATCH] Fix deprecation warnings in tests (#281) - ---- - tests/test_pytest_randomly.py | 20 +++++++++++++------- - tox.ini | 2 +- - 2 files changed, 14 insertions(+), 8 deletions(-) - -diff --git a/tests/test_pytest_randomly.py b/tests/test_pytest_randomly.py -index 817d6ad..07cb646 100644 ---- a/tests/test_pytest_randomly.py -+++ b/tests/test_pytest_randomly.py -@@ -121,7 +121,7 @@ def test_a(): - out.stderr.fnmatch_lines( - [ - ( -- "pytest: error: argument --randomly-seed: 'invalidvalue' " -+ "*: error: argument --randomly-seed: 'invalidvalue' " - + "is not an integer or the string 'last'" - ) - ] -@@ -439,8 +439,8 @@ def collect(self): - - - class NoOpItem(pytest.Item): -- def __init__(self, path, parent, module=None): -- super(NoOpItem, self).__init__(path, parent) -+ def __init__(self, name, parent, module=None): -+ super(NoOpItem, self).__init__(name=name, parent=parent) - if module is not None: - self.module = module - -@@ -451,13 +451,19 @@ def runtest(self): - def pytest_collect_file(path, parent): - if not str(path).endswith('.py'): - return -- return MyCollector( -+ return MyCollector.from_parent( -+ parent=parent, - fspath=str(path), - items=[ -- NoOpItem(str(path), parent, 'foo'), -- NoOpItem(str(path), parent), -+ NoOpItem.from_parent( -+ name=str(path) + "1", -+ parent=parent, module="foo" -+ ), -+ NoOpItem.from_parent( -+ name=str(path) + "2", -+ parent=parent, -+ ), - ], -- parent=parent, - ) - """ - ) -diff --git a/tox.ini b/tox.ini -index 1dcee71..91722a8 100644 ---- a/tox.ini -+++ b/tox.ini -@@ -13,7 +13,7 @@ python = - 3.9: py39 - - [testenv] --commands = pytest -p no:randomly {posargs} -+commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning -m pytest -p no:randomly {posargs} - - [testenv:py35] - deps = -rrequirements/py35.txt diff --git a/python-pytest-randomly.changes b/python-pytest-randomly.changes index c7e53b5..e46dcdc 100644 --- a/python-pytest-randomly.changes +++ b/python-pytest-randomly.changes @@ -1,3 +1,21 @@ +------------------------------------------------------------------- +Sat Apr 17 10:11:21 UTC 2021 - Ben Greiner + +- Update to 3.7.0 + * Drop dependency on backports.entry-points-selectable by + depending on importlib-metadata version 3.6.0+. +- Release 3.6.0 + * Fix deprecation warning from importlib-metadata 3.9.0+. + * Stop distributing tests to reduce package size. Tests are not + intended to be run outside of the tox setup in the repository. + Repackagers can use GitHub's tarballs per tag. + * Drop Python 3.5 support. +- Release 3.5.0 + * Support Python 3.9. + * Move license from BSD to MIT License +- Drop pytest6.patch merged upstream +- Don't try test with non-existent python36-numpy + ------------------------------------------------------------------- Tue Aug 25 08:27:52 UTC 2020 - Marketa Calabkova diff --git a/python-pytest-randomly.spec b/python-pytest-randomly.spec index 3d7d66d..9c4eac8 100644 --- a/python-pytest-randomly.spec +++ b/python-pytest-randomly.spec @@ -1,7 +1,7 @@ # # spec file for package python-pytest-randomly # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,21 +16,19 @@ # +%{?!python_module:%define python_module() python3-%{**}} %define skip_python2 1 -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pytest-randomly -Version: 3.4.1 +Version: 3.7.0 Release: 0 Summary: Pytest plugin to randomly order tests and control random.seed -License: BSD-3-Clause +License: MIT URL: https://github.com/pytest-dev/pytest-randomly -Source: https://github.com/pytest-dev/pytest-randomly/archive/%{version}.tar.gz -#PATCH-FIX-UPSTREAM https://github.com/pytest-dev/pytest-randomly/commit/c89ba6bb4458704f47e08d3f2fcc7cf0ebb8f9da Fix deprecation warnings in tests (#281) -Patch0: pytest6.patch +Source: https://github.com/pytest-dev/pytest-randomly/archive/%{version}.tar.gz#/pytest-randomly-%{version}.tar.gz BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-importlib-metadata +Requires: python-importlib-metadata >= 3.6.0 Requires: python-pytest Recommends: python-Faker >= 4.1.0 Suggests: python-numpy @@ -38,10 +36,10 @@ BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module Faker >= 4.1.0} BuildRequires: %{python_module factory_boy} -BuildRequires: %{python_module importlib-metadata} -BuildRequires: %{python_module numpy} +BuildRequires: %{python_module importlib-metadata >= 3.6.0} BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module pytest} +BuildRequires: %{python_module numpy if (%python-base without python36-base)} # /SECTION %python_subpackages @@ -67,9 +65,6 @@ Features: %prep %setup -q -n pytest-randomly-%{version} -%patch0 -p1 -# Disregard Python 3.4+ restriction -sed -i '/python_requires/d' setup.py %build %python_build @@ -80,11 +75,16 @@ sed -i '/python_requires/d' setup.py %check # test_entrypoint_injection needs installed module for pytest to use -%pytest -k 'not test_entrypoint_injection' +donttest="test_entrypoint_injection" +# no python36-numpy +python36_donttest="or test_numpy" +%pytest -k "not ($donttest ${$python_donttest})" %files %{python_files} %doc README.rst %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/pytest_randomly.py* +%pycache_only %{python_sitelib}/__pycache__/pytest_randomly*.pyc +%{python_sitelib}/pytest_randomly-%{version}*-info %changelog