Accepting request 880417 from home:bnavigator:branches:devel:languages:python

- Update to 6.8.1
  * Full changelog since 5.41.2:
    https://hypothesis.readthedocs.io/en/latest/changes.html
- Changes in major version 6:
  * Many functions now use PEP 3102 keyword-only arguments where
    passing positional arguments was deprecated since 5.5.
  * hypothesis.extra.django.from_model() no longer accepts model
    as a keyword argument, where it could conflict with fields
    named “model”.
  * randoms() now defaults to use_true_random=False.
  * complex_numbers() no longer accepts min_magnitude=None; either
    use min_magnitude=0 or just omit the argument.
  * hypothesis.provisional.ip4_addr_strings and ip6_addr_strings
    are removed in favor of ip_addresses(v=...).map(str).
  * register_type_strategy() no longer accepts generic types with
    type arguments, which were always pretty badly broken.
  * Using function-scoped pytest fixtures is now a health-check
    error, instead of a warning.
- Don't test numpy and pandas for python36 (NEP29)
  * add distro specific importorskip-numpy-pandas.patch

OBS-URL: https://build.opensuse.org/request/show/880417
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=140
This commit is contained in:
Matej Cepl 2021-03-25 07:53:05 +00:00 committed by Git OBS Bridge
parent 92dd3f33b7
commit 9c901a6b73
7 changed files with 119 additions and 20 deletions

View File

@ -3,9 +3,9 @@
<service name="obs_scm" mode="disabled">
<param name="url">https://github.com/HypothesisWorks/hypothesis.git</param>
<param name="scm">git</param>
<param name="revision">hypothesis-python-5.41.2</param>
<param name="revision">hypothesis-python-6.8.1</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">hypothesispython(.*)</param>
<param name="versionrewrite-pattern">hypothesis-python-(.*)</param>
<param name="subdir">hypothesis-python</param>
<param name="filename">hypothesis-python</param>
</service>

View File

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

View File

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

View File

@ -1,5 +1,5 @@
name: hypothesis-python
version: 5.41.2
mtime: 1604845701
commit: 6a668da91a3b2b8b42c76496589392feea58645a
version: 6.8.1
mtime: 1615687564
commit: 6fa16a4b47012e6be277926d6cbfeec549609955

View File

