Skip to content

Commit e431dbf

Browse files
Properly encode TOML data
1 parent 6167979 commit e431dbf

File tree

3 files changed

+65
-2
lines changed

3 files changed

+65
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Repository = "https://github.com/renan-r-santos/pixi-kernel"
5050
dev-dependencies = [
5151
"jupyter-kernel-test>=0.7",
5252
"jupyterlab>=4",
53+
"msgspec[toml]>=0.19.0",
5354
"mypy>=1",
5455
"pytest>=8",
5556
"pytest-asyncio>=1",

tests/unit/test_compatibility.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import tempfile
55
from pathlib import Path
66

7+
import msgspec
78
import pytest
89
from pixi_kernel.compatibility import find_pixi_binary
910
from returns.result import Failure, Success
@@ -59,11 +60,12 @@ def test_find_pixi_with_which(pixi_path: Path, monkeypatch: pytest.MonkeyPatch):
5960

6061
@pytest.mark.usefixtures("mock_which", "mock_get_default_pixi_path")
6162
def test_find_pixi_via_config_file(pixi_path: Path, config_path: Path):
62-
config_path.write_text(f'pixi-path = "{pixi_path}"')
63+
bytes = msgspec.toml.encode({"pixi-path": str(pixi_path)})
64+
config_path.write_bytes(bytes)
6365
result = find_pixi_binary()
6466

6567
assert isinstance(result, Success)
66-
assert result.unwrap() == str(pixi_path)
68+
assert Path(result.unwrap()) == pixi_path
6769

6870

6971
@pytest.mark.usefixtures("mock_which", "mock_get_default_pixi_path")

uv.lock

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

0 commit comments

Comments
 (0)