From 104a94e79567ccbf8bee230539c4731b79e85e59 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Fri, 10 May 2024 16:41:54 -0400 Subject: [PATCH] Remove tomli and tomli-w --- dependencies.yaml | 3 +-- pyproject.toml | 3 +-- tests/conftest.py | 11 +++++------ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/dependencies.yaml b/dependencies.yaml index b945ac6..9357526 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -77,8 +77,7 @@ dependencies: - PyYAML - packaging - rapids-dependency-file-generator>=1.13.3,<2.0.dev0 - - tomli - - tomli-w + - tomlkit test: common: - output_types: [conda, requirements, pyproject] diff --git a/pyproject.toml b/pyproject.toml index b57f161..abaf7f1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,8 +15,7 @@ dependencies = [ "PyYAML", "packaging", "rapids-dependency-file-generator>=1.13.3,<2.0.dev0", - "tomli", - "tomli-w", + "tomlkit", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit dependencies.yaml and run `rapids-dependency-file-generator`. license = { text = "Apache 2.0" } readme = { file = "README.md", content-type = "text/markdown" } diff --git a/tests/conftest.py b/tests/conftest.py index 75e68d8..68ff26e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -11,8 +11,7 @@ from pathlib import Path import pytest -import tomli -import tomli_w +import tomlkit from jinja2 import Environment, FileSystemLoader from packaging.version import parse as parse_version @@ -179,14 +178,14 @@ def wheelhouse(tmp_path_factory, pip_cache): ) pyproject_file = rapids_build_backend_build_dir / "pyproject.toml" - with open(pyproject_file, "rb") as f: - pyproject = tomli.load(f) + with open(pyproject_file) as f: + pyproject = tomlkit.load(f) project_data = pyproject["project"] version = parse_version(project_data["version"]) project_data["version"] = f"{version.major + 1}.{version.minor}.{version.micro}" - with open(pyproject_file, "wb") as f: - tomli_w.dump(pyproject, f) + with open(pyproject_file, "w") as f: + tomlkit.dump(pyproject, f) subprocess.run( [