gpt4 book ai didi

python - requirements.txt 引用索引的 tox 问题

转载 作者:行者123 更新时间:2023-11-28 22:24:58 25 4
gpt4 key购买 nike

我在运行 tox 时遇到了问题,它取决于 requirements.txt,它指定了安装托管在我们网站上的本地包所需的索引本地 devpi 实例。

特别是我得到以下(缩写)错误,

> rm -rf ./tox
> tox -e flake8
flake8 create: /Users/john_bodley/my-project/.tox/flake8
flake8 installdeps: -r/Users/john_bodley/my-project/requirements.txt, flake8, flake8-commas, flake8-import-order, flake8-quotes
...
No matching distribution found for some-local-package==1.2.3 (from -r /Users/john_bodley/my-package/requirements.txt (line 4))

但是,如果我重新运行 tox -e flake8 命令,它就会起作用。此外还有以下作品,

pip install -r requirements.txt
pip install -e .

有人知道可能的解决方案吗?注意我也不确定如何为给定的测试禁用 pip install -e . install 命令,因为 flask8 实际上不需要它。

作为引用,我使用的是 pip v9.0.1 和 tox v2.7.0。下面分别是 requirements.txttox.ini 文件的上下文。

要求.txt:

--index http://example.com/john_bodley/prod/+simple/
--trusted-host example.com
some-local-package==1.2.3

毒素.ini:

[flake8]
application-import-names = my-package
import-order-style = google
max-line-length = 80

[testenv]
commands =
pip wheel -w {homedir}/.wheelhouse -f {homedir}/.wheelhouse .
py.test tests
deps =
-r{toxinidir}/requirements.txt
pytest
pytest-flask
wheel
usedevelop = True

[testenv:eslint]
commands = npm run lint
whitelist_externals = npm

[testenv:flake8]
commands = flake8
deps =
-r{toxinidir}/requirements.txt
flake8
flake8-commas
flake8-import-order
flake8-quotes

[tox]
envlist = eslint,flake8,py27

最佳答案

此行不正确:

--index http://example.com/john_bodley/prod/+simple/

有效选项是 --index-url--extra-index-url(任何一个都适用于您的情况)。如果您还希望搜索 PyPI,请使用后者;如果您只想搜索您的本地索引,请使用前者。

关于python - requirements.txt 引用索引的 tox 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45907007/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com