诗歌(pyproject.toml)同时支持Python 2和3

时间:2019-10-18 09:55:17

标签: python-3.x python-2.7 ipython tox python-poetry

我有一个需要同时支持Python 2和3的软件包(usignals)。在我的Class<?>中,我有这个软件包:

pyproject.toml

[tool.poetry.dependencies]
python = ">=2.7, >=3.6"

通过[tool.poetry.dev-dependencies] ipython = [ {version = "~5", python = "~2.7"}, {version = "~7.8", python = ">=3.5"} ] 运行Tox时,出现此错误:

tox -rve py27

请注意,如果我指定ERROR: Package u'usignals-0.4.0' requires a different Python: 2.7.5 not in '>=3.6' ,则得到python = "*"也是没有帮助的。

请注意,如果指定Because usignals depends on both ipython (~5) and ipython (~7.8), version solving failed.,则会收到与以前相同的错误。

我在做什么错了?

在有人问之前,这是python = "~2.7 || >=3.6"文件:

tox.ini

更详细的输出:

[tox]
isolated_build = true
envlist = py27, py36

# Run `pyenv global 3.7.4 system` if pyenv cannot find python2.
[testenv]
whitelist_externals = poetry
commands =
    poetry install -v
    poetry run pytest tests/

1 个答案:

答案 0 :(得分:0)

There was a bug,其中has been fixed

后代:

_text_

python = "^2.7 || ^3.6 ||  ^3.7"

应该是正确的。新诗发行后,我会进行测试。