Page MenuHomePhabricator

CI with hacking 4.1 and new importlib-metadata 5.1 fails
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

install hacking with Python 3.7. Dependencies are hacking 4.1.0, flake 3.8.4, (new) importlib-metadata 5.1 and others

What happens?:

22:50:52 hacking-py37 run-test: commands[1] | flake8 --version
22:50:52 [611] /src$ /src/.tox/hacking-py37/bin/flake8 --version
22:50:52 Traceback (most recent call last):
22:50:52   File "/src/.tox/hacking-py37/bin/flake8", line 8, in <module>
22:50:52     sys.exit(main())
22:50:52   File "/src/.tox/hacking-py37/lib/python3.7/site-packages/flake8/main/cli.py", line 22, in main
22:50:52     app.run(argv)
22:50:52   File "/src/.tox/hacking-py37/lib/python3.7/site-packages/flake8/main/application.py", line 363, in run
22:50:52     self._run(argv)
22:50:52   File "/src/.tox/hacking-py37/lib/python3.7/site-packages/flake8/main/application.py", line 350, in _run
22:50:52     self.initialize(argv)
22:50:52   File "/src/.tox/hacking-py37/lib/python3.7/site-packages/flake8/main/application.py", line 330, in initialize
22:50:52     self.find_plugins(config_finder)
22:50:52   File "/src/.tox/hacking-py37/lib/python3.7/site-packages/flake8/main/application.py", line 153, in find_plugins
22:50:52     self.check_plugins = plugin_manager.Checkers(local_plugins.extension)
22:50:52   File "/src/.tox/hacking-py37/lib/python3.7/site-packages/flake8/plugins/manager.py", line 357, in __init__
22:50:52     self.namespace, local_plugins=local_plugins
22:50:52   File "/src/.tox/hacking-py37/lib/python3.7/site-packages/flake8/plugins/manager.py", line 238, in __init__
22:50:52     self._load_entrypoint_plugins()
22:50:52   File "/src/.tox/hacking-py37/lib/python3.7/site-packages/flake8/plugins/manager.py", line 254, in _load_entrypoint_plugins
22:50:52     eps = importlib_metadata.entry_points().get(self.namespace, ())
22:50:52 AttributeError: 'EntryPoints' object has no attribute 'get'

This is due to new importlib-metadata 5.1 change published yesterday.

Previous hacking tests installed:

hacking-py37 installed: certifi==2022.9.24,charset-normalizer==2.1.1,flake8==3.8.4,hacking==4.1.0,idna==3.4,importlib-metadata==4.13.0,mccabe==0.6.1,pycodestyle==2.6.0,pyflakes==2.2.0,# Editable Git install with no remote (pywikibot==8.0.0.dev0),-e /src,requests==2.28.1,typing_extensions==4.4.0,urllib3==1.26.13,zipp==3.10.0

but now we get

hacking-py37 installed: certifi==2022.9.24,charset-normalizer==2.1.1,flake8==3.8.4,hacking==4.1.0,idna==3.4,importlib-metadata==5.1.0,mccabe==0.6.1,pycodestyle==2.6.0,pyflakes==2.2.0,# Editable Git install with no remote (pywikibot==8.0.0.dev0),-e /src,requests==2.28.1,typing_extensions==4.4.0,urllib3==1.26.13,zipp==3.10.0

The difference is importlib-metadata which jumps from 4.13.0 to 5.1.0 (note that 5.0.0 is not used previously)

Event Timeline

Xqt triaged this task as High priority.Nov 25 2022, 8:54 AM
Xqt changed the task status from Open to In Progress.Nov 25 2022, 8:59 AM
Xqt claimed this task.
Xqt updated the task description. (Show Details)

Change 860479 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [tests] Update flake tests on jenkins CI

https://gerrit.wikimedia.org/r/860479

Change 860479 merged by jenkins-bot:

[pywikibot/core@master] [tests] Update flake tests on jenkins CI

https://gerrit.wikimedia.org/r/860479

Change 860845 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@tests] [tests] Update flake tests on jenkins CI

https://gerrit.wikimedia.org/r/860845

Change 860845 merged by jenkins-bot:

[pywikibot/core@tests] [tests] Update flake tests on jenkins CI

https://gerrit.wikimedia.org/r/860845

Change 877114 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [flake8] hacking importlib-metadata dependency should be solved with v6

https://gerrit.wikimedia.org/r/877114

Change 877114 merged by jenkins-bot:

[pywikibot/core@master] [flake8] hacking importlib-metadata dependency should be solved with v6

https://gerrit.wikimedia.org/r/877114

Xqt removed Xqt as the assignee of this task.

Reopened. After removal of hacking 3.6 tests this task occurres again.