Skip to content

Commit 1908cff

Browse files
authored
refactor: replace tomlkit with stdlib tomllib (#1664)
Closes #1746
1 parent 5884bfd commit 1908cff

3 files changed

Lines changed: 3 additions & 15 deletions

File tree

‎pyproject.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ dependencies = [
3333
"opentelemetry-instrumentation-fastapi>=0.48b0",
3434
"observability-utils>=0.1.4",
3535
"pyjwt[crypto]",
36-
"tomlkit",
3736
"graypy>=2.1.0",
3837
"httpx>=0.28.1",
3938
"aiohttp>=3.13.5",

‎src/blueapi/cli/scratch.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
import os
44
import stat
55
import textwrap
6+
import tomllib
67
from concurrent.futures import ThreadPoolExecutor, as_completed
78
from pathlib import Path
89
from subprocess import Popen
910

1011
from git import Repo
11-
from tomlkit import parse
1212

1313
from blueapi.config import FORBIDDEN_OWN_REMOTE_URL, ScratchConfig
1414
from blueapi.service.model import PackageInfo, PythonEnvironmentResponse, SourceInfo
@@ -183,8 +183,8 @@ def _validate_directory(path: Path) -> None:
183183
def _get_project_name_from_pyproject(path: Path) -> str:
184184
pyproject_path = path / "pyproject.toml"
185185
if pyproject_path.exists():
186-
with pyproject_path.open("r", encoding="utf-8") as file:
187-
toml_data = parse(file.read())
186+
with pyproject_path.open("rb") as file:
187+
toml_data = tomllib.load(file)
188188
return toml_data.get("project", {}).get("name", "")
189189
return ""
190190

‎uv.lock‎

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)