Closed pawamoy closed 2 years ago
Having same issue with
@ pdm add atlassian-python-api
Adding packages to default dependencies: atlassian-python-api
✖ 🔒 Lock failed
The dependency resolution exceeds the maximum loop depth of 10000, there may be some circular dependencies in your project. Try to solve them or increase the `strategy.resolve_max_rounds` config.
See /tmp/pdm-lock-blre54i7.log for detailed debug log.
[ResolutionTooDeep]: 10000
Add '-v' to see the detailed traceback
v3.9.6 (.venv) Documents/dev/gitjirabot [✖ ERROR] took 4m26s at 11:38:36
How it looks
❯ tail -n100 /tmp/pdm-lock-blre54i7.log
<Candidate pydocstyle 6.0.0 from https://pypi.org/simple/pydocstyle/>
<Candidate pydocstyle 5.1.1 from https://pypi.org/simple/pydocstyle/>
<Candidate pydocstyle 5.1.0 from https://pypi.org/simple/pydocstyle/>
<Candidate pydocstyle 5.0.2 from https://pypi.org/simple/pydocstyle/>
<Candidate pydocstyle 5.0.1 from https://pypi.org/simple/pydocstyle/>
<Candidate pydocstyle 5.0.0 from https://pypi.org/simple/pydocstyle/>
<Candidate pydocstyle 4.0.1 from https://pypi.org/simple/pydocstyle/>
<Candidate pydocstyle 4.0.0 from https://pypi.org/simple/pydocstyle/>
... [17 more candidate(s)]
======== Ending round 9993 ========
======== Starting round 9994 ========
Adding requirement flake8(from flake8-string-format 0.3.0)
Found matching candidates:
<Candidate flake8 4.0.1 from https://pypi.org/simple/flake8/>
<Candidate flake8 4.0.0 from https://pypi.org/simple/flake8/>
<Candidate flake8 3.9.2 from https://pypi.org/simple/flake8/>
<Candidate flake8 3.9.1 from https://pypi.org/simple/flake8/>
<Candidate flake8 3.9.0 from https://pypi.org/simple/flake8/>
<Candidate flake8 3.8.4 from https://pypi.org/simple/flake8/>
<Candidate flake8 3.8.3 from https://pypi.org/simple/flake8/>
<Candidate flake8 3.8.2 from https://pypi.org/simple/flake8/>
<Candidate flake8 3.8.1 from https://pypi.org/simple/flake8/>
<Candidate flake8 3.8.0 from https://pypi.org/simple/flake8/>
... [58 more candidate(s)]
======== Ending round 9994 ========
======== Starting round 9995 ========
Adding requirement dataclasses>=0.7; python_version < "3.7"(from mkdocs-literate-nav 0.4.0)
Found matching candidates:
<Candidate dataclasses 0.8 from https://pypi.org/simple/dataclasses/>
<Candidate dataclasses 0.7 from https://pypi.org/simple/dataclasses/>
<Candidate dataclasses 0.6 from https://pypi.org/simple/dataclasses/>
Adding requirement mkdocs<2.0.0,>=1.0.3(from mkdocs-literate-nav 0.4.0)
Found matching candidates:
<Candidate mkdocs 1.2.3 from https://pypi.org/simple/mkdocs/>
<Candidate mkdocs 1.2.2 from https://pypi.org/simple/mkdocs/>
<Candidate mkdocs 1.2.1 from https://pypi.org/simple/mkdocs/>
<Candidate mkdocs 1.2 from https://pypi.org/simple/mkdocs/>
<Candidate mkdocs 1.1.2 from https://pypi.org/simple/mkdocs/>
<Candidate mkdocs 1.1.1 from https://pypi.org/simple/mkdocs/>
<Candidate mkdocs 1.1 from https://pypi.org/simple/mkdocs/>
<Candidate mkdocs 1.0.4 from https://pypi.org/simple/mkdocs/>
<Candidate mkdocs 1.0.3 from https://pypi.org/simple/mkdocs/>
Adding requirement python>=3.6,<4.0(from mkdocs-literate-nav 0.4.0)
======== Ending round 9995 ========
======== Starting round 9996 ========
Adding requirement python>=3.6,<4.0(from isort 5.8.0)
======== Ending round 9996 ========
======== Starting round 9997 ========
======== Ending round 9997 ========
======== Starting round 9998 ========
Adding requirement python>=3.6,<3.7(from dataclasses 0.8)
Adding requirement python>=3.6,<3.7(from dataclasses 0.8)
Adding requirement python>=3.6,<3.7(from dataclasses 0.7)
Adding requirement python>=3.6,<3.7(from dataclasses 0.7)
Candidate rejected: mypy-extensions 0.4.3
Backtracking...
Found matching candidates:
<Candidate mypy-extensions 0.4.3 from https://pypi.org/simple/mypy-extensions/>
Candidate rejected: isort 5.8.0
Backtracking...
Found matching candidates:
<Candidate isort 5.8.0 from https://pypi.org/simple/isort/>
Candidate rejected: mkdocs-literate-nav 0.4.0
Backtracking...
Found matching candidates:
<Candidate mkdocs-literate-nav 0.4.0 from https://pypi.org/simple/mkdocs-literate-nav/>
Candidate rejected: flake8-string-format 0.3.0
Backtracking...
Found matching candidates:
<Candidate flake8-string-format 0.3.0 from https://pypi.org/simple/flake8-string-format/>
Candidate rejected: flake8-docstrings 1.6.0
Backtracking...
Found matching candidates:
<Candidate flake8-docstrings 1.6.0 from https://pypi.org/simple/flake8-docstrings/>
Candidate rejected: black 20.8b1
Backtracking...
Found matching candidates:
<Candidate black 20.8b1 from https://pypi.org/simple/black/>
Candidate rejected: autoflake 1.4
Backtracking...
Found matching candidates:
<Candidate autoflake 1.4 from https://pypi.org/simple/autoflake/>
Candidate rejected: python None
Backtracking...
======== Ending round 9998 ========
======== Starting round 9999 ========
======== Ending round 9999 ========
Error occurs
Traceback (most recent call last):
File "/home/mike/.local/share/pdm/venv/lib/python3.9/site-packages/pdm/termui.py", line 192, in logging
yield logger
File "/home/mike/.local/share/pdm/venv/lib/python3.9/site-packages/pdm/cli/actions.py", line 68, in do_lock
mapping, dependencies = resolve(
File "/home/mike/.local/share/pdm/venv/lib/python3.9/site-packages/pdm/resolver/core.py", line 31, in resolve
result = resolver.resolve(requirements, max_rounds)
File "/home/mike/.local/share/pdm/venv/lib/python3.9/site-packages/resolvelib/resolvers.py", line 472, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/home/mike/.local/share/pdm/venv/lib/python3.9/site-packages/resolvelib/resolvers.py", line 383, in resolve
raise ResolutionTooDeep(max_rounds)
resolvelib.resolvers.ResolutionTooDeep: 10000
PDM version 1.10.2
❯ pdm info && pdm info --env
PDM version: 1.10.2
Python Interpreter: /home/mike/.pyenv/versions/3.9.6/bin/python3.9 (3.9)
Project Root: /home/mike/Documents/dev/gitjirabot
Project Packages: /home/mike/Documents/dev/gitjirabot/__pypackages__/3.9
{
"implementation_name": "cpython",
"implementation_version": "3.9.6",
"os_name": "posix",
"platform_machine": "x86_64",
"platform_release": "5.13.0-7620-generic",
"platform_system": "Linux",
"platform_version": "#20~1634827117~21.04~874b071-Ubuntu SMP Fri Oct 29 15:06:55 UTC ",
"python_full_version": "3.9.6",
"platform_python_implementation": "CPython",
"python_version": "3.9",
"sys_platform": "linux"
}
It is hard for me to reproduce if you don't provide the full dependency set and requires-python
value. Also PLEASE try to make it MINIMAL(try deleting some dependency from the pyproject.toml
and see how it is going). Thank you very much.
I extracted some common dependencies in both reports, but can't manage to reproduce:
mkdocs
autoflake
flake8
black
python>=3.6
I started a new project via https://github.com/pawamoy/copier-pdm
and just added or tried to add 2 dependencies individually and together on various python versions from 3.6.8/3.7.0/3.9.6/3.10.0
pyproject.toml
[build-system]
requires = ["pdm-pep517"]
build-backend = "pdm.pep517.api"
[project]
name = "gitjirabot"
version = {use_scm = true}
description = "Git Jira integrations bot for automating complex tasks"
authors = [{name = "Michael Ramsey", email = "mike@hackerdise.me"}]
license = {file = "LICENSE"}
readme = "README.md"
requires-python = ">=3.6.2"
keywords = []
dynamic = ["version", "classifiers"]
classifiers = [
"Development Status :: 4 - Beta",
"License :: Other/Proprietary License",
"Typing :: Typed",
]
dependencies = [
"atlassian-python-api",
"python-gitlab"
]
[project.urls]
Homepage = "https://meramsey.github.io/gitjirabot"
Documentation = "https://meramsey.github.io/gitjirabot"
Changelog = "https://meramsey.github.io/gitjirabot/changelog"
Repository = "https://github.com/meramsey/gitjirabot"
Issues = "https://github.com/meramsey/gitjirabot/issues"
Discussions = "https://github.com/meramsey/gitjirabot/discussions"
Gitter = "https://gitter.im/gitjirabot/community"
Funding = "https://github.com/sponsors/meramsey"
[project.scripts]
gitjirabot = "gitjirabot.cli:main"
[tool.pdm]
package-dir = "src"
[tool.pdm.dev-dependencies]
duty = ["duty~=0.7"]
docs = [
"mkdocs~=1.2; python_version >= '3.7'",
"mkdocs-coverage~=0.2; python_version >= '3.7'",
"mkdocs-gen-files~=0.3; python_version >= '3.7'",
"mkdocs-literate-nav~=0.4; python_version >= '3.7'",
"mkdocs-material~=7.3; python_version >= '3.7'",
"mkdocstrings~=0.16; python_version >= '3.7'",
"toml~=0.10; python_version >= '3.7'",
]
format = [
"autoflake~=1.4",
"black~=21.10b0",
"isort~=5.10",
]
maintain = [
# TODO: remove this section when git-changelog is more powerful
"git-changelog~=0.4",
]
quality = [
"darglint~=1.8",
"flake8-bandit~=2.1",
"flake8-black~=0.2",
"flake8-bugbear~=21.9",
"flake8-builtins~=1.5",
"flake8-comprehensions~=3.7",
"flake8-docstrings~=1.6",
"flake8-pytest-style~=1.5",
"flake8-string-format~=0.3",
"flake8-tidy-imports~=4.5",
"flake8-variables-names~=0.0",
"pep8-naming~=0.12",
"wps-light~=0.15",
]
tests = [
"pytest~=6.2",
"pytest-cov~=3.0",
"pytest-randomly~=3.10",
"pytest-sugar~=0.9",
"pytest-xdist~=2.4",
]
typing = ["mypy~=0.910"]
[tool.black]
line-length = 120
exclude = "tests/fixtures"
[tool.isort]
line_length = 120
not_skip = "__init__.py"
multi_line_output = 3
force_single_line = false
balanced_wrapping = true
default_section = "THIRDPARTY"
known_first_party = "gitjirabot"
include_trailing_comma = true
Notably the same things with copier-poetry which is poetry based vs pdm works fine and its pyproject.toml file looks like this.
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "gitjirabot"
version = "0.1.6"
description = "Git Jira integrations bot for automating complex tasks"
authors = ["Michael Ramsey <mike@hackerdise.me>"]
license = "Do What The F*ck You Want To Public License"
readme = "README.md"
repository = "https://gitlab.com/mikeramsey/gitjirabot"
homepage = "https://gitlab.com/mikeramsey/gitjirabot"
keywords = ['git', 'jira', 'bot', 'integrations', 'automation']
packages = [ { include = "gitjirabot", from = "src" } ]
[tool.poetry.dependencies]
python = "^3.6"
atlassian-python-api = "^3.14.1"
python-gitlab = "^2.10.1"
[tool.poetry.dev-dependencies]
# formatting, quality, tests
autoflake = "^1.4"
black = "^20.8b1"
isort = "^5.7.0"
mypy = "^0.812"
pytest = "^6.2.2"
pytest-cov = "^2.11.1"
pytest-randomly = "^3.5.0"
pytest-sugar = "^0.9.4"
pytest-xdist = "^2.2.0"
# tasks
duty = "^0.6.0"
git-changelog = "^0.4.2"
httpx = "^0.16.1"
jinja2-cli = "^0.7.0"
toml = "^0.10.2"
# flake8 plugins
darglint = "^1.5.8"
flake8-bandit = "^2.1.2"
flake8-black = "^0.2.1"
flake8-bugbear = "^20.11.1"
flake8-builtins = "^1.5.3"
flake8-comprehensions = "^3.3.1"
flake8-docstrings = "^1.5.0"
flake8-pytest-style = "^1.3.0"
flake8-string-format = "^0.3.0"
flake8-tidy-imports = "^4.2.1"
flake8-variables-names = "^0.0.4"
pep8-naming = "^0.11.1"
wps-light = "^0.15.2"
# docs
mkdocs = "^1.1.2"
mkdocs-coverage = "^0.2.1"
mkdocs-macros-plugin = "^0.5.0"
mkdocs-material = "^6.2.7"
mkdocstrings = "^0.15.0"
[tool.poetry.scripts]
gitjirabot = "gitjirabot.cli:main"
[tool.black]
line-length = 120
exclude = "tests/fixtures"
[tool.isort]
line_length = 120
not_skip = "__init__.py"
multi_line_output = 3
force_single_line = false
balanced_wrapping = true
default_section = "THIRDPARTY"
known_first_party = "gitjirabot"
include_trailing_comma = true
I was hoping to be able to switch from poetry to pdm but until this issue is resolved doesn't look like i can yet.
I would just try to start a test project from : https://github.com/pawamoy/copier-pdm which is the Original posters thing and add one of the applicable things me or him mentioned.
I do agree it seem possibly related to those 'mkdocs, autoflake, flake8, black, python>=3.6' ones as those are the primary ones it shows when its stuck in a loop till it times out.
Thanks for your time and care into looking into it. This project looks pretty compelling and looking forward to using it in depth in the future ;)
I noticed nothing: after first generating a project, and starting the locking process, the resolution goes in a loop. If I interrupt it, and restart the locking process, it manages to finish resolving the deps. Just as if something got cached during the loop, that PDM was only able to use after restarting the locking process.
Anyone would volunteer to try to reduce the number of dependencies for reproducing the problem? It is a headache waiting for a long locking process and seeing success. Sorry but I just don't have enough energy to debug this issue.
I'll try to find some time @frostming 🙂
Experiencing the same issue with the latest pdm version in a couple of projects. Unfortunately, my project has a lot of dependencies (some of them private) so I can't provide a minimal example.
Here is a reduced set:
[build-system]
requires = ["pdm-pep517"]
build-backend = "pdm.pep517.api"
[project]
name = "pawamoy-testing"
version = "0.0.0"
description = "Testing this great template"
authors = [{name = "Timothee Mazzucotelli", email = "pawamoy@pm.me"}]
license = {file = "LICENSE"}
readme = "README.md"
requires-python = ">=3.6.2"
dependencies = []
[tool.pdm]
package-dir = "src"
[tool.pdm.dev-dependencies]
dev = [
"duty~=0.7",
"mkdocs-literate-nav~=0.4; python_version >= '3.7'",
"autoflake~=1.4",
"flake8-comprehensions~=3.7",
"flake8-docstrings~=1.6",
"flake8-string-format~=0.3",
"flake8-tidy-imports~=4.5",
"pytest-cov~=3.0",
"pytest-xdist~=2.4",
]
To replicate:
pdm lock
pdm add dependenpy -v # loop
Note that if I don't lock before adding the package (i.e. if I do pdm add dependenpy
directly), it manages to resolve everything. You have to lock a first time before adding the package to replicate.
I'll reopen a new issue if I experience it again! @JaviFuentes94 @meramsey let us know if #746 fixed it for you as well.
After updating the pdm by running installer again
Removing the pdm.lock
Then running pdm install
from the project root works now.
Thanks for resolving the issue @frostming looking forward to testing stuff out further now.
Steps to reproduce
Try resolving the following dependencies:
Actual behavior
The resolution will run until it reaches the ResolutionTooDeep limit. The problematic rounds show items more than once (duplicates).
Something like this (click to expand):
``` ======== Ending round 104 ======== ======== Starting round 105 ======== Adding requirement click>=3.3(from mkdocs 1.2.2) Found matching candidates:I was not able yet to reduce to the minimal set of dependencies triggering the issue. I'll try to find the time to do it. However if I remove some of the dependencies, PDM breaks out of the loop (or does not enter in one), and shows an actual resolution error, which is:
(Again, duplicate lines)
Of course if I depend on
importlib-metadata~=3.0
inpyproject,toml
, PDM is able to resolve. I just wanted to give a repro of the resolution loop, because it made it hard to understand what the actual issue was :slightly_smiling_face:Also, I can't confirm yet, but I think Poetry's resolver suffers from the same issue.
Expected behavior
No loop, show the actual incompatibilities.
Environment Information