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

Add exception handling for missing isort package metadata #2226

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

maheshsaripalli9
Copy link

This commit introduces a try-except block to handle the scenario where the isort package metadata is not available. In such cases, instead of raising an error, the version variable is set to an empty string.

This commit introduces a try-except block to handle the scenario where the isort package metadata is not available. In such cases, instead of raising an error, the __version__ variable is set to an empty string.
@maheshsaripalli9 maheshsaripalli9 changed the title Add exception handling for missing isort package metadata Changed tabs to spaces Jan 19, 2024
@maheshsaripalli9 maheshsaripalli9 changed the title Changed tabs to spaces Add exception handling for missing isort package metadata Jan 19, 2024
@maheshsaripalli9 maheshsaripalli9 changed the title Add exception handling for missing isort package metadata Add exception handling for missing isort package metadata. Jan 19, 2024
@maheshsaripalli9 maheshsaripalli9 changed the title Add exception handling for missing isort package metadata. Add exception handling for missing isort package metadata Jan 19, 2024
@maheshsaripalli9
Copy link
Author

Can you review this code? @timothycrosley

@maheshsaripalli9
Copy link
Author

Can you review this PR ? @staticdev

@DanielNoord
Copy link
Member

When is this ever the case? If this is the case something else is broken so we shouldn't handle this but fix that bug instead.

@maheshsaripalli9
Copy link
Author

If we attempt to execute isort directly from the source code rather than through pip install, the isort package metadata is empty, leading to this error.

@DanielNoord
Copy link
Member

Why would you execute it directly from the source code? I'm not sure that is supported?

If you're downloading the source code directly you might as well apply patches yourself?

@maheshsaripalli9
Copy link
Author

maheshsaripalli9 commented Jan 19, 2025 via email

@DanielNoord
Copy link
Member

I guess it is up to @staticdev.

I have never seen this pattern in any of the open source packages I maintain/contribute to.
I also don't really understand the use case, or at least wouldn't consider the use case supported. If you want to download the source files and combine them into a build that is non standard I think you're expected to have do some patching. I wouldn't want to trouble the codebase with that.

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