Closed pawamoy closed 2 years ago
This may require a coordinated release of py and apipkg, im not sure if I have the near term capacity
If the pending apipkg 2 can work, ill haste the release
Else i need to find time/motivation to fix apipkg for python 3.11
Well there's no rush of course, as Python 3.11 is not gonna be released soon :slightly_smiling_face: If you can give directions on how to tackle this, maybe someone else will be willing to do it!
First a verification of standalone apipkg is needed, then after fix it has to be included in the vendored items
The cause of this error I tracked down to this change (commit 0a8ae8a50a0fea3d39ec49b220a5c7a5b70e36f8 in cpython): 'bpo-44717: improve AttributeError on circular imports of submodules (GH-27338)' https://bugs.python.org/issue44717
it introduces the parent = parent_module.__spec__
line in importlib.
AttributeError: __spec__
(which is thrown from importlib, while KeyError
in apipkg is being handled)
The latest master and modernization branches fix the issue in pytest (and apipkg standalone) for me.
From the stack in importlib:
File /data/media/0/src/python3/src/Lib/importlib/_bootstrap.py, line 1044, in _find_and_load
return _find_and_load_unlocked(name, import_):
File /data/media/0/src/python3/src/Lib/importlib/_bootstrap.py, line 994, in _find_and_load_unlocked
_call_with_frames_removed(import_, parent):
File /data/media/0/src/python3/src/Lib/importlib/_bootstrap.py, line 241, in _call_with_frames_removed
return f(*args, **kwds):
File /data/media/0/src/python3/src/Lib/importlib/_bootstrap.py, line 1044, in _find_and_load
return _find_and_load_unlocked(name, import_):
File /data/media/0/src/python3/src/Lib/importlib/_bootstrap.py, line 1004, in _find_and_load_unlocked
parent_spec = parent_module.__spec__:
@greyblue9 thansk for the update, so i will update the vendored copy next
@greyblue9 i finished the upgrade of the vendored copy, it be neat to get a quick verify just in case so we can prepare a release
I copied the contents of https://github.com/pytest-dev/apipkg/blob/main/src/apipkg/__init__.py into ~/.cache/pdm/packages/py-1.10.0-py2.py3-none-any/lib/py/_vendored_packages/apipkg/__init__.py
(this is where PDM installs the py
package), ran tests again on Python 3.11, and they passed :+1:
@pawamoy awesome, thanks
Now when Python 3.11.0a1 is out, we (Fedora) got hit by this on our CI.
@greyblue9 i finished the upgrade of the vendored copy, it be neat to get a quick verify just in case so we can prepare a release
Sorry, I didn't see your comment until just now. What should I do to verify?
@greyblue9 no longer needed, initial verification already happened, we need to release now
@greyblue9 no longer needed, initial verification already happened, we need to release now
thanks @RonnyPfannschmidt , let me know if I can be of any further help
@RonnyPfannschmidt Is there anything we can do to expedite the release? We are reporting Python 3.11 test failures to various other open source projects and broken pytest makes it harder to reproduce them for their maintainers. Re-installing py from the master branch works. Let me know if you need to check this py change on all Fedora packages to see if it doesn't break anything else, or if there is anything else we can do. Thanks ;)
@hroncok thanks for the ping, i completely forgot that #277 was already preparing that over my cold im preparing to push a tag once hugos pr passes with the updated date
@hroncok release is out, happy testing
closing as released
JC the Python ecosystem is a disaster...
Running pytest on Python 3.11:
Note: I'm using PDM which uses .pth files in
__pypackages__
that point to actual installed packages in~/.cache/pdm/packages
(it allows dedup of packages across projects, saving space and installation time). Not sure this has to do with the issue, but I hear py/apipkg do some black magic on themselves, so this might conflict. It works well on other Python versions though (3.8, 3.9 and 3.10).