Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hypothesis to 6.100.6 #7352

Closed
wants to merge 1 commit into from

Conversation

pyup-bot
Copy link
Collaborator

This PR updates hypothesis from 6.92.1 to 6.100.6.

Changelog

6.100.6

--------------------

This patch improves our internal caching logic. We don't expect it to result in any performance improvements (yet!).

6.100.5

--------------------

This patch turns off a check in :func:`~hypothesis.register_random` for possibly
unreferenced RNG instances on the free-threaded build of CPython 3.13 because
this check has a much higher false positive rate in the free-threaded build
(:issue:`3965`).

Thanks to Nathan Goldbaum for this patch.

6.100.4

--------------------

This patch turns off a warning for functions decorated with
:func:`typing.overload` and then :func:`~hypothesis.strategies.composite`,
although only in that order (:issue:`3970`).

6.100.3

--------------------

This patch fixes a significant slowdown when using the :func:`~hypothesis.stateful.precondition` decorator in some cases, due to expensive repr formatting internally (:issue:`3963`).

6.100.2

--------------------

Explicitly cast :obj:`numpy.finfo.smallest_normal` to builtin `float` in
preparation for the :pypi:`numpy==2.0 <numpy>` release (:issue:`3950`)

6.100.1

--------------------

This patch improve a rare error message for flaky tests (:issue:`3940`).

6.100.0

--------------------

The :func:`~hypothesis.extra.numpy.from_dtype` function no longer generates
``NaT`` ("not-a-time") values for the ``datetime64`` or ``timedelta64`` dtypes
if passed ``allow_nan=False`` (:issue:`3943`).

6.99.13

--------------------

This patch includes the :obj:`~hypothesis.settings.backend` setting in the
``how_generated`` field of our :doc:`observability output <observability>`.

6.99.12

--------------------

If you were running Python 3.13 (currently in alpha) with :pypi:`pytest-xdist`
and then attempted to pretty-print a ``lambda`` functions which was created
using the :func:`eval` builtin, it would have raised an AssertionError.
Now you'll get ``"lambda ...: <unknown>"``, as expected.

6.99.11

--------------------

This release improves an internal invariant.

6.99.10

--------------------

This patch fixes Hypothesis sometimes raising a ``Flaky`` error when generating collections of unique floats containing ``nan``. See :issue:`3926` for more details.

6.99.9

-------------------

This patch continues our work on refactoring the shrinker (:issue:`3921`).

6.99.8

-------------------

This patch continues our work on refactoring shrinker internals (:issue:`3921`).

6.99.7

-------------------

This release resolves :py:exc:`PermissionError` that come from
creating databases on inaccessible paths.

6.99.6

-------------------

This patch starts work on refactoring our shrinker internals. There is no user-visible change.

6.99.5

-------------------

This patch fixes a longstanding performance problem in stateful testing (:issue:`3618`),
where state machines which generated a substantial amount of input for each step would
hit the maximum amount of entropy and then fail with an ``Unsatisfiable`` error.

We now stop taking additional steps when we're approaching the entropy limit,
which neatly resolves the problem without touching unaffected tests.

6.99.4

-------------------

Fix regression caused by using :pep:`696` default in TypeVar with Python 3.13.0a3.

6.99.3

-------------------

This patch further improves the type annotations in :mod:`hypothesis.extra.numpy`.

6.99.2

-------------------

Simplify the type annotation of :func:`~hypothesis.extra.pandas.column` and
:func:`~hypothesis.extra.pandas.columns` by using :pep:`696` to avoid overloading.

6.99.1

-------------------

This patch implements type annotations for :func:`~hypothesis.extra.pandas.column`.

6.99.0

-------------------

This release adds the **experimental and unstable** :obj:`~hypothesis.settings.backend`
setting.  See :ref:`alternative-backends` for details.

6.98.18

--------------------

This patch fixes :issue:`3900`, a performance regression for
:func:`~hypothesis.extra.numpy.arrays` due to the interaction of
:ref:`v6.98.12` and :ref:`v6.97.1`.

6.98.17

--------------------

This patch improves the type annotations in :mod:`hypothesis.extra.numpy`,
which makes inferred types more precise for both :pypi:`mypy` and
:pypi:`pyright`, and fixes some strict-mode errors on the latter.

Thanks to Jonathan Plasse for reporting and fixing this in :pull:`3889`!

6.98.16

--------------------

This patch paves the way for future shrinker improvements. There is no user-visible change.

6.98.15

--------------------

This release adds support for the Array API's `2023.12 release
<https://data-apis.org/array-api/2023.12/>`_ via the ``api_version`` argument in
:func:`~hypothesis.extra.array_api.make_strategies_namespace`. The API additions
and modifications in the ``2023.12`` spec do not necessitate any changes in the
Hypothesis strategies, hence there is no distinction between a ``2022.12`` and
``2023.12`` strategies namespace.

