requiresthat 2025.6.19.2__py3-none-any.whl → 2025.6.19.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- requiresthat/_requires.py +11 -3
- {requiresthat-2025.6.19.2.dist-info → requiresthat-2025.6.19.4.dist-info}/METADATA +1 -1
- requiresthat-2025.6.19.4.dist-info/RECORD +8 -0
- requiresthat-2025.6.19.2.dist-info/RECORD +0 -8
- {requiresthat-2025.6.19.2.dist-info → requiresthat-2025.6.19.4.dist-info}/WHEEL +0 -0
- {requiresthat-2025.6.19.2.dist-info → requiresthat-2025.6.19.4.dist-info}/top_level.txt +0 -0
requiresthat/_requires.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
"""See the README
|
2
|
-
|
1
|
+
"""See the `README
|
2
|
+
<https://gitlab.com/bedhanger/mwe/-/blob/master/python/requiresthat/README.rst>`_ file
|
3
|
+
"""
|
3
4
|
from typing import Optional, Callable
|
4
5
|
from functools import wraps
|
5
6
|
|
@@ -7,8 +8,15 @@ from ._when import When, APRIORI, POSTMORTEM, BEFOREANDAFTER
|
|
7
8
|
from ._exceptions import RequirementNotFulfilledError, NoCallableConstructError
|
8
9
|
|
9
10
|
def requires(that, when: When = APRIORI) -> Optional[Callable]:
|
10
|
-
"""Require
|
11
|
+
"""Require ``that`` of the decoratee, and require it ``when``
|
12
|
+
|
13
|
+
Fail if the associated construct is not callable.
|
14
|
+
|
15
|
+
Fail if the condition is not met: do not invoke the callable or prevent the operation from being
|
16
|
+
considered a success.
|
11
17
|
|
18
|
+
Needs the operation to be an instance method of a class.
|
19
|
+
"""
|
12
20
|
def func_wrapper(func: Callable) -> Optional[Callable]:
|
13
21
|
"""First-level wrap the decoratee"""
|
14
22
|
|
@@ -0,0 +1,8 @@
|
|
1
|
+
requiresthat/__init__.py,sha256=VTyJru4K2_e7UEa0od6kXU7M8ovfD176GXEXqtNf-nY,154
|
2
|
+
requiresthat/_exceptions.py,sha256=-Q9lhvHnSapP_UGMAnlXxwDaGcxagULIe5oP5h8a2IU,1275
|
3
|
+
requiresthat/_requires.py,sha256=a293jEksRYfF9SxdBqyzuEAO9JNh8HfX8Eg10eJqQpE,2783
|
4
|
+
requiresthat/_when.py,sha256=VoGuvoG9WDEMIPeKnxAsjMTaCMhgSszf4xxa1vLn5aU,299
|
5
|
+
requiresthat-2025.6.19.4.dist-info/METADATA,sha256=-LUMs7OOTqCdH4lkNxEgFrhSse4fkW-HZXe-p17o-eI,2072
|
6
|
+
requiresthat-2025.6.19.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
+
requiresthat-2025.6.19.4.dist-info/top_level.txt,sha256=mUgMTpAG75GYtt5_rVajUyWp-O_1VrrkqRo_hY9L9So,13
|
8
|
+
requiresthat-2025.6.19.4.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
requiresthat/__init__.py,sha256=VTyJru4K2_e7UEa0od6kXU7M8ovfD176GXEXqtNf-nY,154
|
2
|
-
requiresthat/_exceptions.py,sha256=-Q9lhvHnSapP_UGMAnlXxwDaGcxagULIe5oP5h8a2IU,1275
|
3
|
-
requiresthat/_requires.py,sha256=5hQMT5T5VZuQj6W13108j_cedx4wKzJ7Kt4xseOR4cI,2447
|
4
|
-
requiresthat/_when.py,sha256=VoGuvoG9WDEMIPeKnxAsjMTaCMhgSszf4xxa1vLn5aU,299
|
5
|
-
requiresthat-2025.6.19.2.dist-info/METADATA,sha256=jpldN9GWgFubP9xM-VzZQJPmRKEL6NyWLBDQ0zTWTxM,2072
|
6
|
-
requiresthat-2025.6.19.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
-
requiresthat-2025.6.19.2.dist-info/top_level.txt,sha256=mUgMTpAG75GYtt5_rVajUyWp-O_1VrrkqRo_hY9L9So,13
|
8
|
-
requiresthat-2025.6.19.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|