-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Python 3.10 raises ModuleNotFoundError in cattrs/_compat.py #369
Comments
Seeing the same error in this automation run |
I'm hitting the same error, here's the root cause of the problem: In https://github.com/python-attrs/cattrs/blob/00932450fb27d8c6a53697244ae033b13916489b/src/cattrs/_compat.py#L369-#L372 Line 26 in 0093245
|
FYI, a quick fix (besides restricting 23.1.0 exactly, which there's already an example of above) is to add the transitive dependency, like in scikit-build/scikit-build-core@4b6dcfb. |
Thanks, I'll put out a 23.1.1 with this fix. I guess one of our dev dependencies pulled in This is an easy fix, but a more troubling issue is - how do we prevent stuff like this in the future? :/ |
23.1.1 has been published to PyPI, thanks everyone. |
I might as well yank 23.1.0, right? |
Won't hurt to yank. |
Yanked. |
This is an excellent question, and I'm not sure I have a great answer. Probably not on try/except blocks, but it does seem like static version comparisons blocks could be validated by a tool, but I don't know of one (and if there was one, it probably would be based on PEP 621, not Poetry 1's custom format). Things like mypy can validate the correct version settings, but they can't verify that you are requiring the correct dependencies - mypy often uses stubs, so it's not even the same list. For a dynamic check, running an "example" as an integration test that doesn't have testing deps, but just runs some code to see if it passes, with no extra dependencies, would help catch this sort of thing. You can also make a "downstream" tester, like ruff & mypy do. I've done that via a manual nox job in scikit-build/scikit-build-core. It's different enough for build systems that you'd probably not get much out of starting from that, though. |
I am not sure what I should expect to see, or if this is the right place to talk about it, but I was looking at what updating to 23.1.0 on Fedora Rawhide would look like, and I encountered quite a few test failures with Python 3.11.3,
One of these is:
The rest are something like:
All of these test failures disappear if I patch |
Could you please push the git tag? Thanks! |
Tag pushed, whoops |
Howdy, let's open a new issue for this. How are you setting up your test environment? For me, |
One of the Python test harnesses (perhaps more that one) allow you to iterate the test over multiple Python versions. Sorry but I can't remember which test harness that is (I've used too many), maybe someone else recalls. |
Well, this is the RPM build environment for Fedora Linux, so we’re not letting
Indeed, So if |
@musicinmybrain Yeah, the idea is you don't need |
Description
In python 3.10, the import of cattrs/_compat is throwing a ModuleNotFoundError.
What I Did
An automated pipeline we are using started throwing a ModuleNotFoundError today. This appears to be related to #364, where the import is not catching the correct exceptions for importing typing_extensions.
The text was updated successfully, but these errors were encountered: