背景
我们的项目具有以下高级目录结构*
./datascience/
├── core
│ └── setup.py
├── notebooks
│ └── Pipfile
└── web
└── Pipfile
*Excluded all the irrelevant files and directories for brevity.
The core
包是一个库。这是两者的依赖关系notebooks
and web
应用程序。
The core
包裹,作为一个图书馆 https://pipenv.readthedocs.io/en/latest/advanced/#pipfile-vs-setup-py,其依赖项指定在setup.py
import setuptools
setuptools.setup(
install_requires=[
'some-dependency',
'another-dependency'
]
)
The web
and notebooks
应用程序正在使用pipenv https://pipenv.readthedocs.io用于依赖管理。它们的依赖关系在一个中指定Pipfile
.
例如,下面是如何web
依赖项指定于web/Pipfile
:
[packages]
datascience-core = {path = "./../core"}
flask = "~= 1.0"
请注意如何core
依赖是本地依赖,因此是相对路径。
Problem
Doing a pipenv install
从里面web
or notebooks
目录,不安装依赖项core
图书馆如我所料!
我也尝试过使用Pipfile
for core
,希望 pipelinev 能够在其图表中拾取它并下载所有嵌套的依赖项。但事实并非如此。
的依赖关系如何core
当 Pipenv 安装依赖项时,应用程序会自动安装web
or notebooks
app?