@ -0,0 +1,45 @@
diff --git a/hypothesis-python/tests/conjecture/test_utils.py b/hypothesis-python/tests/conjecture/test_utils.py
index fbb837d69..e31868140 100644
--- a/hypothesis-python/tests/conjecture/test_utils.py
+++ b/hypothesis-python/tests/conjecture/test_utils.py
@@ -16,7 +16,6 @@
from collections import Counter
from fractions import Fraction
-import numpy as np
import pytest
from hypothesis import (
@@ -218,11 +217,13 @@ def test_combine_labels_is_distinct():
def test_invalid_numpy_sample():
+ np = pytest.importorskip("numpy")
with pytest.raises(InvalidArgument):
cu.check_sample(np.array([[1, 1], [1, 1]]), "array")
def test_valid_numpy_sample():
+ np = pytest.importorskip("numpy")
cu.check_sample(np.array([1, 2, 3]), "array")
diff --git a/hypothesis-python/tests/ghostwriter/test_expected_output.py b/hypothesis-python/tests/ghostwriter/test_expected_output.py
index 6cc9294e3..1e77c539a 100644
--- a/hypothesis-python/tests/ghostwriter/test_expected_output.py
+++ b/hypothesis-python/tests/ghostwriter/test_expected_output.py
@@ -27,13 +27,13 @@ import re
import sys
from typing import Sequence
-import numpy
import pytest
import hypothesis
from hypothesis.extra import ghostwriter
from hypothesis.utils.conventions import not_set
+numpy = pytest.importorskip("numpy")
@pytest.fixture
def update_recorded_outputs(request):

View File

@ -1,3 +1,27 @@
-------------------------------------------------------------------
Sat Mar 20 22:28:47 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Update to 6.8.1
* Full changelog since 5.41.2:
https://hypothesis.readthedocs.io/en/latest/changes.html
- Changes in major version 6:
* Many functions now use PEP 3102 keyword-only arguments where
passing positional arguments was deprecated since 5.5.
* hypothesis.extra.django.from_model() no longer accepts model
as a keyword argument, where it could conflict with fields
named “model”.
* randoms() now defaults to use_true_random=False.
* complex_numbers() no longer accepts min_magnitude=None; either
use min_magnitude=0 or just omit the argument.
* hypothesis.provisional.ip4_addr_strings and ip6_addr_strings
are removed in favor of ip_addresses(v=...).map(str).
* register_type_strategy() no longer accepts generic types with
type arguments, which were always pretty badly broken.
* Using function-scoped pytest fixtures is now a health-check
error, instead of a warning.
- Don't test numpy and pandas for python36 (NEP29)
* add distro specific importorskip-numpy-pandas.patch
-------------------------------------------------------------------
Tue Nov 17 18:22:29 UTC 2020 - Teemu Mannermaa <wicked@iki.fi>

View File

@ -1,7 +1,7 @@
#
# spec file for package python-hypothesis
# spec file for package python-hypothesis-test
#
# 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
@ -33,14 +33,17 @@ ExclusiveArch: do_not_build
%bcond_with test
%endif
Name: python-hypothesis%{psuffix}
Version: 5.41.2
Version: 6.8.1
Release: 0
Summary: A library for property based testing
License: MPL-2.0
URL: https://github.com/HypothesisWorks/hypothesis
# Source is the `hypothesis-python` subdir of the Github repository.
# Edit the `_service` file and run `osc service runall` for updates.
# See also https://hypothesis.readthedocs.io/en/latest/packaging.html
Source: hypothesis-python-%{version}
# PATCH-FIX-OPENSUSE dont import numpy and pandas and skip tests if these optional packages are not available.
Patch0: importorskip-numpy-pandas.patch
%if 0%{?suse_version} >= 1500
BuildRequires: %{pythons >= 3.5.2}
%else
@ -52,12 +55,13 @@ BuildRequires: python-rpm-macros
Requires: python-attrs >= 19.2.0
Requires: python-sortedcontainers >= 2.1.0
Requires(post): update-alternatives
Requires(preun): update-alternatives
Requires(preun):update-alternatives
Recommends: python-Django >= 2.2
Recommends: python-dpcontracts >= 0.4
Recommends: python-lark-parser >= 0.6.5
Recommends: python-libcst >= 0.3.16
Recommends: python-numpy >= 1.9.0
Recommends: python-pandas >= 0.19
Recommends: python-pandas >= 0.25
Recommends: python-pytest >= 4.3
Recommends: python-python-dateutil >= 1.4
Recommends: python-pytz >= 2014.1
@ -68,19 +72,21 @@ BuildArch: noarch
BuildRequires: %{python_module Django >= 2.2}
BuildRequires: %{python_module attrs >= 19.2.0}
BuildRequires: %{python_module black}
BuildRequires: %{python_module dpcontracts >= 0.6.0}
BuildRequires: %{python_module dpcontracts >= 0.4}
BuildRequires: %{python_module fakeredis}
BuildRequires: %{python_module flaky}
BuildRequires: %{python_module hypothesis = %{version}}
BuildRequires: %{python_module importlib_resources >= 3.3.0 if %python-base < 3.7}
BuildRequires: %{python_module lark-parser >= 0.6.5}
BuildRequires: %{python_module numpy >= 1.9.0}
BuildRequires: %{python_module pandas >= 0.19}
BuildRequires: %{python_module libcst >= 0.3.16}
BuildRequires: %{python_module pexpect}
BuildRequires: %{python_module pytest >= 4.3}
BuildRequires: %{python_module pytest >= 4.6}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module python-dateutil >= 1.4}
BuildRequires: %{python_module sortedcontainers >= 2.1.0}
BuildRequires: %{python_module typing_extensions}
BuildRequires: %{python_module numpy >= 1.9.0 if (%python-base without python36-base)}
BuildRequires: %{python_module pandas >= 0.25 if (%python-base without python36-base)}
%endif
# /SECTION
%python_subpackages
@ -100,6 +106,7 @@ work on Jython or on Python 3.0 through 3.2.
%setup -q -n %{_sourcedir}/hypothesis-python-%{version} -T -D
# gh#HypothesisWorks/hypothesis#2447: make sure arr==0.0 is an array on 32-bit
sed -i 's/assert (arr == 0.0)/assert np.asarray(arr == 0.0)/' tests/numpy/test_gen_data.py
%patch0 -p2
%build
%if !%{with test}
@ -124,9 +131,32 @@ sed -i 's/assert (arr == 0.0)/assert np.asarray(arr == 0.0)/' tests/numpy/test_g
%if %{with test}
# theses tests try to write into global python_sitelib
# https://github.com/HypothesisWorks/hypothesis/issues/2546
skiptests="test_updating_the_file_include_new_shrinkers"
skiptests+=" or test_can_learn_to_normalize_the_unnormalized"
%pytest tests -n auto -p pytester --runpytest=subprocess -k "not ($skiptests)"
donttest="test_updating_the_file_include_new_shrinkers"
donttest+=" or test_can_learn_to_normalize_the_unnormalized"
# extraneous encoding
python36_donttest+=" or (test_cli_python_equivalence and json)"
# typing_extension problem on python36 and Leap 15's python3
python36_donttest+=" or test_mutually_recursive_types_with_typevar"
python3_donttest+=" or test_mutually_recursive_types_with_typevar"
# requires backports.zoneinfo for python < 3.9
python36_ignoretests=" --ignore tests/datetime/test_zoneinfo_timezones.py"
python38_ignoretests=" --ignore tests/datetime/test_zoneinfo_timezones.py"
python3_ignoretests=" --ignore tests/datetime/test_zoneinfo_timezones.py"
# not available for python36
python36_ignoretests+=" --ignore tests/numpy --ignore tests/pandas"
# adapted from pytest.ini in github repo toplevel dir (above hypothesis-python)
echo '[pytest]
addopts=
--strict-markers
--tb=native
-p pytester --runpytest=subprocess
-v
-n auto
-ra
filterwarnings =
ignore::hypothesis.errors.NonInteractiveExampleWarning
' > pytest.ini
%pytest -c pytest.ini -k "not ($donttest ${$python_donttest})" ${$python_ignoretests} tests
%endif
%if !%{with test}