上下文
在我的Django项目(基于Django炊具)中,我使用了依赖于django-graphql-auth的django-graphql-jwt。
我对django-graphql-jwt进行了分叉,以进行一些更改,然后也对django-graphql-auth进行了分叉,以将其依赖项更新为django-graphql-auth叉:
# django-graphql-auth setup.py
install_requires=[
"django-graphql-jwt @ git+<git_url>#egg=django_graphql_jwt",
...,
]这与pip install -r requirements.txt所期望的一样。
问题
在Docker中,当我在一个阶段构建车轮并在另一个阶段中安装它们时,django-graphql-jwt git会被两次拉出(在构建和安装上),并且会发生冲突。
炊具Django提供了一个Dockerfile (在这里发现的),该文件分为多个阶段:
> pip wheel --wheel-dir /wheels/ -r local.txt> pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/*
...
Processing /wheels/django_graphql_auth-0.3.16-py2.py3-none-any.whl
Processing /wheels/django_graphql_jwt-0.3.4-py3-none-any.whl
...
Collecting django-graphql-jwt@ git+<git url>
Cloning ...
...
ERROR: Cannot install django-graphql-auth==0.3.16 and django-graphql-jwt 0.3.4 (from /wheels/django_graphql_jwt-0.3.4-py3-none-any.whl) because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested django-graphql-jwt 0.3.4 (from /wheels/django_graphql_jwt-0.3.4-py3-none-any.whl)
django-graphql-auth 0.3.16 depends on django-graphql-jwt (unavailable)正如您可以看到的,现有的-jwt车轮被处理,但之后,它的git被克隆。这两者似乎导致了一场冲突。如果我在setup.py (django-graphql-jwt>=0.3.4)中添加一个版本,它在构建步骤上已经失败了。
如何将-auth依赖项与已经构建的-jwt车轮匹配?
发布于 2021-12-23 03:04:56
假设所有必需的依赖项都是在第一步中构建的(使用pip wheel),则可以通过将--no-deps选项添加到pip install来忽略安装步骤中的依赖项。
pip install --no-cache-dir --no-index --no-deps --find-links=/wheels/ /wheels/*https://stackoverflow.com/questions/70457186
复制相似问题