提供对python中“git subrepo”的访问

gitsubrepo的Python项目详细描述


Build StatuscodecovPyPI version

git subrepo python包装器

以同样的方式 `GitPython<;https://pypi.python.org/pypi/GitPython/>;``包装 git,此库提供对python中git subrepo的简单访问。

如何使用

先决条件

  • git>;=2.10.0(路径上)
  • Git Subrepo=0.3.1
  • python=3.6

安装

稳定版本可以通过 PyPI

$ pip install gitsubrepo

出血边缘版本可以直接从github安装:

$ pip install git+https://github.com/wtsi-hgi/python-git-subrepo.git@${commitIdBranchOrTag}#egg=gitsubrepo

若要将此库声明为项目的依赖项,请将其添加到 requirement.txt文件。

API

库当前支持3git subrepo操作:clonepullstatus。具体见文件 关于如何使用这些方法的信息。

示例用法:

importgitsubreporemote_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)assertsubrepo_remote==remote_repositoryassertsubrepo_branch==branch

发展

设置

同时安装库依赖项和 测试:

$ pip install -q -r requirements.txt
$ pip install -q -r test_requirements.txt

测试

使用unittest运行测试并生成覆盖率报告:

./test-runner.sh

如果要在Docker容器中运行测试,请生成 Docker.test

许可证

MIT license

版权所有(c)2017基因组研究有限公司

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java基于条件如何创建StringBuffers并向其添加数据   java如何用UNC路径解决“不表示可正确访问的目录”异常?   在执行提取方法重构后,java代码的速度降低了6倍   java如何修改LDAPCertStore中用于X509证书链验证的LDAP连接属性   awt如何在Java中捕获鼠标光标?   字符串如何设置Java输出流   java NumberFormatException:用于输入字符串:“8:00”   unix/linux“tail f”的Java IO文件实现   java打印输出。带有JOptionPane的txt文件   java解组总是显示0和null   使用MySQL的windows java JavaFX自包含应用程序打包   JavaSpring:方法getBean(String…)是如何实现的根据输入字符串查找bean?   java高效地更新RecyclerView网格或以其他方式显示复杂网格   java向ArrayList添加对象(String、String、int、int)   java在一组文档上使用ForkJoinPool