Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add flakeheaven dependency. #908

Closed
1 task done
lyz-code opened this issue Feb 14, 2022 · 4 comments
Closed
1 task done

Unable to add flakeheaven dependency. #908

lyz-code opened this issue Feb 14, 2022 · 4 comments
Labels
🐛 bug Something isn't working

Comments

@lyz-code
Copy link
Contributor

lyz-code commented Feb 14, 2022

  • I have searched the issue tracker and believe that this is not a duplicate.

Make sure you run commands with -v flag before pasting the output.

Steps to reproduce

virtualenv env
source env/bin/activate
git clone https://github.com/lyz-code/clinv
cd clinv
git checkout feat/add-resources
pdm add -G lint flakeheaven -v

Actual behavior

The dependency is not added, and it enters in an endless loop

D79GJ7

Could it be due to their python specifier?

[tool.poetry.dependencies]
python = "^3.6.2"

It's similar to #627 but that one was supposed to be fixed

Expected behavior

Dependency is added

Environment Information

# Paste the output of `pdm info && pdm info --env` below:
PDM version:        1.12.8
Python Interpreter: /tmp/tmp.2tKueA2EmA/env/bin/python (3.9)
Project Root:       /tmp/tmp.2tKueA2EmA/clinv
Project Packages:   None
{
  "implementation_name": "cpython",
  "implementation_version": "3.9.8",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "4.19.0-5-amd64",
  "platform_system": "Linux",
  "platform_version": "#1 SMP Debian 4.19.37-5+deb10u1 (2019-07-19)",
  "python_full_version": "3.9.8",
  "platform_python_implementation": "CPython",
  "python_version": "3.9",
  "sys_platform": "linux"
}
@lyz-code lyz-code added the 🐛 bug Something isn't working label Feb 14, 2022
@pawamoy
Copy link
Contributor

pawamoy commented Feb 14, 2022

Currently experiencing resolution loops as well with PDM 1.12.8. No further details yet.

@pawamoy
Copy link
Contributor

pawamoy commented Feb 14, 2022

We've been able to fix it on our side by removing upper bounds of internal projects' dependencies. We just fixed the symptom though!

@frostming
Copy link
Collaborator

frostming commented Feb 15, 2022

It fails because flakeheaven sets a hard upper bound of importlib-metadata, causing conflicts:

Conflicts detected:
  importlib-metadata<2.0,>=1.0; python_version < "3.8" (from <Candidate flakeheaven 0.11.1 from https://pypi.org/simple/flakeheaven/>)
  importlib-metadata; python_version < "3.8" (from <Candidate click 8.0.3 from unknown>)
  importlib-metadata<4.3; python_version < "3.8" (from <Candidate flake8 4.0.1 from unknown>)
  importlib-metadata; python_version < "3.8" (from <Candidate flake8-comprehensions 3.7.0 from https://pypi.org/simple/flake8-comprehensions/>)
  importlib-metadata>=0.9; python_version < "3.8" (from <Candidate flake8-simplify 0.14.5 from https://pypi.org/simple/flake8-simplify/>)
  importlib-metadata>=0.9; python_version < "3.8" (from <Candidate flake8-typing-imports 1.11.0 from https://pypi.org/simple/flake8-typing-imports/>)
  importlib-metadata>=3.10 (from <Candidate mkdocs 1.2.3 from unknown>)
  importlib-metadata<2.0,>=1.0; python_version < "3.8" (from <Candidate flakeheaven 0.11.1 from https://pypi.org/simple/flakeheaven/>)
  importlib-metadata; python_version < "3.8" (from <Candidate click 8.0.3 from unknown>)
  importlib-metadata<4.3; python_version < "3.8" (from <Candidate flake8 4.0.1 from unknown>)
  importlib-metadata; python_version < "3.8" (from <Candidate flake8-comprehensions 3.7.0 from https://pypi.org/simple/flake8-comprehensions/>)
  importlib-metadata>=0.9; python_version < "3.8" (from <Candidate flake8-simplify 0.14.5 from https://pypi.org/simple/flake8-simplify/>)
  importlib-metadata>=0.9; python_version < "3.8" (from <Candidate flake8-typing-imports 1.11.0 from https://pypi.org/simple/flake8-typing-imports/>)
  importlib-metadata>=3.10 (from <Candidate mkdocs 1.2.3 from https://pypi.org/simple/mkdocs/>)
  importlib-metadata<2.0,>=1.0; python_version < "3.8" (from <Candidate flakeheaven 0.11.1 from https://pypi.org/simple/flakeheaven/>)
  importlib-metadata; python_version < "3.8" (from <Candidate click 8.0.3 from unknown>)
  importlib-metadata<4.3; python_version < "3.8" (from <Candidate flake8 4.0.1 from unknown>)
  importlib-metadata; python_version < "3.8" (from <Candidate flake8-comprehensions 3.7.0 from https://pypi.org/simple/flake8-comprehensions/>)
  importlib-metadata>=0.9; python_version < "3.8" (from <Candidate flake8-simplify 0.14.5 from https://pypi.org/simple/flake8-simplify/>)
  importlib-metadata>=0.9; python_version < "3.8" (from <Candidate flake8-typing-imports 1.11.0 from https://pypi.org/simple/flake8-typing-imports/>)
  importlib-metadata>=3.10 (from <Candidate mkdocs 1.2.3 from https://pypi.org/simple/mkdocs/>)
Candidate rejected: flake8-typing-imports 1.11.0

Currently, the resolver has to traverse the dependency tree back and try every older version until it can't find one satisfying the version constraints or the maximum resolution round(10000) is reached. So it looks like an infinite loop.

As a workaround, you can manually set the resolution of importlib-metadata with [tool.pdm.overrides] table. See the doc for how to do this.

@lyz-code
Copy link
Contributor Author

Thanks for the solution @frostming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants