Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions crates/pixi_manifest/src/toml/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,21 @@ impl TomlWorkspace {
} = self.preview.into_preview();

let warnings = preview_warnings;
let missing_field_name_error = Error {
kind: ErrorKind::MissingField("name"),
span: self.span,
line_info: None,
};

Ok(WithWarnings::from(Workspace {
name: self.name.or(external.name).ok_or(Error {
kind: ErrorKind::MissingField("name"),
span: self.span,
line_info: None,
})?,
name: self.name.or(external.name).unwrap_or(
root_directory
.ok_or(missing_field_name_error.clone())?
.file_name()
.ok_or(missing_field_name_error)?
.to_string_lossy()
.to_string(),
),
version: self.version.or(external.version),
description: self.description.or(external.description),
authors: self.authors.or(external.authors),
Expand Down
16 changes: 8 additions & 8 deletions docs/reference/pixi_manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ The minimally required information in the `project` table is:
--8<-- "docs/source_files/pixi_tomls/simple_pixi.toml:project"
```

### `name`

The name of the project.

```toml
--8<-- "docs/source_files/pixi_tomls/main_pixi.toml:project_name"
```

### `channels`

This is a list that defines the channels used to fetch the packages from.
Expand Down Expand Up @@ -82,6 +74,14 @@ The available platforms are listed here: [link](https://docs.rs/rattler_conda_ty
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?


The name of the project. If not defined, the root directory name will be assumed as the project name.

```toml
--8<-- "docs/source_files/pixi_tomls/main_pixi.toml:project_name"
```

### `version` (optional)

The version of the project.
Expand Down
1 change: 0 additions & 1 deletion docs/source_files/pixi_tomls/simple_pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
# --8<-- [start:project]
[workspace]
channels = ["conda-forge"]
name = "project-name"
platforms = ["linux-64"]
# --8<-- [end:project]
Loading