httk.core.requirements¶
Parse and check minimum-version requirements on installed distributions.
Manifests declare requires = ["httk-workflow>=2.2.0", ...]. Only the
>= operator is supported, with a plain release N(.N)* on the right.
Installed versions are compared in PEP 440 order without a packaging
dependency: a pre or dev release of the required release does not satisfy
it, while a post release or local label does.
Exceptions¶
Report that installed distributions do not meet declared requirements. |
Classes¶
Describe one minimum-version requirement. |
Functions¶
|
Parse a |
|
Describe the requirements the running interpreter does not meet. |
|
Require every requirement to be met by the running interpreter. |
Module Contents¶
- exception httk.core.requirements.RequirementError¶
Bases:
ValueErrorReport that installed distributions do not meet declared requirements.
- class httk.core.requirements.Requirement¶
Describe one minimum-version requirement.
- Parameters:
name – Name the distribution, normalized per PEP 503.
minimum – Give the minimum release segments.
text – Give the requirement as declared, without whitespace.
- httk.core.requirements.parse_requirements(values, where)¶
Parse a
requireslist ofNAME>=VERSIONstrings.- Parameters:
- Returns:
The parsed requirements in declaration order.
- Raises:
ValueError – If the value is not a list of valid, distinct requirement strings.
- Return type:
tuple[Requirement, …]
- httk.core.requirements.unmet_requirements(requirements)¶
Describe the requirements the running interpreter does not meet.
- Parameters:
requirements (collections.abc.Iterable[Requirement]) – Check these requirements.
- Returns:
One message per unmet requirement, e.g.
"httk-workflow>=2.2.0 (installed: 2.1.1)".- Return type:
- httk.core.requirements.check_requirements(requirements, what)¶
Require every requirement to be met by the running interpreter.
- Parameters:
requirements (collections.abc.Iterable[Requirement]) – Check these requirements.
what (str) – Name the requiring manifest in the error message.
- Raises:
RequirementError – If any requirement is unmet; the message lists every one.