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

fix(python): Handle PyPy python version correctly #2374

Merged
merged 2 commits into from
Mar 14, 2021

Conversation

tyilo
Copy link
Contributor

@tyilo tyilo commented Feb 23, 2021

Description

Add support for parsing PyPy python version.

Motivation and Context

Before this fix, I get the following prompt:

... via 🐍 v3.7.9 (7e6e2bb30ac5fbdbd443619cae28c51d5c162a02, Nov 24 2020, 10:03:59)
[PyPy 7.3.3-beta0 with GCC 10.2.0]

With the fix:

... via 🐍 v3.7.9

How Has This Been Tested?

  • I have tested using MacOS
  • I have tested using Linux
  • I have tested using Windows

Checklist:

  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.

@tyilo tyilo changed the title Handle PyPy python version correctly fix(python): Handle PyPy python version correctly Feb 23, 2021
@tyilo
Copy link
Contributor Author

tyilo commented Feb 23, 2021

Maybe the PyPy version should also be specified so that the output is 🐍 v3.7.9 (PyPy 7.3.3-beta0) instead of 🐍 v3.7.9?

@chipbuster
Copy link
Contributor

Maybe the PyPy version should also be specified so that the output is 🐍 v3.7.9 (PyPy 7.3.3-beta0) instead of 🐍 v3.7.9?

I think this is fine as it is. The prompt already gets long enough without us trying to specify every single piece of version information--we can add a feature later to specify the exact python interpreter if needed, but that should probably be a separate feature PR.

@andytom andytom requested a review from a team March 14, 2021 08:27
Copy link
Member

@vladimyr vladimyr left a comment

Choose a reason for hiding this comment

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

@tyilo You did a fine job ensuring PyPy version gets correctly formatted applying minimal changes to the existing codebase but let's please improve the complete Python version extraction & formatting logic instead.

To help you with that here is a patch for you to apply: https://github.com/vladimyr/starship/commit/34b0302.patch (as seen here vladimyr@34b0302)

src/modules/python.rs Outdated Show resolved Hide resolved
Align Python version retrieval and formatting with established
Starship conventions.
Copy link
Member

@vladimyr vladimyr left a comment

Choose a reason for hiding this comment

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

LGTM
Well done @tyilo!

@davidkna davidkna merged commit d2946dd into starship:master Mar 14, 2021
@davidkna
Copy link
Member

davidkna commented Mar 14, 2021

Thanks for the contribution @tyilo and thanks for reviewing @vladimyr.

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.

4 participants