Skip to content

Commit ea8861d

Browse files
committed
WIP pixi from pyproj [ci skip]
1 parent 4a03f47 commit ea8861d

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

tools/write-pixi-toml.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import tomlkit
2+
import tomllib
3+
4+
with open("../pyproject.toml", "rb") as fid:
5+
foo = tomllib.load(fid)
6+
7+
# in keys: build-system, dependency-groups, project, tool
8+
9+
# out keys: workspace, dependencies, pypi-dependencies (may need tasks)
10+
out = dict()
11+
workspace = dict(
12+
authors=["MNE-Python contributors"],
13+
channels=["conda-forge"],
14+
name=foo["project"]["name"],
15+
platforms=["osx-64"],
16+
version="0.1.0",
17+
)
18+
dependencies = foo["project"]["dependencies"]
19+
dependencies.extend(foo["dependency-groups"]["test"])
20+
dependencies.extend(foo["dependency-groups"]["test_extra"])
21+
dependencies.extend(foo["project"]["optional-dependencies"]["hdf5"])
22+
dependencies.extend(foo["project"]["optional-dependencies"]["full-no-qt"])
23+
dependencies.extend(foo["project"]["optional-dependencies"]["full-pyside6"])
24+
dependencies = list(
25+
filter(lambda x: isinstance(x, str) and "mne[" not in x, dependencies)
26+
)
27+
dependencies = sorted(set(dependencies))
28+
29+
out = {"workspace": workspace, "dependencies": dependencies, "pypi-dependencies": []}
30+
31+
with open("pixi-new.toml", "w") as fid:
32+
tomlkit.dump(out, fid, sort_keys=True)

0 commit comments

Comments
 (0)