debian_inspector.deps module
- class debian_inspector.deps.AbstractRelationship
Bases:
object
- matches(name, version=None, architecture=None)
Check if the relationship matches a given package name and version.
- Return True, False or None:
True if the name and version match,
False if the name matches but not the version
None if the name does not match
- property names
A set of package names (strings) in the relationship.
- class debian_inspector.deps.AndRelationships(relationships=())
Bases:
MultipleRelationship
A multi relationship where all relationships must be satisfied.
- matches(name, version=None, architecture=None)
Return True if all the the relationships match a given package name and version strings.
Return False if at least one relationship matches to False or None otherwise.
- class debian_inspector.deps.MultipleRelationship(relationships=())
Bases:
AbstractRelationship
- classmethod from_relationships(*relationships)
- property names
Get the name(s) of the packages in the relationship set.
- Returns:
A set of package names (strings).
- class debian_inspector.deps.OrRelationships(relationships=())
Bases:
MultipleRelationship
A multi relationship where one of the relationships must be satisfied.
- matches(name, version=None, architecture=None)
Return True if at least one of the relationships match a given package name and version strings.
Return False if at least one of the relationships name are matched without the version or None otherwise.
- class debian_inspector.deps.Relationship(name, architectures=())
Bases:
AbstractRelationship
A simple package relationship referring only to the name of a package.
- matches(name, version=None, architecture=None)
Return True if the relationship matches a given package name ignoring version or None.
- property names
A set of package names (strings) in the relationship.
- to_dict()
- class debian_inspector.deps.VersionedRelationship(name, operator, version, architectures=())
Bases:
Relationship
A conditional package relationship that refers to a package and certain versions of that package.
- matches(name, version=None, architecture=None)
Check if the relationship matches a given package name and version.
- debian_inspector.deps.parse_alternatives(expression)
Return a Relationship for an expression string that contains one or more alternative relationships. Raise ValueError when parsing fails.
An expression with alternative is something such as as
python2.6 | python2.7.
, i.e. a list of relationship expressions separated by|
tokens.Each pipe-separated sub-expression is parsed with parse_relationship()
- debian_inspector.deps.parse_depends(relationships)
Return an AndRelationships from a Debian package relationship declaration line. Raise ValueError when parsing fails.
relationships is a string containing one or more comma separated package relationships or a list of strings with package relationships.
The input has a form such as
python (>= 2.6), python (<< 3)
, i.e. a comma-separated list of expressions.Each expression is a package name/versions/arch constraint or a pipe- separated list of alternative.
- debian_inspector.deps.parse_package_relationship_expression(string, pos=0, endpos=9223372036854775807)
Matches zero or more characters at the beginning of the string.
- debian_inspector.deps.parse_relationship(expression)
Parse an expression containing a package name and optional version and architecture constraints.
- Parameters:
expression – A relationship expression (a string).
- Returns:
A
Relationship
object.- Raises:
ValueError
when parsing fails.
This function parses relationship expressions containing a package name and (optionally) a version relation of the form
python (>= 2.6)
and/or an architecture restriction (refer to the Debian policy manual’s documentation on the syntax of relationship fields for details). https://www.debian.org/doc/debian-policy/ch-relationships.html
- debian_inspector.deps.split_on_ops(string, maxsplit=0)
Split string by the occurrences of pattern.