Skip to content

Commit 185eca1

Browse files
authored
Adapt to pixi-devenv 0.1.0 (#48)
Initially we envisioned `pixi.devenv.toml` files dependencies to be included as: ```toml includes = ["../core"] ``` However, in the end we went with a different syntax: ```toml [devenv] upstream = ["../core"] ```
1 parent 76e6c43 commit 185eca1

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
UNRELEASED
2+
----------
3+
4+
* Support `pixi-devenv 0.1.0` or later.
5+
6+
17
1.5.1 (2025-08-26)
28
------------------
39

src/deps/_tests/test_deps_cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def create_devenv_file(
7171
toml_path = root_dir / get_devenv_filename(flavor)
7272
env_content = []
7373
if relative_paths_to_root is not None:
74-
env_content.append("includes = [")
74+
env_content.append("[devenv]")
75+
env_content.append("upstream = [")
7576
# Use the extended version for half of the includes:
7677
# includes = [
7778
# { path = "../core" },

src/deps/deps_cli.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,10 @@ def get_shallow_dependencies(dev_env_file: Path) -> Sequence[Path]:
9292
case ".toml":
9393
import tomli
9494

95-
data = tomli.loads(dev_env_file.read_text(encoding="UTF-8"))
96-
if not data.get("includes"):
97-
return []
98-
9995
def get_relative_path(entry: str | dict[str, str]) -> str:
100-
"""Include entries have two possible formats:
96+
"""pixi-devenv entries have two possible formats:
10197
102-
includes = [
98+
devenv.upstream = [
10399
"../core",
104100
{ path = "../calc" },
105101
]
@@ -109,11 +105,16 @@ def get_relative_path(entry: str | dict[str, str]) -> str:
109105
else:
110106
return entry
111107

112-
return [
113-
Path(os.path.abspath(dev_env_file.parent / get_relative_path(p)))
114-
/ "pixi.devenv.toml"
115-
for p in data["includes"]
116-
]
108+
data = tomli.loads(dev_env_file.read_text(encoding="UTF-8"))
109+
match data:
110+
case {"devenv": {"upstream": upstream}} if upstream:
111+
return [
112+
Path(os.path.abspath(dev_env_file.parent / get_relative_path(p)))
113+
/ "pixi.devenv.toml"
114+
for p in upstream
115+
]
116+
case _:
117+
return []
117118
case ext: # pragma: no cover
118119
msg = f"Cannot parse files with extension {ext}"
119120
echo_error(msg)

0 commit comments

Comments
 (0)