wtsi-hgi/python-git-subrepo

Name: python-git-subrepo

Owner: Wellcome Trust Sanger Institute - Human Genetics Informatics

Description: Provides access to `git subrepo` in Python

Created: 2017-06-29 15:57:40.0

Updated: 2017-07-05 14:43:56.0

Pushed: 2017-08-08 08:50:45.0

Homepage:

Size: 47

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status codecov PyPI version

Git Subrepo Python Wrapper

In the same way that GitPython wraps git, this library provides easy access to git subrepo in Python.

How to use
Prerequisites
Installation

Stable releases can be installed via PyPI:

p install gitsubrepo

Bleeding edge versions can be installed directly from GitHub:

p 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:

rt gitsubrepo

te_repository = "https://github.com/colin-nolan/test-repository.git"
sitory_location = "/tmp/repo"
epo_location = f"{repository_location}/subrepo"
ch = "develop"

it_reference = gitsubrepo.clone(remote_repository, subrepo_location, branch=branch)
ted_commit_reference = gitsubrepo.pull(subrepo_location)

epo_remote, subrepo_branch, subrepo_commit = gitsubrepo.status(subrepo_location)
rt subrepo_remote == remote_repository
rt subrepo_branch == branch
Development
Setup

Install both library dependencies and the dependencies needed for testing:

p install -q -r requirements.txt
p install -q -r test_requirements.txt
Testing

To run the tests and generate a coverage report with unittest:

st-runner.sh

If you wish to run the tests inside a Docker container, build Docker.test.

License

MIT license.

Copyright (c) 2017 Genome Research Limited


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.