API Reference
The tagged object classes
parse_stages.Tagged
dataclass
A base class for representing an object that has some tags.
Source code in src/parse_stages/defs.py
name: str
instance-attribute
The name of the object, e.g. the name of the Tox test environment.
tags: list[str]
instance-attribute
The tags specified for this object.
get_keyword_haystacks()
parse_stages.TaggedFrozen
dataclass
A base class for representing a constant object that has some tags.
Source code in src/parse_stages/defs.py
name: str
instance-attribute
The name of the object, e.g. the name of the Tox test environment.
tags: list[str]
instance-attribute
The tags specified for this object.
get_keyword_haystacks()
The evaluated boolean expression
parse_stages.BoolExpr
dataclass
Bases: ABC
A boolean expression parsed out of a specification string.
Source code in src/parse_stages/expr.py
parse_stages.OrExpr
dataclass
Bases: BoolExpr
An "subexpr or subexpr [or subexpr...]" subexpression.
Source code in src/parse_stages/expr.py
children: list[BoolExpr]
instance-attribute
The subexpressions to be combined.
evaluate(obj)
Check whether any of the specified expressions hold(s) true.
parse_stages.AndExpr
dataclass
Bases: BoolExpr
An "atom and atom [and atom...]" subexpression.
Source code in src/parse_stages/expr.py
children: list[BoolExpr]
instance-attribute
The subexpressions to be combined.
evaluate(obj)
parse_stages.NotExpr
dataclass
Bases: BoolExpr
A negated boolean expression.
Source code in src/parse_stages/expr.py
child: BoolExpr
instance-attribute
The expression to be negated.
The object's tags and keywords
parse_stages.TagExpr
dataclass
Bases: BoolExpr
A tag to be checked against obj.tags.
Source code in src/parse_stages/expr.py
tag: str
instance-attribute
The tag to be matched exactly against the object's list of tags.
parse_stages.KeywordExpr
dataclass
Bases: BoolExpr
A tag to be checked against an object's name or list of tags.
Source code in src/parse_stages/expr.py
keyword: str
instance-attribute
The keyword to be matched as a substring of the object's keywords.
evaluate(obj)
Check whether the tag is present in the object's list of tags.
The helper functions
parse_stages.EMPTY_SET_SPECS = ['', '0', 'none']
module-attribute
The list of exact strings that parse_stage_ids()
will return an empty list for.
parse_stages.parse_spec(spec)
Parse an expression using the pyparsing
library.
Source code in src/parse_stages/p_pyp.py
parse_stages.parse_stage_ids(spec, *, empty_set_specs=None)
Parse a list of stage ranges, return them as zero-based indices.
As a special case, the exact strings "" (an empty string), "0", and "none" will produce an empty list. Note that none of these strings are considered valid stage ranges, so they cannot be combined with any others (e.g. "0,3" is invalid).
The default list of strings that signify an empty set ("", "0", "none") may be
overridden by the empty_set_specs
parameter.