modularml / max

A collection of sample programs, notebooks, and tools which highlight the power of the MAX Platform
https://www.modular.com
Other
317 stars 41 forks source link

[Magic CLI] pixi.toml over-priortized, even when mojoproject added #219

Open DWSimmons opened 2 weeks ago

DWSimmons commented 2 weeks ago

If a project is created without the --mojoproject or --format mojoproject, a pixi.toml will be created. [Good, as expected] If a project then has a mojoproject then added, the project will say that it has added MAX, but then it will not show up on project list or be usable with magic run mojo or magic run max. [Not good.]

darin@home:/media/darin/M2/magic$ magic init pixi_domination
✔ Created /media/darin/M2/magic/pixi_domination/pixi.toml
darin@home:/media/darin/M2/magic$ magic init pixi_domination --format mojoproject
✔ Created /media/darin/M2/magic/pixi_domination/mojoproject.toml
✔ Added max >=24.4.0,<25
darin@home:/media/darin/M2/magic$ cd pixi_domination/
darin@home:/media/darin/M2/magic/pixi_domination$ magic shell
 . "/tmp/pixi_env_byh.sh"
darin@home:/media/darin/M2/magic/pixi_domination$  . "/tmp/pixi_env_byh.sh"
(pixi_domination) darin@home:/media/darin/M2/magic/pixi_domination$ magic run mojo --version
mojo: command not found
(pixi_domination) darin@home:/media/darin/M2/magic/pixi_domination$ magic run max --version
max: command not found
(pixi_domination) darin@home:/media/darin/M2/magic/pixi_domination$ magic list
✘ No packages found.
(pixi_domination) darin@home:/media/darin/M2/magic/pixi_domination$ magic --version
magic 0.2.3
ehsanmok commented 2 weeks ago

There should be only one manifest and an error if a user is creating more.

RefinedSoftwareLLC commented 2 weeks ago

In the last magic version (I have not tested on the just released version), I was having issues where magic was the one creating more pixi.toml files even though there was already a mojoproject.toml file. I recommend magic init be a no-op if run twice in a row, that it should detect any existing toml project file, and reuse (auto detect --format) or ask to convert if --format doesn't match. (--environment was not supported with --mojoproject in the last magic version.)