Skip to content

feat: Workspace name field optional#3514

Closed
joyanedel wants to merge 2 commits intoprefix-dev:mainfrom
joyanedel:main
Closed

feat: Workspace name field optional#3514
joyanedel wants to merge 2 commits intoprefix-dev:mainfrom
joyanedel:main

Conversation

@joyanedel
Copy link
Copy Markdown
Contributor

Problem

Pixi requires users to write workspace.name field in pixi.toml
Despite 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.toml file.
If for some reason the root_directory is None, it returns the MissingField error.

@joyanedel joyanedel marked this pull request as draft April 5, 2025 04:20
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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what's the difference between project and workspace, but looks like it also affect project.name?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OH, sorry, wrong comment location, I mean line 36, if project.name is missing it should still raise a error?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@joyanedel joyanedel marked this pull request as ready for review April 5, 2025 20:51
@baszalmstra
Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants