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 --python-path, --pip-path, --gradio-path CLI arguments to let custom component developers control which executable is used #7638
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/595361c1c31ce4e9725c25c31baaed0040233f6b/gradio-4.20.1-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@595361c1c31ce4e9725c25c31baaed0040233f6b#subdirectory=client/python" |
🦄 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.
|
Nice @freddyaboulton! Just to understand, when would one use --gradio-path? |
We used to use |
Thanks @freddyaboulton for this PR! While I think this is a working solution, it seems like a bit of a headache for the user to have to find and pass in the path to their Python for the CLI commands, particularly as they need to do it for each What if we resolved
Same for |
I don't follow. Passing in the |
Sorry my earlier comment may not have been clear. I agree -- let's keep these parameters but check for python3 and pip3 as well |
403883b
to
aeb0d03
Compare
Sounds good @abidlabs ! Just pushed up that change! |
Code changes look good! In my tests, For example, I can run: gradio cc dev --python-path abdef/asdfklasdjf after creating a custom component and the dev server launches successfully. That's not expected, right? |
@abidlabs I think you needed to built the js for this PR for dev mode to break in that case. But your comment made me realize we wouldn't raise a helpful error if the executable did not exist so I just pushed that up. |
Ah I see, thanks I'll give this another spin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful. LGTM
Going to merge this in for the release @freddyaboulton |
Description
Closes: #7621
Adds CLI arguments to let developers control the path of the python executables used in create, dev, and build commands.
Also adds some debugging information to dev mode in case no custom components are found. I suspect this will help debug issues like #6821
🎯 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