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

Error when workspace contains conflicting Python requirements #10841

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

charliermarsh
Copy link
Member

Summary

If members define disjoint Python requirements, we should error. Right now, it seems that it maps to unbounded and leads to weird behavior.

Closes #10835.

@charliermarsh charliermarsh added the error messages Messaging when something goes wrong label Jan 22, 2025
.as_ref()
.map(find_requires_python)
.transpose()?
.flatten()
Copy link
Member Author

Choose a reason for hiding this comment

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

This is kind of gross, but struggling to improve it.

.map(VersionSpecifiers::clone)
.collect::<BTreeSet<_>>();
Err(ProjectError::DisjointRequiresPython(
specifiers.into_iter().collect(),
Copy link
Member Author

Choose a reason for hiding this comment

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

This just includes all of the specifiers.

----- stdout -----

----- stderr -----
error: The workspace contains conflicting Python requirements: `==3.10`, `>=3.12`
Copy link
Member

Choose a reason for hiding this comment

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

It'd be ideal to include sources here, if feasible. Perhaps as a future change.

Maybe like

error: The workspace contains conflicting Python requirements:
    - project: `>=3.12`
    - child: `==3.10`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Messaging when something goes wrong
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Be more explicit about inability to resolve workspace requires-python
3 participants