从外部git仓库读取python包

时间:2019-01-16 22:54:04

标签: python git

我有一个类似python的项目,其结构类似于belwo:

Mypkg
|___init__.py
|__module1
|  |__init__.py
|  |__module1.py
|__main.py

实际上,我想将模块1的开发工作分派给一个单独的人,他可以在Git仓库上使用它。我可以每次从git仓库中使用模块1吗?我应该在项目中编写一个requirements.txt吗?

1 个答案:

答案 0 :(得分:-1)

我相信@aws_apprentice的评论建议您可以通过为模块1编写setup.py来将模块1构建为适当的python软件包,然后将其安装为Mypkg的依赖项。但是在早期开发期间,您可以将一个git repo放入另一个,然后.gitignore。

cd mypkg
git clone <https or ssh git thing>/module1
echo 'module1' >> .gitignore
git commit -am 'add module1 to gitignore'

然后将其他人推送到git的更改更新为module1,

cd mypkg/module1
git pull
相关问题