micheles/decorator

<=3.4.2 can't be installed with modern setuptools

bra-fsn opened this issue · 2 comments

Modern pip's dependency resolution sometimes walks through all available versions to gather dependency information. During this, with a bigger requirements.txt it tried to download/parse decorator==3.4.2, which failed with:

Collecting decorator
  Downloading decorator-3.4.2.tar.gz (6.1 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      error in decorator setup command: use_2to3 is invalid.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

This is with pip==22.1.2 and setuptools==62.6.0 on python 3.8.10.
It seems setuptools>58 causes the problem here, but I'm not sure what's the solution for this as it might not be possible to modify dependencies on already uploaded packages (and even if it's possible, it may not help).

Version 3.4.2 is 7 years old, meant to run for Python versions as old as 2.4, 2.5 (!)
Can't you set in your requirements to use decorator 5.1.1, the latest one? I understand that probably decorator is not a direct dependency of yours, but perhaps you can ask the project using it to bump their requirements.
If I yank version 3.4.2 pip will try to install 3.4.1 which will have the same error, so I would break things for people still using old Pythons (hopefully few people) without helping you.
I am not sure what to do, it looks like a problem of pip, perhaps there is a way to force it to use a specific version.

Yes, sorry, I guess it can't -and shouldn't- be handled on the package providers' side. pip's dependency resolution is flawed. :)
Sorry about the noise.