Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Remove some unncessary dependencies #5641

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

Merged
merged 1 commit into from
Mar 31, 2025
Merged

Conversation

coolreader18
Copy link
Member

Specifically, rand and rustc_version - we actually use very little of these dependencies' capabilities, and it's quite simple to swap them out with a 2-3 line function.

Comment on lines +61 to +64
fn rustc_version() -> String {
let rustc = env::var_os("RUSTC").unwrap_or_else(|| "rustc".into());
command(rustc, &["-V"])
}
Copy link
Member

Choose a reason for hiding this comment

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

I agree about rand to reduce runtime efficiency, but do we really need to remove rustc_version? We only use it on build step and we don't need to take this extra code to maintain

Copy link
Member Author

Choose a reason for hiding this comment

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

It also pulls in the semver crate to let you do semantic version matching, which we fully don't use at all. I do agree that a build dependency is not a very big deal, but the part of rust_version we use is basically exactly equivalent to this code, and we already have the command function here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was actually gonna switch this to use rustc_version::VersionMeta.short_version_string instead of the plain 1.X.Y version (it's rustc 1.85.0 (4d91de4e4 2025-02-17) which is more similar to what pypy has: [PyPy 7.3.18 with GCC 14.2.1 20250128]) and then I realized that short_version_string is literally just the output of rustc -V, with no parsing of rustc -Vv needed at all.

@youknowone youknowone merged commit 24d9956 into RustPython:main Mar 31, 2025
11 checks passed
@coolreader18 coolreader18 deleted the deps branch March 31, 2025 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.