chore: use tomllib on Python 3.11 (#1047)

* Use tomllib on Python 3.11

* delint

Co-authored-by: hauntsaninja <>
This commit is contained in:
Shantanu
2022-04-16 00:00:57 -04:00
committed by GitHub
co-authored by hauntsaninja <>
parent 9ae6ae2756
commit 6d4431306e
8 changed files with 48 additions and 16 deletions
+5 -2
View File
@@ -18,7 +18,10 @@ from typing import (
Union,
)
import tomli
if sys.version_info >= (3, 11):
import tomllib
else:
import tomli as tomllib
from packaging.specifiers import SpecifierSet
from .architecture import Architecture
@@ -244,7 +247,7 @@ class OptionsReader:
Load a toml file, returns global and platform as separate dicts.
"""
with filename.open("rb") as f:
config = tomli.load(f)
config = tomllib.load(f)
global_options = config.get("tool", {}).get("cibuildwheel", {})
platform_options = global_options.get(self.platform, {})