Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.3k
Switch from toml to tomli for TOML v1 support#10824
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,2 @@ | ||
| -r mypy-requirements.txt | ||
| types-typed-ast>=1.4.0,<1.5.0 | ||
| types-toml>=0.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| typing_extensions>=3.7.4 | ||
| mypy_extensions>=0.4.3,<0.5.0 | ||
| typed_ast>=1.4.0,<1.5.0 | ||
| toml | ||
| tomli<2.0.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -433,9 +433,9 @@ def _is_compatible_stub_package(self, stub_dir: str) -> bool: | ||
| metadata_fnam = os.path.join(stub_dir, 'METADATA.toml') | ||
| if os.path.isfile(metadata_fnam): | ||
| # Delay import for a possible minor performance win. | ||
| import toml | ||
| with open(metadata_fnam, 'r') as f: | ||
| metadata = toml.load(f) | ||
| import tomli | ||
| with open(metadata_fnam, 'r', encoding="utf-8") as f: | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TOML spec requires UTF-8, so added the | ||
| metadata = tomli.load(f) | ||
| if self.python_major_ver == 2: | ||
| return bool(metadata.get('python2', False)) | ||
| else: | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the discussion in #10219 it seemed like OrderedDict was only needed by Python 3.5 which is no longer supported, so guessing we don't need it anymore?