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

tomllib is considered as third-party lib in py3.11 but it is built-in now #2007

Closed
NickVeld opened this issue Nov 23, 2022 · 6 comments · Fixed by #2040
Closed

tomllib is considered as third-party lib in py3.11 but it is built-in now #2007

NickVeld opened this issue Nov 23, 2022 · 6 comments · Fixed by #2040

Comments

@NickVeld
Copy link

NickVeld commented Nov 23, 2022

https://docs.python.org/3/library/tomllib.html

It can be a part of an "epic" called "Support for python3.11" #1996

Behavior before:

@@ -1,8 +1,10 @@
-import tomllib
from pathlib import Path
from typing import Generator
 
+import tomllib
...

Behavior after:
The message that everything is OK

Version: 5.10.1

@NickVeld
Copy link
Author

Workarounds:

pyproject.toml

[tool.isort]
extra_standard_library = ['tomllib']

setup.cfg

[isort]
extra_standard_library = tomllib

Action comments (not recommended)

import tomllib  # isort: skip

@NickVeld
Copy link
Author

Maybe built-in tomllib support can be enabled by py_version=311 when it is added #2008

@andersk
Copy link
Contributor

andersk commented Dec 12, 2022

This seems to have been fixed by #2024 (not released yet) with py_version=311.

@staticdev
Copy link
Collaborator

@andersk released, 5.11.0.

@bszonye
Copy link

bszonye commented Dec 15, 2022

This is still broken for me in isort 5.11.2 (on Ubuntu 22.10). I suspect that's because they're distributing Python 3.11.0rc2, which has the new feature, but that version is not technically >=3.11. I ran into that just the other day with another tool. I suspect this affects anybody running a pre-release version of Python 3.11.

@andersk
Copy link
Contributor

andersk commented Dec 15, 2022

No, it’s because #2024 had bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants