Git Subrepo Python Wrapper
In the same way that `GitPython <https://pypi.python.org/pypi/GitPython/>`__ wraps git, this library provides easy access to git subrepo in Python.
How to use
Prerequisites
git >= 2.10.0 (on path)
git-subrepo >= 0.3.1
python >= 3.6
Installation
Stable releases can be installed via PyPI:
$ pip install gitsubrepo
Bleeding edge versions can be installed directly from GitHub:
$ pip install git+https://github.com/wtsi-hgi/python-git-subrepo.git@${commitIdBranchOrTag}#egg=gitsubrepo
To declare this library as a dependency of your project, add it to your requirement.txt file.
API
The library currently supports 3 git subrepo operations: clone, pull and status. Please see the documentation for specific information on how to use these methods.
Example usage:
import gitsubrepo
remote_repository = "https://github.com/colin-nolan/test-repository.git"
repository_location = "/tmp/repo"
subrepo_location = f"{repository_location}/subrepo"
branch = "develop"
commit_reference = gitsubrepo.clone(remote_repository, subrepo_location, branch=branch)
updated_commit_reference = gitsubrepo.pull(subrepo_location)
subrepo_remote, subrepo_branch, subrepo_commit = gitsubrepo.status(subrepo_location)
assert subrepo_remote == remote_repository
assert subrepo_branch == branch
Development
Setup
Install both library dependencies and the dependencies needed for testing:
$ pip install -q -r requirements.txt
$ pip install -q -r test_requirements.txt
Testing
To run the tests and generate a coverage report with unittest:
./test-runner.sh
If you wish to run the tests inside a Docker container, build Docker.test.
License
Copyright (c) 2017 Genome Research Limited
Metadata
Release files for gitsubrepo 1.1.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 |
|---|---|---|---|---|
| gitsubrepo-1.1.0.tar.gz | 8.0 kB | Without provenance | Details for gitsubrepo-1.1.0.tar.gz |
Release files / gitsubrepo-1.1.0.tar.gz
| Download URL | gitsubrepo-1.1.0.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41b581f4df2aa68b283e29e65b6e561541e1ade819c0976997671877fc227239
|
|
BLAKE2b-256 checksum How to use checksums |
7477ad2aa9fe024372682c06d13d4ac0ac9a4742b7607d29ace0cb3acb7dbb70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for gitsubrepo 1.1.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.