-
-
Notifications
You must be signed in to change notification settings - Fork 587
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
base: main
Are you sure you want to change the base?
Conversation
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.
Can you review this code? @timothycrosley |
Can you review this PR ? @staticdev |
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. |
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. |
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? |
While uncommon, we currently build our package using our own infrastructure
due to licensing constraints and the need to expedite build times.We have a
local patch for this problem, but adding a 'try-except' block here would be
much better. This is a common way to handle things in Python packages.
…On Sat, Jan 18, 2025, 3:00 AM Daniël van Noord ***@***.***> wrote:
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?
—
Reply to this email directly, view it on GitHub
<#2226 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AITCZMZWCGVFIMHCVA6KYF32LIX5BAVCNFSM6AAAAABVFWRAWWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOJZGY3TAOBXGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I guess it is up to @staticdev. I have never seen this pattern in any of the open source packages I maintain/contribute to. |
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.