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

enhancement: Added support for new command 'gradio environment' #4915

Conversation

varshneydevansh
Copy link
Contributor

Description

gradio/cli.py which routes various CLI commands to appropriate python functions.
For example, if someone types "gradio deploy", it calls gradio.deploy_space.deploy().

Similarly, for getting the environment info I added the new file as in future the CLI commands might increase in file named – cli_env_info.py in gradio folder.

I have also added the check for in case if user might enter some wrong command.

Closes:

🎯 PRs Should Target Issues

It's a request feature to be able to get the details to make it easier for people to file bug reports if we shipped an easy command to list the OS, gradio version, and versions of gradio/gradio-client dependencies.

Tests & Changelog

  1. 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

  2. You may need to run the linters: bash scripts/format_backend.sh and bash scripts/format_frontend.sh

  3. Unless the pull request is labeled with the "no-changelog-update" label by a maintainer of the repo, all pull requests must update the changelog located in CHANGELOG.md:

Please add a brief summary of the change to the Upcoming Release section of the CHANGELOG.md file and include
a link to the PR (formatted in markdown) and a link to your github profile (if you like). For example, "* Added a cool new feature by [@myusername](link-to-your-github-profile) in [PR 11111](https://github.com/gradio-app/gradio/pull/11111)".

@vercel
Copy link

vercel bot commented Jul 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
gradio ✅ Ready (Inspect) Visit Preview Jul 19, 2023 4:35pm

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Jul 14, 2023

All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-4915-all-demos


You can install the changes in this PR by running:

pip install https://gradio-builds.s3.amazonaws.com/a0b87cb6b3bc33f149b4c5fb8eeafa6fd9a7f811/gradio-3.37.0-py3-none-any.whl

@@ -0,0 +1,23 @@
""" This file is the part of 'gradio/cli.py' for printing the environment info
Copy link
Collaborator

Choose a reason for hiding this comment

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

This very cool @varshneydevansh ! Thank you

My comments are mainly around making the output look a bit nicer.

  1. The dependencies under gradio and gradio_client should be indented.
  2. I would add a new line between Operating System and gradio line
  3. I would add a new line between the last gradio dependency and the gradio_client section.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you think these changes are the ones you wanted?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes this is great thank you @varshneydevansh !

@abidlabs
Copy link
Member

Hi @varshneydevansh thanks again for opening the PR! Did you get a chance to tweak this based on @freddyaboulton's comments?

@varshneydevansh
Copy link
Contributor Author

Hi @varshneydevansh thanks again for opening the PR! Did you get a chance to tweak this based on @freddyaboulton's comments?

I thought Freddy will make the changes as I miss comprehend the "I would".

@abidlabs
Copy link
Member

It would be great if you could push the changes, and then we can make another pass, thanks @varshneydevansh!

@vercel
Copy link

vercel bot commented Jul 19, 2023

@varshneydevansh is attempting to deploy a commit to the Hugging Face Team on Vercel.

A member of the Team first needs to authorize it.

@freddyaboulton
Copy link
Collaborator

Will merge once ci passes @varshneydevansh ! Thanks again for the nice contribution.

@freddyaboulton freddyaboulton merged commit fdc9ca2 into gradio-app:main Jul 19, 2023
15 checks passed
@varshneydevansh varshneydevansh deleted the cli_command_to_get_environment_info_4598 branch July 19, 2023 17:00
@varshneydevansh
Copy link
Contributor Author

I learned Python back in 2017, and I am so happy that finally I made some contribution.

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.

None yet

4 participants