[英]Upgrade poetry 1.2.0 tox.ini error Invalide PEP440 version: '3.8.13'
我在我的 tox.ini 中的 github ci 中升級了詩歌。 我的 ci 有問題。 我用zuul。 當我使用詩歌pip install -v poetry==1.1.15
。 我沒有問題但是當我使用1.2.0
時出現此錯誤:
Invalid PEP 440 version: '3.8.13+'
3.8.13
這是我的 python 版本。
我不明白為什么我對 python 版本而不是以前的版本有問題。
pyproject.toml
[tool.poetry]
name = zeus
version = "0.1.0"
description = ***
authors = ***
[tool.poetry.dependencies]
python = "3.8.*"
pandas = "1.4.*"
click = "8.1.*"
[tool.poetry.dev-dependencies]
black = "22.6.*"
flake8 = "5.0.*"
freezegun = "1.2.*"
pre-commit = "2.20.*"
pycodestyle = "2.9.*"
pytest = "7.*"
pylint = "2.14.*"
tox = "3.25.*"
yamllint = "1.27.*"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
毒物
[testenv]
whitelist_externals =
bash
poetry
basepython = python3.8
commands_pre =
bash -c "pip install --upgrade pip"
bash -c "pip install -q poetry"
poetry config repositories****
poetry config http-basic.artifactory ****
poetry install
[testenv:lint]
description = Run the quality checks
commands =
poetry run pre-commit run --from-ref origin/master --to-ref HEAD
[testenv:test]
setenv =
PYTHONPATH = {toxinidir}/app
description = Run the tests
commands =
poetry run pytest
在您的設置中采取了一些非正統的操作:
[testenv:test]
)。 沒有必要,您可以簡單地使用默認的[testenv]
部分。 然后,您可以為 python3.8 或任何其他受支持的標簽( py37
、 py39
、 ... source )運行您的 testsuite tox -e py38 。 這也使得basepython
鍵變得多余。 並為tox
提供更多功能的體驗。PYTHONPATH = {toxinidir}/app
對我來說是一種代碼味道。 如果您正確配置了pyproject.toml
,那么詩歌應該知道您的代碼所在的位置(並相應地安裝它)。 無需設置PYTHONPATH
。 因此,您可能需要添加一個部分,例如:[tool.poetry]
name = "zeus"
packages = [
{ include = "zeus", from = "app" },
]
注意: /src
文件夾比/app
文件夾更常見。 這可能是您找不到此選項的根本原因。 看到這個答案。
我懷疑如果您解決所有這些問題,您的代碼及其安裝將完全不同,可能會解決您的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.