-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Discover workspaces without using them in resolution #3585
Conversation
/// A package in a workspace. | ||
#[derive(Debug, Clone)] | ||
#[cfg_attr(test, derive(serde::Serialize))] | ||
#[allow(dead_code)] // TODO(konsti): Resolve workspace package declarations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want this information when resolving workspace dependencies, but we don't use it yet
fn albatross_in_example() { | ||
let (project, root_escaped) = workspace_test("albatross-root-workspace"); | ||
let filters = vec![(root_escaped.as_str(), "[ROOT]")]; | ||
insta::with_settings!({filters => filters}, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried the json snapshots here for the first time and find them better than the regular debug snapshots
use std::collections::HashMap; | ||
use std::collections::BTreeMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the test snapshots deterministic
18b6467
to
ae5d2a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See for a more used state of this file https://gist.github.com/konstin/f8c05311223fbd627b0491295915e865
4e61365
to
8220fff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some documentation explaining what's going on? Or at least link to the relevant "specification" we're implementing here? I'm having a hard time reviewing because there's a lot of behavior in here.
I've edited the spec from #3404 into a docstring |
e1c2b07
to
d3dbef4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is causing you trouble, you can merge and I'll do a post-push review.
5538a20
to
6c5cf7f
Compare
Merging this now to avoid merge conflicts |
6c5cf7f
to
a0b9ea2
Compare
I don't really understand why this only happens on windows clippy and not on linux too, but as usual, boxing the error variant fixes it. Fixup for #3585
@konstin - Gave this a read, looks like a good start. |
.map(|workspace| (project_path.clone(), workspace.clone(), project.clone())); | ||
|
||
if workspace.is_none() { | ||
workspace = find_workspace(&project_path)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be an or_else
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean we're in a member of a workspace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, added some docs in the other branch
Add minimal support for workspace discovery, only used for determining paths in the bluejay commands.
We can now discover the workspace structure, namely that the
pyproject.toml
of a package belongs to a workspacepyproject.toml
with members and exclusion. The globbing logic is inspired by cargo. We don't resolveworkspace = true
metadata declarations yet.