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

uv add textract fails with parse error on requires #9194

Closed
DRMacIver opened this issue Nov 18, 2024 · 8 comments
Closed

uv add textract fails with parse error on requires #9194

DRMacIver opened this issue Nov 18, 2024 · 8 comments
Labels
compatibility Compatibility with a specification or another tool

Comments

@DRMacIver
Copy link

Running uv add textract==1.6.4 on uv version 0.3.2 (on OSX if relevant) produces the following error:

⠹ textract==1.6.4                                                                                                                                                                                                     error: Failed to download and build `textract==1.6.4`
  Caused by: Build backend failed to determine extra requires with `build_wheel()` with exit status: 1
--- stdout:

--- stderr:
error in textract setup command: 'install_requires' must be a string or iterable of strings containing valid project/version requirement specifiers; .* suffix can only be used with `==` or `!=` operators
    extract-msg<=0.29.*
               ~~~~~~~^
---

The package in question pip installs fine.

This is presumably just the uv requirement parser being stricter than pip's, and this particular requirements construct is just sufficiently unusual to see in the wild that it hasn't come up before.

@DRMacIver DRMacIver changed the title .* suffix can only be used with == or != operators uv add textract fails with ".* suffix can only be used with == or != operators" Nov 18, 2024
@DRMacIver DRMacIver changed the title uv add textract fails with ".* suffix can only be used with == or != operators" uv add textract fails with parse error on requires Nov 18, 2024
@charliermarsh
Copy link
Member

Yeah that is an invalid specifier -- wildcards are only allowed on == and != specifiers. We have a "fixup" system that can handle cases like that, though. I guess it's intended to be <=0.29.

@charliermarsh charliermarsh added the compatibility Compatibility with a specification or another tool label Nov 18, 2024
@charliermarsh
Copy link
Member

Oh sorry, I think this is actually setuptools raising the error, and not uv, in which case... there isn't much we can do about it. I think the best you can do is add --build-constraint constraints.txt, and set a constraint to use an older version of setuptools. Sorry!

@DRMacIver
Copy link
Author

If the error is purely setuptools related, why does pip install work with the same package specifier?

@charliermarsh
Copy link
Member

Are pip and uv using the same version of Python? Is the package already cached by pip from some other install on your machine? Do you see the same behavior with pip install --use-pep517 --no-cache --force-reinstall?

@DRMacIver
Copy link
Author

Same version of Python. Also correctly installs with uv pip install. Not cached. But indeed --use-pep517 does cause pip to exhibit the same error.

@charliermarsh
Copy link
Member

Okay thanks, got it. That means the package is indeed broken with that version of setuptools, and the same breakage will occur in future versions of PEP, once --use-pep517 is made the default.

@konstin
Copy link
Member

konstin commented Nov 18, 2024

For me locally, pip install textract==1.6.4 errors on both Python 3.10 and Python 3.13 on ubuntu 24.04. My guess would be that the package is still in the pip cache, and was built before pypa/packaging#407, which was released a packaging 22.0 which was merged in setuptools 67.0.0. Before packaging 22.0 pip and setuptools were much more lenient with version specifiers, afterwards they started only accepting spec-compliant versions.

@DRMacIver
Copy link
Author

Fair enough. In fact, I went to file a bug at textract and discovered this is already filed with them as an issue: deanmalmgren/textract#533 (I didn't think to check there first because it seemed to work with pip).

Not that this necessarily matters to you, but it doesn't look very likely that's going to be fixed any time soon, as the package appears... lightly maintained. It would be good to have some way to work around this problem for similar issues, but that probably has to be on the setuptools side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with a specification or another tool
Projects
None yet
Development

No branches or pull requests

3 participants