makeprov.forges
Functions
|
Add dunder methods based on the fields defined in the class. |
|
Load the built-in profiles, preceded by any user-supplied ones. |
|
Least-recently-used cache decorator. |
|
Return |
|
Match a git remote against the known forges. |
|
Parse a URL into 5 components: <scheme>://<netloc>/<path>?<query>#<fragment> |
Classes
|
How one git host builds a permalink to a file at a revision. |
|
PurePath subclass that can make system calls. |
- class makeprov.forges.ForgeProfile(name, hosts, blob)
Bases:
objectHow one git host builds a permalink to a file at a revision.
- makeprov.forges.load_forges(extra=None)
Load the built-in profiles, preceded by any user-supplied ones.
User profiles are matched first so they can override a built-in host, which is what self-hosted instances of a known forge need.
- Return type:
- makeprov.forges.normalize_remote(origin)
Return
(host, repo_url)for a git remote, orNoneif unparseable.Handles both URL and scp-style remotes, and drops any userinfo: a remote like
https://user:token@host/o/r.gitmust never put its credentials into a provenance document.
- makeprov.forges.resolve_forge(origin, profiles=None)
Match a git remote against the known forges.
Returns the matching profile and the normalized repository URL, or
Nonewhen the remote is unparseable or its host is not a known forge.- Return type:
tuple[ForgeProfile,str] |None