[英]python pip - development mode with local dependencies
Background 背景
I have two python projects. 我有两个python项目。 Project A and Project B. 项目A和项目B.
Each project has its own virtual environment and its own setup.py. 每个项目都有自己的虚拟环境和自己的setup.py。
Both projects are not pure py files and has "build" process like building extensions, generate source etc. 这两个项目都不是纯py文件,并且具有“构建”过程,如构建扩展,生成源等。
A is dependent on B (setup.py install_requires points on B). A依赖于B(B上的setup.py install_requires点)。
Each project is built and published/distributed as a wheel to pypi on-premise repository. 每个项目都作为一个轮子构建和发布/分发到pypi内部部署存储库。
pip install w/wo -e (development mode) of project A, nicely installs project B into project A venv site-packages. pip install w / wo -e(项目A的开发模式),很好地将项目B安装到项目A venv站点包中。
So far everything is working nicely and "by the book". 到目前为止,一切都运行良好,“按书”。
Now, my story get complicated ... 现在,我的故事变得复杂......
I would like to develop the two projects together without having to publish B in order A to consume it. 我想一起开发这两个项目,而不必按顺序A发布B来使用它。
As example, I would like to: 例如,我想:
I actually want the pip install -e of project A to install project B in development mode too. 我实际上想要项目A的pip install -e也可以在开发模式下安装项目B.
After some reading I understood (hopefully correctly) that one can define a "distribution" as a local source folder by --find-links flag. 经过一些阅读后,我理解(希望是正确的)可以通过--find-links标志将“分发”定义为本地源文件夹 。
I defined project B root folder in --find-links. 我在--find-links中定义了项目B根文件夹。
I tried it with (on project A setup.py folder): 我尝试了(在项目A setup.py文件夹上):
pip install . 点子安装。 -e --find-links = file:///path/to/B -e --find-links = file:/// path / to / B.
pip install . 点子安装。 -e --find-links = git+file://path/to/B -e --find-links = git + file:// path / to / B.
Both did not work. 两者都没用。
BTW, Puting in the path to B wheel or egg of B, BTW,在通往B轮或B蛋的路径中,
ex: pip install . 例如: pip安装。 -e --find-links = file:///path/to/B.whl -e --find-links = file:///path/to/B.whl
did work but this is not what I am looking for. 确实有效,但这不是我想要的。
Hope you are still with me :-) (sorry for the tedious story) 希望你还在我身边:-)(对于这个乏味的故事感到抱歉)
What am I missing? 我错过了什么?
Tx TX
Let me try and restate the problem: 让我试着重述一下这个问题:
I apologize if I'm missing something here, but why not simply install both packages in the same virtual environment, which will make this problem go away? 如果我在这里遗漏了一些东西,我很抱歉,但为什么不简单地在同一个虚拟环境中安装这两个软件包,这会让这个问题消失呢?
Ie after creating your environment, you install package B in editable mode, followed by installing package A. Any changes in B will be picked up by A, no changes needed. 即在创建环境之后,将软件包B安装在可编辑模式下,然后安装软件包A. B中的任何更改都将由A获取,无需进行任何更改。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.