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

feat: add installer to InstalledDist #1762

Merged
merged 6 commits into from
Feb 20, 2024

Conversation

tdejager
Copy link
Contributor

@tdejager tdejager commented Feb 20, 2024

Summary

Add installer method to InstalledDist to distinguish between different installers. Might be nice to add an enum for all possible installers, but this might be too hard to keep up to date :).

The INSTALLER file is a file that can be added to the .dist-info folder with the installer name.

Closes: #1759

Test Plan

Not sure if there is a place I can automatically test it, if you have a pointer I would be happy to add a test.

@@ -111,6 +111,15 @@ impl InstalledDist {
})
}

/// Return the `INSTALLER` of the distribution.
pub fn installer(&self) -> Option<String> {
Copy link
Member

Choose a reason for hiding this comment

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

Do you mind making this Result<Option<String>>, and erroring if the error kind is anything other than "not found"?

Copy link
Member

Choose a reason for hiding this comment

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

(I feel like the direct_url method above should function similarly, but that doesn't need to be changed here.)

Copy link
Member

Choose a reason for hiding this comment

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

Gonna change this so that I can include it in the release.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure thanks!

@charliermarsh charliermarsh enabled auto-merge (squash) February 20, 2024 16:57
@charliermarsh charliermarsh added the internal A refactor or improvement that is not user-facing label Feb 20, 2024
@charliermarsh charliermarsh merged commit 8cbeab7 into astral-sh:main Feb 20, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal A refactor or improvement that is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add installer method to InstalledDist
2 participants