Skip to content

Commit

Permalink
Move from tomllib to tomli (#3714)
Browse files Browse the repository at this point in the history
  • Loading branch information
husseinmozannar authored Oct 9, 2024
1 parent 23fd92a commit 8e50e58
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 160 deletions.
1 change: 1 addition & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dev-dependencies = [
"mypy-protobuf",
"cookiecutter",
"poethepoet",
"tomli",
]

[tool.uv.sources]
Expand Down
6 changes: 3 additions & 3 deletions python/run_task_in_pkgs_if_exist.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
from pathlib import Path
from typing import List

import tomllib
import tomli
from poethepoet.app import PoeThePoet
from rich import print


def discover_projects(workspace_pyproject_file: Path) -> List[Path]:
with workspace_pyproject_file.open("rb") as f:
data = tomllib.load(f)
data = tomli.load(f)

projects = data["tool"]["uv"]["workspace"]["members"]

Expand All @@ -28,7 +28,7 @@ def discover_projects(workspace_pyproject_file: Path) -> List[Path]:

def extract_poe_tasks(file: Path) -> set[str]:
with file.open("rb") as f:
data = tomllib.load(f)
data = tomli.load(f)

tasks = set(data.get("tool", {}).get("poe", {}).get("tasks", {}).keys())

Expand Down
Loading

0 comments on commit 8e50e58

Please sign in to comment.