Debian Codegraph @

hypothesis-python/docs/packaging.rst

raw
1 ====================
2 Packaging guidelines
3 ====================
4
5 Downstream packagers often want to package Hypothesis. Here are some guidelines.
6
7 The primary guideline is this: If you are not prepared to keep up with the Hypothesis release schedule,
8 don't. You will be doing your users a disservice.
9
10 Hypothesis has a very frequent release schedule. We often release new versions multiple times a week.
11
12 If you *are* prepared to keep up with this schedule, you might find the rest of this document useful.
13
14 ----------------
15 Release tarballs
16 ----------------
17
18 These are available from :gh-link:`the GitHub releases page <releases>`. The
19 tarballs on PyPI are intended for installation from a Python tool such as :pypi:`pip` and should not
20 be considered complete releases. Requests to include additional files in them will not be granted. Their absence
21 is not a bug.
22
23
24 ------------
25 Dependencies
26 ------------
27
28 ~~~~~~~~~~~~~~~
29 Python versions
30 ~~~~~~~~~~~~~~~
31
32 Hypothesis is designed to work with a range of Python versions - we support
33 `all versions of CPython with upstream support <https://devguide.python.org/#status-of-python-branches>`_.
34 We also support the latest versions of PyPy for Python 3.
35
36 ~~~~~~~~~~~~~~~~~~~~~~
37 Other Python libraries
38 ~~~~~~~~~~~~~~~~~~~~~~
39
40 Hypothesis has *mandatory* dependencies on the following libraries:
41
42 * :pypi:`sortedcontainers`
43
44 Hypothesis has *optional* dependencies on the following libraries:
45
46 .. literalinclude:: ../pyproject.toml
47 :prepend: [project.optional-dependencies]
48 :start-after: [project.optional-dependencies]
49 :end-before: # Avoid changing this by hand
50
51 The way this works when installing Hypothesis normally is that these features become available if the relevant
52 library is installed.
53
54 Specifically for :pypi:`pytest`, our plugin supports versions of pytest which
55 have been out of upstream support for some time. Hypothesis tests can still
56 be executed by even older versions of pytest - you just won't have the plugin
57 to provide automatic marks, helpful usage warnings, and per-test statistics.
58
59 ------------------
60 Testing Hypothesis
61 ------------------
62
63 If you want to test Hypothesis as part of your packaging you will probably not want to use the mechanisms
64 Hypothesis itself uses for running its tests, because it has a lot of logic for installing and testing against
65 different versions of Python.
66
67 The tests must be run with fairly recent tooling; check the :gh-link:`tree/master/requirements/`
68 directory for details.
69
70 The organisation of the tests is described in the :gh-file:`hypothesis-python/tests/README.rst`.
71
72 --------
73 Examples
74 --------
75
76 * `arch linux <https://archlinux.org/packages/extra/any/python-hypothesis/>`_
77 * `fedora <https://src.fedoraproject.org/rpms/python-hypothesis>`_
78 * `gentoo <https://packages.gentoo.org/packages/dev-python/hypothesis>`_