Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read persistent configuration from non-workspace pyproject.toml #4526

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

charliermarsh
Copy link
Member

Summary

If the user puts their configuration in a pyproject.toml that isn't a valid workspace root (e.g., it's a Poetry file), we won't discover it, because we only look in uv.toml files in that case. I think this is somewhat debatable... We could choose to require uv.toml there, but as a user I'd probably expect it to work?

Closes #4521.

@charliermarsh charliermarsh added the configuration Settings and such label Jun 25, 2024
@charliermarsh charliermarsh marked this pull request as ready for review June 25, 2024 18:13
Comment on lines -64 to -72
// Read a `uv.toml` file in the current directory.
let path = ancestor.join("uv.toml");
match fs_err::read_to_string(&path) {
Ok(content) => {
let options: Options = toml::from_str(&content)
.map_err(|err| Error::UvToml(path.user_display().to_string(), err))?;

debug!("Found workspace configuration at `{}`", path.display());
return Ok(Some(Self(options)));
Copy link
Member

Choose a reason for hiding this comment

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

Did you mean to drop this? Does this happen elsewhere now somehow?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah this is in from_directory.

Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

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

Yeah I think this behavior makes sense, though it's annoying.

@charliermarsh
Copy link
Member Author

I'll add a test too.

@charliermarsh charliermarsh enabled auto-merge (squash) June 25, 2024 18:46
@charliermarsh charliermarsh merged commit a81742c into main Jun 25, 2024
47 checks passed
@charliermarsh charliermarsh deleted the charlie/poetry branch June 25, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Settings and such
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pyproject.toml created with poetry is invalid on versions after 0.2.11
2 participants