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

not-from-a-package version is not PEP 440 compliant, breaking pip-compile #955

Open
StevenMaude opened this issue May 23, 2023 · 0 comments

Comments

@StevenMaude
Copy link
Contributor

StevenMaude commented May 23, 2023

When trying to rebuild the requirements:

$ pip-compile --extra=drivers --output-file=requirements.prod.txt setup.py
Backend subprocess exited when trying to invoke get_requires_for_build_wheel
Failed to parse …cohort-extractor/setup.py

This isn't a particularly helpful error (see jazzband/pip-tools#1711).

If you get information on the underlying subprocess error by modifying the build package, near the Backend subprocess exited when trying to invoke exception, then you see this warning from setuptools:

SetuptoolsDeprecationWarning: Invalid version: 'not-from-a-package'.

!!

********************************************************************************
The version specified is not a valid version according to PEP 440.
This may not work as expected with newer versions of
setuptools, pip, and PyPI.

By 2023-Sep-26, you need to update your project and remove deprecated calls\n
or your builds will no longer be supported.

See https://peps.python.org/pep-0440/ for details.

However the build actually does fail, even though we're not in September 2023 yet, due to the packaging package, vendored by setuptools; you get the following error that causes the pip-compile failure:

…
File "…/site-packages/setuptools/_vendor/packaging/version.py", line 197, in __init__
raise InvalidVersion(f"Invalid version: \'{version}\'")
setuptools.extern.packaging.version.InvalidVersion: Invalid version: \'not-from-a-package\'

This is with the existing provided requirements:

$ pip freeze # minimal virtualenv created with only: pip install pip-tools; with the pyproject_hooks package not listed in the requirements uninstalled
build==0.8.0
click==8.1.0
packaging==23.0
pep517==0.12.0
pip-tools==6.13.0
tomli==1.2.3
$ cat requirements.dev.txt | grep -E "^build|^click|^packaging|^pep517|^pip-tools|^tomli"
build==0.8.0
click==8.1.0
packaging==23.0
pep517==0.12.0
pip-tools==6.13.0
tomli==1.2.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant