-
Notifications
You must be signed in to change notification settings - Fork 624
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
[WIP] Support installing additional executables in uv tool install
#7592
base: main
Are you sure you want to change the base?
Conversation
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.
Nice! This seems like a great start.
crates/uv/tests/tool_install.rs
Outdated
Installed 11 executables: ansible, ansible-config, ansible-connection, ansible-console, ansible-doc, ansible-galaxy, ansible-inventory, ansible-playbook, ansible-pull, ansible-test, ansible-vault | ||
Installed 1 executable: ansible-lint | ||
Installed 1 executable: ansible-community |
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'll probably want to collapse these and/or include the "from" package
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.
Do you have a preference on how this should look like?
For the moment I've updated it to:
Installed 11 additional executables from `ansible-core`: ansible, ansible-config, ansible-connection, ansible-console, ansible-doc, ansible-galaxy, ansible-inventory, ansible-playbook, ansible-pull, ansible-test, ansible-vault
Installed 1 additional executable from `ansible-lint`: ansible-lint
Installed 1 executable: ansible-community
I'm absolutely not sold on this being the final form.
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.
The part that stands out to me there is that it's a bit weird to say "additional" before we show the main group of executables we installed.
I think I'd go with whatever is decent and simple here, then revisit the output entirely. For example, I think this should probably match the style of our install commands? Like:
Installed 13 executables
+ ansible (from ansible-core)
+ ansible-config (from ansible-core)
+ ansible-lint
+ ansible-community
...
If the package name matches the executable name I'd probably omit the "from" portion.
Anyway, I think that is separate from the goal here and we should avoid going down that road in this pull request.
crates/uv/tests/tool_install.rs
Outdated
.arg("--i-want-ponies") | ||
.arg("ansible-core") | ||
.arg("--i-want-ponies") | ||
.arg("ansible-lint") | ||
.arg("ansible==9.3.0") |
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.
Minor note: This is probably an expensive test because the package is big. We might want to find a smaller package to keep the test case minimal.
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.
Many dependencies were coming from ansible-lint
, which is an extra package providing an additional entrypoint. I replaced that with black
, as it covers the same scenario with fewer transitive deps.
If you have an idea about a better combo than ansible
and ansible-core
, I'll happily replace them here.
67a3ac0
to
e40e3ff
Compare
49cb25e
to
3a05460
Compare
+ pycparser==2.21 | ||
+ pyyaml==6.0.1 | ||
+ resolvelib==1.0.1 | ||
Installed 11 executables from `ansible-core`: ansible, ansible-config, ansible-connection, ansible-console, ansible-doc, ansible-galaxy, ansible-inventory, ansible-playbook, ansible-pull, ansible-test, ansible-vault |
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.
There is a funny issue here, it seems that on Windows only there is a different sorting for the strings ansible
and ansible-<whatever>
:
- Installed 11 executables from `ansible-core`: ansible, ansible-config, ansible-connection, ansible-console, ansible-doc, ansible-galaxy, ansible-inventory, ansible-playbook, ansible-pull, ansible-test, ansible-vault
+ Installed 11 executables from `ansible-core`: ansible-config, ansible-connection, ansible-console, ansible-doc, ansible-galaxy, ansible-inventory, ansible-playbook, ansible-pull, ansible-test, ansible-vault, ansible
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.
That's horrible :(
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 had to abuse CI a bit to get to the bottom of this (sorry if I flooded you with notifications).
It turns out there is a .exe
suffix (filtered out in test output) and thus ansible < ansible-config(.exe) < ansible.exe
(due to the ASCII order of -
vs .
).
The same suffix is also present in the receipt, making its ordering OS-dependant.
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'm used to Charlie force-pushing 1000 times per pull request so no worries.
Ah that's really interesting. Good sleuthing. I was about to suggest trimming the suffix for sorts but it looks like you're on it in 0c9f450 — should you use the std::env::consts::EXE_SUFFIX
const there?
The filtering can be quite misleading like that sometimes. I wonder if we can output an unfiltered snapshot on failure too? cc @konstin the snapshot macro master.
3838164
to
ab8e780
Compare
ab8e780
to
0c9f450
Compare
WIP: this is an initial working PoC. The flag name still needs to be finalized, and there are likely some hidden cases broken by allowing executables from multiple packages.
This enhances
uv tool install
in order to allow installing executables from multiple packages in a single call.Ref: #6314