Impermagit
Impermagit makes it easier to test python programs that use / integrate with git. For example:
from impermagit import fleeting_repo
with fleeting_repo() as repo:
# there is not a git repo created in a temporary dir
# somewhere, allowing you to do things like:
# add some files with some contents and commit them
repo.commit([('test.txt', 'test contents\n'),
('subdir/test2.txt', 'other contents\n')])
# update contents
repo.commit([('test.txt', 'new test contents\n')])
# git rm files by passing None as contents
repo.commit([('subdir/test.txt', None)])
# run arbitrary git cmds in the repo when you don't care
# about the output (will raise a GitExeException if it
# fails)
repo.do_git(["rm", "some-other-file.txt"])
# run arbitrary git cmds in the repo and get back
# stdout / stderr.
with repo.yield_git(["log"]) as (out, err):
print out.read()
print err.read()
# and here, the repo is gone and the temporary dir deleted.
You can also create a Repo object directly, if you’d prefer to control the lifecycle more closely:
from imperagit import Repo
repo = Repo('/some/dir/you/manage')
By default, Imperagit uses “/usr/bin/env git” as the git executable, but this can be overridden with the git_exe arg to both fleeting_repo and Repo.
You can see more detailed docs with the interactive help:
>>> import impermagit >>> help(impermagit)
Impermagit requires Python 2.6+, and has not been tested with Python 3.
Metadata
Release files for impermagit 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| impermagit-1.0.0.tar.gz | 6.9 kB | Without provenance | Details for impermagit-1.0.0.tar.gz |
Release files / impermagit-1.0.0.tar.gz
| Download URL | impermagit-1.0.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70558f150c2e3cd92bf65f9cb1dedf2a9c6bc1599a8cbf1c17d56ed009bafb36
|
|
BLAKE2b-256 checksum How to use checksums |
b966afe652c2deceef84b2937e45c3ab6bef8baed475b37e0a7263b505b148e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for impermagit 1.0.0
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.