pdm-project / pdm

A modern Python package and dependency manager supporting the latest PEP standards
https://pdm-project.org
MIT License
7.81k stars 386 forks source link

`pdm install` with implicit import from setup.py (non-PEP621) cannot resolve any dependencies #2608

Closed intelfx closed 7 months ago

intelfx commented 7 months ago

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

Steps to reproduce

  1. Check out any project that does not use PEP 621-compliant metadata, for example, liquidctl/liquidctl
  2. Attempt to run pdm install
  3. Agree to import from setup.cfg using "setuppy"

Actual behavior

pdm generates a massive amount of dependency resolution failure messages reporting absence of required-python configuration, ending up in a failure to import the project:

<...>
/home/intelfx/devel/ext/pdm/src/pdm/resolver/providers.py:202: PackageWarning: Skipping colorlog@6.8.2 because it requires Python>=3.6 but the project claims to work with all Python versions. Instead, another
version of colorlog that supports all Python versions will be used.
If you want to install colorlog@6.8.2, narrow down the `requires-python` range to include this version. For example, ">=3.6" should work.
  return self.repository.find_candidates(
<...>

Full pdm install -vv log

Expected behavior

Project successfully imported, taking into account the python_requires option set in setup.cfg.

Environment Information

$ pdm info && pdm info --env
PDM version:
  2.12.3+editable
Python Interpreter:
  /home/intelfx/devel/ext/liquidctl/.venv/bin/python (3.11)
Project Root:
  /home/intelfx/devel/ext/liquidctl
Local Packages:

{
  "implementation_name": "cpython",
  "implementation_version": "3.11.6",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "6.7.3-arch1pf5-2",
  "platform_system": "Linux",
  "platform_version": "#1 SMP PREEMPT_DYNAMIC Thu, 01 Jan 1970 00:00:00 +0000",
  "python_full_version": "3.11.6",
  "platform_python_implementation": "CPython",
  "python_version": "3.11",
  "sys_platform": "linux"
}
frostming commented 7 months ago

Thanks, before the fix is released you can run pdm install again and it will work.