6.98.14

--------------------

This patch adjusts the printing of bundle values to correspond
with their names when using stateful testing.

6.98.13

--------------------

This patch implements filter-rewriting for :func:`~hypothesis.strategies.text`
and :func:`~hypothesis.strategies.binary` with the :meth:`~re.Pattern.search`,
:meth:`~re.Pattern.match`, or :meth:`~re.Pattern.fullmatch` method of a
:func:`re.compile`\ d regex.

6.98.12

--------------------

This patch implements filter-rewriting for most length filters on some
additional collection types (:issue:`3795`), and fixes several latent
bugs where unsatisfiable or partially-infeasible rewrites could trigger
internal errors.

6.98.11

--------------------

This patch makes stateful testing somewhat less likely to get stuck
when there are only a few possible rules.

6.98.10

--------------------

This patch :pep:`adds a note <678>` to errors which occur while drawing from
a strategy, to make it easier to tell why your test failed in such cases.

6.98.9

-------------------

This patch ensures that :doc:`observability <observability>` outputs include
an informative repr for :class:`~hypothesis.stateful.RuleBasedStateMachine`
stateful tests, along with more detailed timing information.

6.98.8

-------------------

This patch improves :doc:`the Ghostwriter <ghostwriter>` for binary operators.

6.98.7

-------------------

This patch improves import-detection in :doc:`the Ghostwriter <ghostwriter>`
(:issue:`3884`), particularly for :func:`~hypothesis.strategies.from_type`
and strategies from ``hypothesis.extra.*``.

6.98.6

-------------------

This patch clarifies the documentation on stateful testing (:issue:`3511`).

6.98.5

-------------------

This patch improves argument-to-json conversion for :doc:`observability <observability>`
output.  Checking for a ``.to_json()`` method on the object *before* a few other
options like dataclass support allows better user control of the process (:issue:`3880`).

6.98.4

-------------------

This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.

6.98.3

-------------------

This patch fixes an error when generating :doc:`observability <observability>` reports involving large (``n > 1e308``) integers.

6.98.2

-------------------

This patch refactors some internals. There is no user-visible change.

6.98.1

-------------------

This release improves our distribution of generated values for all strategies, by doing a better job of tracking which values we have generated before and avoiding generating them again.

For example, ``st.lists(st.integers())`` previously generated ~5 each of ``[]`` ``[0]`` in 100 examples. In this release, each of ``[]`` and ``[0]`` are generated ~1-2 times each.

6.98.0

-------------------

This release deprecates use of the global random number generator while drawing
from a strategy, because this makes test cases less diverse and prevents us
from reporting minimal counterexamples (:issue:`3810`).

If you see this new warning, you can get a quick fix by using
:func:`~hypothesis.strategies.randoms`; or use more idiomatic strategies
:func:`~hypothesis.strategies.sampled_from`, :func:`~hypothesis.strategies.floats`,
:func:`~hypothesis.strategies.integers`, and so on.

Note that the same problem applies to e.g. ``numpy.random``, but
for performance reasons we only check the stdlib :mod:`random` module -
ignoring even other sources passed to :func:`~hypothesis.register_random`.

6.97.6

-------------------

This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.

6.97.5

-------------------

This patch adds some :doc:`observability information <observability>`
about how many times predicates in :func:`~hypothesis.assume` or
:func:`~hypothesis.stateful.precondition` were satisfied, so that
downstream tools can warn you if some were *never* satisfied by
any test case.

6.97.4

-------------------

This patch improves formatting and adds some cross-references to our docs.

6.97.3

-------------------

Internal test refactoring.

6.97.2

-------------------

This patch slightly changes how we replay examples from
:doc:`the database <database>`: if the behavior of the saved example has
changed, we now keep running the test case instead of aborting at the size
of the saved example.  While we know it's not the *same* example, we might
as well continue running the test!

Because we now finish running a few more examples for affected tests, this
might be a slight slowdown - but correspondingly more likely to find a bug.

We've also applied similar tricks to the :ref:`target phase <phases>`, where
they are a pure performance improvement for affected tests.

6.97.1

-------------------

Improves the performance of the :func:`~hypothesis.extra.numpy.arrays`
strategy when generating unique values.

6.97.0

-------------------

Changes the distribution of :func:`~hypothesis.strategies.sampled_from` when
sampling from a :class:`~python:enum.Flag`. Previously, no-flags-set values would
never be generated, and all-flags-set values would be unlikely for large enums.
With this change, the distribution is more uniform in the number of flags set.

6.96.4

-------------------

This patch slightly refactors some internals. There is no user-visible change.

6.96.3

-------------------

This patch fixes a spurious warning about slow imports when ``HYPOTHESIS_EXPERIMENTAL_OBSERVABILITY`` was set.

6.96.2

-------------------

This patch refactors some more internals, continuing our work on supporting alternative backends (:issue:`3086`). There is no user-visible change.

6.96.1

-------------------

Fix a spurious warning seen when running pytest's test
suite, caused by never realizing we got out of
initialization due to imbalanced hook calls.

6.96.0

-------------------

Warns when constructing a `repr` that is overly long. This can
happen by accident if stringifying arbitrary strategies, and
is expensive in time and memory. The associated deferring of
these long strings in :func:`~hypothesis.strategies.sampled_from`
should also lead to improved performance.

6.95.0

-------------------

This release adds the ability to pass any object to :func:`~hypothesis.note`, instead of just strings. The pretty-printed representation of the object will be used.

See also :issue:`3843`.

6.94.0

-------------------

This release avoids creating a ``.hypothesis`` directory when using
:func:`~hypothesis.strategies.register_type_strategy` (:issue:`3836`),
and adds warnings for plugins which do so by other means or have
other unintended side-effects.

6.93.2

-------------------

This patch improves :doc:`observability <observability>` reports by moving
timing information from ``metadata`` to a new ``timing`` key, and supporting
conversion of additional argument types to json rather than string reprs
via a ``.to_json()`` method (including e.g. Pandas dataframes).

Additionally, the :obj:`~hypothesis.HealthCheck.too_slow` health check will
now report *which* strategies were slow, e.g. for strategies a, b, c, ...::

     count | fraction |    slowest draws (seconds)
 a |    3  |     65%  |      --      --      --   0.357,  2.000
 b |    8  |     16%  |   0.100,  0.100,  0.100,  0.111,  0.123
 c |    3  |      8%  |      --      --   0.030,  0.050,  0.200
 (skipped 2 rows of fast draws)

6.93.1

-------------------

This patch refactors some internals, continuing our work on supporting alternative backends
(:issue:`3086`). There is no user-visible change.

6.93.0

-------------------

The :func:`~hypothesis.extra.lark.from_lark` strategy now accepts an ``alphabet=``
argument, which is passed through to :func:`~hypothesis.strategies.from_regex`,
so that you can e.g. constrain the generated strings to a particular codec.

In support of this feature, :func:`~hypothesis.strategies.from_regex` will avoid
generating optional parts which do not fit the alphabet.  For example,
``from_regex(r"abc|def", alphabet="abcd")`` was previously an error, and will now
generate only ``'abc'``.  Cases where there are no valid strings remain an error.

6.92.9

-------------------

This patch refactors some internals, continuing our work on supporting alternative backends (:issue:`3086`). There is no user-visible change.

6.92.8

-------------------

This patch adds a :ref:`test statistics <statistics>` event when a generated example is rejected via :func:`assume <hypothesis.assume>`.

This may also help with distinguishing ``gave_up`` examples in :doc:`observability <observability>` (:issue:`3827`).

6.92.7

-------------------

This introduces the rewriting of length filters on some collection strategies (:issue:`3791`).

Thanks to Reagan Lee for implementing this feature!

6.92.6

-------------------

If a test uses :func:`~hypothesis.strategies.sampled_from` on a sequence of
strategies, and raises a ``TypeError``, we now :pep:`add a note <678>` asking
whether you meant to use :func:`~hypothesis.strategies.one_of`.

Thanks to Vince Reuter for suggesting and implementing this hint!

6.92.5

-------------------

This patch registers explicit strategies for a handful of builtin types,
motivated by improved introspection in PyPy 7.3.14 triggering existing
internal warnings.
Thanks to Carl Friedrich Bolz-Tereick for helping us work out what changed!

6.92.4

-------------------

This patch fixes an error when writing :doc:`observability <observability>` reports without a pre-existing ``.hypothesis`` directory.

6.92.3

-------------------

This patch adds a new environment variable ``HYPOTHESIS_EXPERIMENTAL_OBSERVABILITY_NOCOVER``,
which turns on :doc:`observability <observability>` data collection without collecting
code coverage data, which may be faster on Python 3.11 and earlier.

Thanks to Harrison Goldstein for reporting and fixing :issue:`3821`.

6.92.2

-------------------

This patch updates our vendored `list of top-level domains <https://www.iana.org/domains/root/db>`__,
which is used by the provisional :func:`~hypothesis.provisional.domains` strategy.
Links

@pyup-bot
Copy link
Collaborator Author

Closing this in favor of #7354

@pyup-bot pyup-bot closed this May 12, 2024
@Harmon758 Harmon758 deleted the pyup-update-hypothesis-6.92.1-to-6.100.6 branch May 12, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant