pixi icon indicating copy to clipboard operation
pixi copied to clipboard

Support PEP 508 specific extensions

Open davidbrochart opened this issue 10 months ago • 4 comments

Problem description

See https://github.com/prefix-dev/pixi/issues/1186#issuecomment-2058601959.

I cannot use pixi with jupyter-collaboration:

git clone https://github.com/jupyterlab/jupyter-collaboration.git
cd jupyter-collaboration
pixi init
  × failed to parse project manifest
    ╭─[pyproject.toml:11:16]
 10 │     requires-python = ">=3.8"
 11 │ ╭─▶ dependencies = [
 12 │ │       # jupyter-server extensions
 13 │ │       "jupyter-server-ydoc @ {root:uri}/projects/jupyter-server-ydoc",
 14 │ │       # jupyterlab/notebook frontend extensions
 15 │ │       "jupyter-collaboration-ui @ {root:uri}/projects/jupyter-collaboration-ui",
 16 │ │       "jupyter-docprovider @ {root:uri}/projects/jupyter-docprovider",
 17 │ │       # the metapackage
 18 │ │       "jupyter-collaboration @ {root:uri}/projects/jupyter-collaboration",
 19 │ ├─▶ ]
    · ╰──┤ relative path without a working directory: {root:uri}/projects/jupyter-server-ydoc
    ·    │ jupyter-server-ydoc @ {root:uri}/projects/jupyter-server-ydoc
    ·    │                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 20 │     dynamic = ["version"]
    ╰────

davidbrochart avatar Apr 17 '24 07:04 davidbrochart

I think resolving this would require implementation in pixi’s dependency https://github.com/konstin/pep508_rs

would you consider opening an issue there?

olivier-lacroix avatar Apr 17 '24 21:04 olivier-lacroix

Alternatively, I believe you should be able to use ${PROJECT_ROOT} in your paths, and they should be expanded correctly

olivier-lacroix avatar Apr 17 '24 22:04 olivier-lacroix

@olivier-lacroix @davidbrochart pep508_rs allows for these extensions. https://github.com/PyO3/pyproject-toml-rs does not. But it would be kinda difficult because you would need to give the directory that path is relative to during deserialization.

tdejager avatar Apr 18 '24 08:04 tdejager

Alternatively, I believe you should be able to use ${PROJECT_ROOT} in your paths, and they should be expanded correctly

This can only be used in an environment e.g using tasks or pixi shell. And its ${PROJECT_ROOT}.

tdejager avatar Apr 18 '24 10:04 tdejager