pavelzw / pixi-pycharm

Conda shim for PyCharm that proxies pixi
https://pixi.sh/dev/ide_integration/pycharm
BSD 3-Clause "New" or "Revised" License
17 stars 0 forks source link

pixi-pycharm doesn't work with `pyproject.toml` configuration #11

Closed maawoo closed 5 months ago

maawoo commented 5 months ago

Description

I guess this is related to #10 as my PyCharm doesn't seem to want to add an environment called default. The Use existing environment-dropdown is just empty and I can't proceed:

image

Yes, the Load Environments-button has been clicked 😉

Versions

❯ pixi --version
pixi 0.19.1
❯ pixi list | grep pixi-pycharm
pixi-pycharm                   0.0.3           h707e725_0               7.8 KiB    conda  pixi-pycharm-0.0.3-h707e725_0.conda

PyCharm version: PyCharm 2024.1 (Professional Edition) Platform: macOS Sonoma

pavelzw commented 5 months ago

Pixi-pycharm writes logs to ~/.cache/pixi-pycharm.log. Do you see anything of interest there?

maawoo commented 5 months ago

Here is the entire output of the logs:

Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
Attempting to run: ['info', '--envs', '--json']
pavelzw commented 5 months ago

What happens when running

./.pixi/envs/default/libexec/conda info --envs --json

?

maawoo commented 5 months ago
>> ./.pixi/envs/default/libexec/conda info --envs --json

{
    "envs_dirs": [
        "/Users/marcowo/Documents/pypypy/woody/.pixi/envs"
    ],
    "conda_prefix": "/Users/marcowo/Documents/pypypy/woody/.pixi/envs",
    "envs": []
}
pavelzw commented 5 months ago

Hmm interesting, could you share your pixi.toml? The "envs" part shouldn't be [].

pavelzw commented 5 months ago

Do you by any chance use pyproject.toml instead of pixi.toml? This is currently not supported as pixi.toml is implicitly assumed: https://github.com/pavelzw/pixi-pycharm/blob/75c3a9731d7a2e96315c9a19f6a396263a1cbab6/conda#L18

maawoo commented 5 months ago

I guess that will be it. I have used a pyproject.toml. Any chance this will be supported in the near future given that pixi supports both formats now?

pavelzw commented 5 months ago

Yes, it's now on my radar 😄

I'll try to implement it soon, should be a fairly simple fix :)