I'm running into an error in setuptools upgrading from 5.2.7 to 5.2.14. I'm stuck.
I'm sure I'm overlooking something simple. Here we go!
Python 3.8.10
This is a simple buildout upgrade so....
# Extend the version config file
extends =
# https://dist.plone.org/release/5.2.7/versions.cfg
https://dist.plone.org/release/5.2.14/versions.cfg
versions.cfg
versions = versions
(ignore versions.cfg - it's empty!)
That gets me into the "upgraded setuptools... restarting" loop most of us are aware of.... so let's upgrade buildout and setuptools manually:
requirements.txt
changes:
@@ -1,3 +1,3 @@
-setuptools==42.0.2
-zc.buildout==2.13.4
-wheel==0.34.2
+setuptools==65.7.0
+zc.buildout==3.0.1
+wheel==0.38.4
./bin/pip install -r requirements.txt
good results.
Now buildout runs and starts downloading new eggs for 5.2.14, but we start erroring out:
While:
Initializing.
Getting section buildout.
Initializing section buildout.
Getting option buildout:test-eggs.
Getting section instance.
Initializing section instance.
Installing recipe plone.recipe.zope2instance.
Getting distribution for 'transaction>=2.4'.
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/zc/buildout/buildout.py", line 2250, in main
buildout = Buildout(config_file, options,
--snip--
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/setuptools/wheel.py", line 167, in _convert_metadata
setup_dist = setuptools.Distribution(
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/setuptools/dist.py", line 475, in __init__
_Distribution.__init__(
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 283, in __init__
self.finalize_options()
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/setuptools/dist.py", line 898, in finalize_options
for ep in sorted(loaded, key=by_order):
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/setuptools/dist.py", line 897, in <lambda>
loaded = map(lambda e: e.load(), filtered)
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/setuptools/_vendor/importlib_metadata/__init__.py", line 196, in load
return functools.reduce(getattr, attrs, module)
AttributeError: type object 'Distribution' has no attribute '_finalize_feature_opts'
In the specific problem above, it was the transaction
package. It's not always there. Lately, I've seen collective.xmltestreport==2.0.2
While:
Installing.
Getting section test.
Initializing section test.
Installing recipe collective.xmltestreport.
Getting distribution for 'collective.xmltestreport==2.0.2'.
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/zc/buildout/buildout.py", line 2252, in main
getattr(buildout, command)(args)
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/zc/buildout/buildout.py", line 740, in install
[self[part]['recipe'] for part in install_parts]
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/zc/buildout/buildout.py", line 740, in <listcomp>
[self[part]['recipe'] for part in install_parts]
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/zc/buildout/buildout.py", line 1373, in __getitem__
options._initialize()
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/zc/buildout/buildout.py", line 1481, in _initialize
self.initialize()
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/zc/buildout/buildout.py", line 1487, in initialize
recipe_class = _install_and_load(reqs, 'zc.buildout', entry, buildout)
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/zc/buildout/buildout.py", line 1430, in _install_and_load
zc.buildout.easy_install.install(
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/zc/buildout/easy_install.py", line 971, in install
return installer.install(specs, working_set)
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/zc/buildout/easy_install.py", line 696, in install
for dist in self._get_dist(requirement, ws):
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/zc/buildout/easy_install.py", line 581, in _get_dist
dists = [_move_to_eggs_dir_and_compile(dist, self._dest)]
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/zc/buildout/easy_install.py", line 1913, in _move_to_eggs_dir_and_compile
unpacker(dist.location, tmp_dest)
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/lib/python3.8/site-packages/zc/buildout/easy_install.py", line 1847, in unpack_wheel
wheel.install_as_egg(os.path.join(dest, wheel.egg_name()))
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/eggs/setuptools-65.7.0-py3.8.egg/setuptools/wheel.py", line 110, in install_as_egg
self._install_as_egg(destination_eggdir, zf)
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/eggs/setuptools-65.7.0-py3.8.egg/setuptools/wheel.py", line 118, in _install_as_egg
self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/eggs/setuptools-65.7.0-py3.8.egg/setuptools/wheel.py", line 167, in _convert_metadata
setup_dist = setuptools.Distribution(
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/eggs/setuptools-65.7.0-py3.8.egg/setuptools/dist.py", line 475, in __init__
_Distribution.__init__(
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/eggs/setuptools-65.7.0-py3.8.egg/setuptools/_distutils/dist.py", line 283, in __init__
self.finalize_options()
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/eggs/setuptools-65.7.0-py3.8.egg/setuptools/dist.py", line 898, in finalize_options
for ep in sorted(loaded, key=by_order):
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/eggs/setuptools-65.7.0-py3.8.egg/setuptools/dist.py", line 897, in <lambda>
loaded = map(lambda e: e.load(), filtered)
File "/home/mcfaddenm/repos/plone5.2_clean/rfasite/rfasite/eggs/setuptools-65.7.0-py3.8.egg/setuptools/_vendor/importlib_metadata/__init__.py", line 196, in load
return functools.reduce(getattr, attrs, module)
AttributeError: type object 'Distribution' has no attribute '_finalize_feature_opts'
Debugging sent me deep into python package management. I don't belong in that code - unless someone else thinks the entire community needs to be there...
But no one else in Plone is seeing this... so it must be me being me?
Plan B is to supply a versions.cfg with the specific packages noted in 20230921 update, but that feels a bit dirty. Best to be on a nice, pinned Plone distribution.