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

6.0.0 has an undeclared dependency on importlib-metadata at python 3.6 #1352

Closed
dimbleby opened this issue Mar 14, 2021 · 9 comments · Fixed by #1353
Closed

6.0.0 has an undeclared dependency on importlib-metadata at python 3.6 #1352

dimbleby opened this issue Mar 14, 2021 · 9 comments · Fixed by #1353
Labels
bug Something is not working dependency Related to a dependency

Comments

@dimbleby
Copy link

dimbleby commented Mar 14, 2021

pip-compile from pip-tools 6.0 doesn't work at python 3.6, throws an error about failing to find importlib.metadata

Environment Versions

pip-tools 6.0.0, python 3.6.8 are the important ones

Steps to replicate

[root@72c74788e4f9 /]# python3 -m venv /tmp/pip_tools

[root@72c74788e4f9 /]# source /tmp/pip_tools/bin/activate

(pip_tools) [root@72c74788e4f9 /]# python --version
Python 3.6.8

(pip_tools) [root@72c74788e4f9 /]# pip install pip-tools
Collecting pip-tools
  Downloading https://files.pythonhosted.org/packages/8d/81/15daf8485a9a508ee0fbbc3be328329a96efba8263863eeec331fd7972d9/pip_tools-6.0.0-py3-none-any.whl (43kB)
    100% |████████████████████████████████| 51kB 764kB/s
Collecting click>=7 (from pip-tools)
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/d2/3d/fa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e/click-7.1.2-py2.py3-none-any.whl (82kB)
    100% |████████████████████████████████| 92kB 2.0MB/s
Collecting pip>=20.3 (from pip-tools)
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/fe/ef/60d7ba03b5c442309ef42e7d69959f73aacccd0d86008362a681c4698e83/pip-21.0.1-py3-none-any.whl (1.5MB)
    100% |████████████████████████████████| 1.5MB 879kB/s
Installing collected packages: click, pip, pip-tools
  Found existing installation: pip 9.0.3
    Uninstalling pip-9.0.3:
      Successfully uninstalled pip-9.0.3
Successfully installed click-7.1.2 pip-21.0.1 pip-tools-6.0.0

(pip_tools) [root@72c74788e4f9 /]# pip-compile --help

Expected result

Usage: pip-compile [OPTIONS] [SRC_FILES]...

  Compiles requirements.txt from requirements.in specs.

...

Actual result


Traceback (most recent call last):
  File "/tmp/pip_tools/lib64/python3.6/site-packages/pip/_vendor/pep517/meta.py", line 10, in <module>
    import importlib.metadata as imp_meta
ModuleNotFoundError: No module named 'importlib.metadata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/pip_tools/bin/pip-compile", line 7, in <module>
    from piptools.scripts.compile import cli
  File "/tmp/pip_tools/lib64/python3.6/site-packages/piptools/scripts/compile.py", line 12, in <module>
    from pip._vendor.pep517 import meta
  File "/tmp/pip_tools/lib64/python3.6/site-packages/pip/_vendor/pep517/meta.py", line 12, in <module>
    import importlib_metadata as imp_meta
ModuleNotFoundError: No module named 'importlib_metadata'
@wizpig64
Copy link
Contributor

wizpig64 commented Mar 14, 2021

I have the same issue on my 3.6 projects when they pip-compile.

But, if the import is coming from within pip, wouldn't this be pip's fault, for not depending on this properly when it vendored pep517?

edit: it looks like pep517 requires importlib_metadata for python<3.8

@dimbleby
Copy link
Author

pip is not broken, and I expect that pip maintainers would say: if pip-tools chooses to rely on the internals of pip, then it is pip-tools problem to make that work.

(I don't know why pip-tools doesn't depend on pep517 directly, probably there's a good reason)

@dimbleby
Copy link
Author

dimbleby commented Mar 14, 2021

I see there was discussion on whether or not to use pip's private vendored copy of pep517 at #1311 (comment)

FWIW I'm on team prefer-public-APIs, and I think this issue supports that. But, maintainer's choice!

@atugushev atugushev added bug Something is not working dependency Related to a dependency labels Mar 15, 2021
@atugushev
Copy link
Member

Hello @dimbleby,

Thanks for the report! Huh, that was overlooked somehow. The fix is on the way.

@Cheukting
Copy link

I have the same issue, it breaks my 3.6 and 3.7 builds. The patch 6.0.1 is not on PyPI yet, guess I will have to roll back to the previous version for now?

@vphilippon
Copy link
Member

FYI I'm attempting to get the 6.0.1 fix out right now, but the GH Actions seems to have a rather long queue time and having issues starting the job.
I'll keep you posted as soon as I get it through.

@Cheukting
Copy link

Cheukting commented Mar 15, 2021

Thanks. My GH action is not deploying my library as well.. guess GH action is down at the moment? Don't worry, I am back to 5.5.0 at the moment but is happy to use the new version when it's back up again.

Screenshot 2021-03-15 at 21 44 20

@vphilippon
Copy link
Member

There we go, pip-tools 6.0.1 is now released and available on PyPI! 🎉

@Cheukting
Copy link

Amazing! Thanks @vphilippon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working dependency Related to a dependency
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants