简体   繁体   English

Python / Pip-在没有setup.py的项目之间共享模块

[英]Python / Pip - Sharing modules between projects without setup.py

I have two private Python projects, Project1 and Project2. 我有两个私有的Python项目,Project1和Project2。 Project1 needs to use models and scripts defined in Project2. Project1需要使用Project2中定义的模型和脚本。

I was hoping it would be as easy as adding: 我希望这和添加一样容易:

git+git@bitbucket/user/Project2.git

To my requirements.txt, but I am getting errors that there is a missing setup.py since the Project2 doesn't use setuptools. 对于我的requirements.txt,但是由于Project2不使用setuptools,所以我收到一个错误,提示缺少setup.py。

What is the simplest way of using Project2 within Project1? 在Project1中使用Project2的最简单方法是什么? Do I have to create the module using a setup.py or is there a simpler way? 我必须使用setup.py创建模块还是有更简单的方法?

Using symlinks etc isn't an option because I'll beed to eventually deploy this to a server and retain the dependancy. 使用符号链接等不是一个选择,因为我将被迫最终将其部署到服务器上并保持依赖性。

Yes, make it standard package with setup.py. 是的,使用setup.py使其成为标准包。 Other methods exists, but are mostly more complicated. 存在其他方法,但是大多数方法更复杂。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM