pkgcraft package¶
Subpackages¶
- pkgcraft.dep package
- Submodules
- pkgcraft.dep.base module
Dependency
Dependency.__init__()
Dependency.conditional
Dependency.evaluate()
Dependency.iter_conditionals()
Dependency.iter_flatten()
Dependency.iter_recursive()
Dependency.kind
Dependency.license()
Dependency.package()
Dependency.properties()
Dependency.required_use()
Dependency.restrict()
Dependency.set
Dependency.sort()
Dependency.src_uri()
DependencyKind
DependencySet
DependencySet.__init__()
DependencySet.difference()
DependencySet.evaluate()
DependencySet.intersection()
DependencySet.isdisjoint()
DependencySet.issubset()
DependencySet.issuperset()
DependencySet.iter_conditionals()
DependencySet.iter_flatten()
DependencySet.iter_recursive()
DependencySet.license()
DependencySet.package()
DependencySet.properties()
DependencySet.required_use()
DependencySet.restrict()
DependencySet.set
DependencySet.src_uri()
DependencySet.symmetric_difference()
DependencySet.union()
DependencySetKind
MutableDependencySet
MutableDependencySet.add()
MutableDependencySet.clear()
MutableDependencySet.difference_update()
MutableDependencySet.discard()
MutableDependencySet.intersection_update()
MutableDependencySet.pop()
MutableDependencySet.remove()
MutableDependencySet.sort()
MutableDependencySet.sort_recursive()
MutableDependencySet.symmetric_difference_update()
MutableDependencySet.update()
- pkgcraft.dep.cpn module
- pkgcraft.dep.cpv module
- pkgcraft.dep.pkg module
- pkgcraft.dep.uri module
- pkgcraft.dep.use_dep module
- pkgcraft.dep.version module
- Module contents
- pkgcraft.pkg package
- pkgcraft.repo package
- pkgcraft.types package
- Submodules
- pkgcraft.types.ordered module
OrderedFrozenSet
OrderedFrozenSet.__init__()
OrderedFrozenSet.copy()
OrderedFrozenSet.difference()
OrderedFrozenSet.index()
OrderedFrozenSet.intersection()
OrderedFrozenSet.isdisjoint()
OrderedFrozenSet.isorderedsubset()
OrderedFrozenSet.isorderedsuperset()
OrderedFrozenSet.issubset()
OrderedFrozenSet.issuperset()
OrderedFrozenSet.symmetric_difference()
OrderedFrozenSet.union()
OrderedSet
entry
- Module contents
Submodules¶
pkgcraft.config module¶
- class pkgcraft.config.Config¶
Bases:
object
Config for the system.
On instance creation, no system config is automatically loaded.
- add_repo(self, repo, id=None, priority=0, external=True)¶
Add a repo via its file path or from a Repo object and return the Repo object.
- Parameters:
- Returns:
the repo object (subclassed to its format) added to the config
- Return type:
- Raises:
PkgcraftError – on invalid repos
ConfigError – on overlap between repos in the config object
- load(self)¶
Load pkgcraft config files, if none are found revert to loading portage files.
- Raises:
PkgcraftError – on config loading failures
- load_portage_conf(self, path=None)¶
Load portage config files from a given directory, falling back to default locations.
- Parameters:
path (str) – path to the portage config directory to load, by default the standard locations are used
- Raises:
PkgcraftError – on config loading failures
pkgcraft.eapi module¶
- class pkgcraft.eapi.Eapi¶
Bases:
Indirect
- dep_keys¶
Get an EAPI’s dependency keys.
- static from_obj(obj)¶
Try to convert an object to an Eapi object.
- has(s)¶
Check if an EAPI has a given feature.
See https://docs.rs/pkgcraft/latest/pkgcraft/eapi/enum.Feature.html for the full list of supported EAPI features.
existing feature:
>>> from pkgcraft.eapi import EAPI_LATEST_OFFICIAL >>> EAPI_LATEST_OFFICIAL.has('UsevTwoArgs') True
feature not existing in official EAPIs:
>>> EAPI_LATEST_OFFICIAL.has('RepoIds') False
nonexistent feature:
>>> EAPI_LATEST_OFFICIAL.has('nonexistent') False
- metadata_keys¶
Get an EAPI’s metadata keys.
- static parse(s, raised=False)¶
Determine if a string is a valid EAPI.
This avoids any string allocations, only returning the validity status.
- Parameters:
s (
str
) – the string to parseraised – if True, raise an exception when invalid
- Returns:
True if the given string represents a valid EAPI, otherwise False.
- Return type:
- Raises:
PkgcraftError – on failure if the raised parameter is set to True
>>> from pkgcraft.eapi import Eapi >>> Eapi.parse('01') True >>> Eapi.parse('@1') False
- pkgcraft.eapi.eapi_range(s)¶
Convert EAPI range into an ordered set of Eapi objects.
>>> from pkgcraft.eapi import * >>> eapi_range('..') == set(EAPIS.values()) True >>> eapi_range('..6') == {EAPI5} True >>> eapi_range('..=6') == {EAPI5, EAPI6} True >>> eapi_range('7..8') == {EAPI7} True >>> eapi_range('8..8') == set() True >>> eapi_range('7..=8') == {EAPI7, EAPI8} True >>> eapi_range('..9999') Traceback (most recent call last): ... pkgcraft.error.PkgcraftError: invalid EAPI range: ..9999
pkgcraft.error module¶
- exception pkgcraft.error.ConfigError(msg=None, **kwargs)¶
Bases:
PkgcraftError
Generic configuration exception.
- class pkgcraft.error.Indirect(*args, **kwargs)¶
Bases:
object
Instances cannot be directly created.
- __init__(*args, **kwargs)¶
- exception pkgcraft.error.IndirectType¶
Bases:
TypeError
Object type instances cannot be directly created.
- exception pkgcraft.error.InvalidCpn(msg=None, **kwargs)¶
Bases:
PkgcraftError
,ValueError
Cpn doesn’t meet required specifications.
- exception pkgcraft.error.InvalidCpv(msg=None, **kwargs)¶
Bases:
PkgcraftError
,ValueError
Cpv doesn’t meet required specifications.
- exception pkgcraft.error.InvalidDep(msg=None, **kwargs)¶
Bases:
PkgcraftError
,ValueError
Package dependency doesn’t meet required specifications.
- exception pkgcraft.error.InvalidPkg(msg=None, **kwargs)¶
Bases:
PkgcraftError
Package doesn’t meet required specifications.
- exception pkgcraft.error.InvalidRepo(msg=None, **kwargs)¶
Bases:
PkgcraftError
Repo doesn’t meet required specifications.
- exception pkgcraft.error.InvalidRestrict(msg=None, **kwargs)¶
Bases:
PkgcraftError
,ValueError
Object cannot be converted to a restriction.
- exception pkgcraft.error.InvalidVersion(msg=None, **kwargs)¶
Bases:
PkgcraftError
,ValueError
Package version doesn’t meet required specifications.
pkgcraft.logging module¶
pkgcraft.parse module¶
- pkgcraft.parse.category(s, raised=False)¶
Determine if a string is a valid category name.
- pkgcraft.parse.package(s, raised=False)¶
Determine if a string is a valid package name.
- pkgcraft.parse.repo(s, raised=False)¶
Determine if a string is a valid repo name.
- pkgcraft.parse.use_flag(s, raised=False)¶
Determine if a string is a valid USE flag name.
pkgcraft.restrict module¶
- class pkgcraft.restrict.Restrict(obj)¶
Bases:
object
Generic restriction.
- __init__(*args, **kwargs)¶
- static dep(s)¶
Convert a string into a dependency-based restriction.
- matches(self, obj)¶
Determine if a restriction matches a given object.
Returns True if the restriction matches a given object, otherwise False.
Raises TypeError for object types not supporting matches.
- static pkg(s)¶
Convert a string into a package-based restriction.