feat: Workspace name field optional#3514
Conversation
…t behavior when not defined Readd newline at end of simple_pixi.toml
| Fallback: If `osx-arm64` can't resolve, use `osx-64`. | ||
| Running `osx-64` on Apple Silicon uses [Rosetta](https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment) for Intel binaries. | ||
|
|
||
| ### `name` (optional) |
There was a problem hiding this comment.
I'm not sure what's the difference between project and workspace, but looks like it also affect project.name?
There was a problem hiding this comment.
OH, sorry, wrong comment location, I mean line 36, if project.name is missing it should still raise a error?
There was a problem hiding this comment.
You're right. The project.name field shouldn't be affected by this new feature. I made a mistake when updating the documentation. Thanks for noting it
There was a problem hiding this comment.
Seems to be a documentation version drift between what I forked vs official documentation. In the official documentation, the pixi manifest section indicates that the project table starts with a [project] statement but in main branch, the same section states the project table starts with [workspace] statement.
Of course, my intention is to indicate that, in the workspace section, the name is not required anymore
@baszalmstra I tagged you because I understand that you are very involved in pixi project. How should we update the documentation to indicate this new change?
|
Thank you very much for this PR. I accidentally also implemented a solution in #3526 . I went with a slightly different approach and added a few tests. |
Problem
Pixi requires users to write
workspace.namefield inpixi.tomlDespite the fact, not doing this could be consider a bad practice, some users seems to like a little bit of freedom on this aspect as user in issue #3431 is proposing.
Solution
Add root directory name as a fallback in case of field name not being defined in
pixi.tomlfile.If for some reason the root_directory is None, it returns the MissingField error.