Closed benmoss closed 1 week ago
mkdir pixi_env
touch pixi_env/__init__.py
seems to fix this, but this is a bit of a rough piece of default behavior. Maybe pixi should init this folder structure?
I agree, it would be nice if we add that file immediately too.
Not a bad idea indeed. Note however that there are two typical layouts, which means that pixi would force that choice on users. Should pixi generate a flat, or src layout ? See https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/#src-layout-vs-flat-layout for instance
@olivier-lacroix I think if we just agree on one users can always opt to switch manually, it's not like a permanent decision
When reading the link from @olivier-lacroix, I think defaulting to a src layout makes sense because:
And finally:
The src layout helps enforce that an editable installation is only able to import files that were meant to be importable. This is especially relevant when the editable installation is implemented using a path configuration file that adds the directory to the import path.
Seeing as we default to hatch as a buildsystem now, and that uses .pth
, this point might be relevant as well.
Opinions?
To be honest, I never found this nice list of advantages of the src layout. Sounds to me as well like we should opt for the src layout
Sounds good to me!
Checks
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of pixi, using
pixi --version
.Reproducible example
Looks like the same as #1815 but I'm not init-ing in a subdirectory or anything.
Issue description
Expected behavior
The package should be installed