Skip to main content

GitMachine is a python library that aims to mimic git checkout processes to handle url aliasing and cases where submodules may need to be overriden ad-hoc.

This is based on the submodule override schema in baserock, but can be used independently of baserock build tooling.

Here’s how to use it

# Set some aliases, this is usually a dictionary of prefix mappings. Here # we set a single prefix meaning, wherever we see ‘upstream:’, substitute # it for ‘git://git.baserock.org/delta’

aliases = { ‘upstream:’: ‘git://git.baserock.org/delta/’}

# Make a GitMachine, specifying a ‘gits’ directory, a ‘tmp’ directory and # the aliases. ‘gits’ is where the gits end up stored. GitMachine will name # them in a standard way.

gitmachine = GitMachine(‘gits’, ‘tmp’, aliases)

# We’re going to check out ansible at the ref ebc8d48d34296fe010096f044e2b7591df37a622, # using the upstream baserock repository. We need to make a submodule mask, which maps # the path of the submodule in the main repository to an alternate url. It looks like # this:

ansible = {‘lib/ansible/modules/core’: { ‘url’: ‘upstream:ansible-modules-core.git’ },

‘v2/ansible/modules/core’: { ‘url’: ‘upstream:ansible-modules-core.git’ }, ‘v2/ansible/modules/extras’: { ‘url’: ‘upstream:ansible-modules-extras.git’ }, ‘lib/ansible/modules/extras’: { ‘url’: ‘upstream:ansible-modules-extras.git’ }}

# Use the arrange_into_folder method to clone upstream:ansible from git.baserock.org, # also passing in the ref, the submodule mask, and a folder, to clone into the folder # using the overriden sources. Here it will evaluate upstream:ansible and clone it # into the folder ‘ansible.build’, using the submodule override mask.

gitmachine.arrange_into_folder(‘upstream:ansible’, ‘ebc8d48d34296fe010096f044e2b7591df37a622’, ansible, ‘ansible.build’)

GitMachine also works recursively. An example of a recursive checkout of the qt5 master repository can be found in ‘quick-check.py’

Metadata

Release files for gitmachine 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gitmachine 0.1.5
File Size Uploaded Provenance Actions
gitmachine-0.1.5.tar.gz 3.6 kB Without provenance Details for gitmachine-0.1.5.tar.gz

Release files / gitmachine-0.1.5.tar.gz

Download URL gitmachine-0.1.5.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d819550b3fbd237e51a7bf84b407db99d53f2ad937fe8938561a5a7c567d1c7c
BLAKE2b-256 checksum
How to use checksums
b5968d4394ecb8204a9b5edd30f21466b1bdcac665c5e7e1a60a3cf03e777f5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for gitmachine 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page