pixi icon indicating copy to clipboard operation
pixi copied to clipboard

`pixi init` broken with incomplete `pyproject.toml`

Open pavelzw opened this issue 10 months ago • 2 comments

❯ cat pyproject.toml
[build-system]
requires = ["setuptools", "wheel"]

❯ pixi init
  × failed to parse project manifest
   ╭─[pyproject.toml:1:1]
 1 │ [build-system]
   · ┬
   · ╰── Missing field `project`
 2 │ requires = ["setuptools", "wheel"]
   ╰────

I personally would prefer to still be able to use the pixi.toml workflow and not be forced to use pyproject.toml as the pyproject.toml workflow always(?) introduces [pypi-dependencies] as this results in other issues (#1046). Maybe a prompt asking whether pixi should init into pyproject.toml or pixi.toml?

pavelzw avatar Apr 16 '24 12:04 pavelzw

Another option would be to gate the pyproject.toml init behind the —pyproject flag for both new and existing pyproject.toml

olivier-lacroix avatar Apr 18 '24 09:04 olivier-lacroix

I guess that would makes sense, or spawn a interactive choice

ruben-arts avatar Apr 18 '24 10:04 ruben-arts

I believe we can close this issue, as pixi init is no more broken with incomplete pyproject.toml :-)

And the choice between pixi.toml / pyproject.toml on init is tracked in https://github.com/prefix-dev/pixi/issues/1615

olivier-lacroix avatar Aug 05 '24 08:08 olivier-lacroix

Fixed by #1640

Now you can do pixi init --format pixi But in interactive mode pixi init on a folder with a pyproject.toml you'll be asked to choose if you want to add to the pyproject or not.

ruben-arts avatar Aug 05 '24 11:08 ruben-arts