-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Use importlib
in favor of deprecated pkg_resources
#5048
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thanks @jayceslesar for opening the PR, indeed |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-5048-all-demos You can install the changes in this PR by running: pip install https://gradio-builds.s3.amazonaws.com/b62cb721143dde5a7f86ae79d7a1c70efbb09983/gradio-3.39.0-py3-none-any.whl |
@abidlabs going to be a little more involved, I will patch the rest of |
b0f98fa
to
352497e
Compare
importlib.resources
@abidlabs should be good now! |
Thanks @jayceslesar! It turns out that we didn't even need that version check in |
Absolutely! Ill see what I can do about getting types in a good spot to get CI to pass |
importlib
in favor of deprecated pkg_resources
@abidlabs thanks for the cleanup! |
No worries! I'll fix the final typing issues and then merge once CI passes |
Ok I think we should be good to go. I've just asked @yvrjsharma to test on a Windows machine as well to make sure all the paths resolve correctly |
I have just run couple of demos locally on my Windows machine, and all work fine. |
Thanks @jayceslesar and @yvrjsharma will merge in after CI passes |
Description
Please include a concise summary, in clear English, of the changes in this pull request. If it closes an issue, please mention it here.
Bad practice to be using just
import pkg_resources
instead ofimport importlib.resources as pkg_resources
, as this led to my org having trouble installing and explicitly needing to add setuptools as a dependency which doesnt quite make sense. This is a drop in replacement and has existed since python 3.7.The issue arose from having
gradio
installed in an application my org is developing, and running it resulted inThis is a drop in replacement.
Closes: #(issue)
N/A
🎯 PRs Should Target Issues
Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.
Not adhering to this guideline will result in the PR being closed.
Tests
PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests:
bash scripts/run_all_tests.sh
You may need to run the linters:
bash scripts/format_backend.sh
andbash scripts/format_frontend.sh