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

DEP: only depend on tomli in Python 3.10 and older, use standard lib otherwise #1391

Merged
merged 1 commit into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions asv/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
import importlib
from pathlib import Path

import tomli

from .console import log
from . import util, build_cache

if sys.version_info >= (3, 11):
import tomllib
else:
import tomli as tomllib

WIN = (os.name == "nt")


Expand Down Expand Up @@ -545,7 +548,7 @@ def __init__(self, conf, python, requirements, tagged_env_vars):
pyproject_path = Path.cwd() / "pyproject.toml"
if pyproject_path.exists():
with open(pyproject_path, "rb") as pyproject_file:
pyproject_data = tomli.load(pyproject_file)
pyproject_data = tomllib.load(pyproject_file)
requires = pyproject_data.get("build-system", {}).get("requires", [])
for requirement in requires:
self._base_requirements[f"pip+{requirement}"] = ""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [
"build",
"tabulate",
"virtualenv",
"tomli",
"tomli; python_version < '3.11'",
"colorama; platform_system == 'Windows'",
"pyyaml; platform_python_implementation != \"PyPy\"",
"pympler; platform_python_implementation != \"PyPy\"",
Expand Down