mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-09 02:00:44 +08:00
fb7d768013
* add changelog file * Check release notes * Fix syntax * Fix path to changelog * Use changelog * Add to changelog * Add comment * Test comment * Use txt file for comment body * Fix for multiline * rendering on website, changes to changelog * Don't use txt file * Fix pr number * merge * Split it up into two * Test fail * Follow example * Fix syntax * Delete quotes * Add syntax * Fix names * Fix syntax * Modify pr template instead and remove backticks * Check word * changelog file fixes * add 3.4 release notes to changelog * add navigation * replace pr tag and @ usernames with links * remove empty/unused sections from rendering * fix format of 3.4 notes * add releases dir and 3.0-2 notes * render from releases dir * remove changelog file * Fix RN check * Fix path * upcoming release title * switch to periods from dashes * add link to changelog in docs * Add script modify files * Modify changelog * change to release history * modify gh actions * Fix syntax * Skip draft releases during reformatting * skip template when rendering * modify upcoming.md to reflect real changes * replace links with pr tag * Add automated release notes as a new feature in upcoming * Update .github/PULL_REQUEST_TEMPLATE.md Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * eUpdate website/homepage/src/style.css Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Misc fixes * one file at root * Fix Changelog check * Modify release notes format script * Fix format script + release notes * Add to contributing * Undo change to release notes from testing script * Add pr 2373 to rl * Modify file path * Update .github/PULL_REQUEST_TEMPLATE.md Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update .github/PULL_REQUEST_TEMPLATE.md Co-authored-by: Abubakar Abid <abubakar@huggingface.co> Co-authored-by: aliabd <ali.si3luwa@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
100 lines
3.6 KiB
Markdown
100 lines
3.6 KiB
Markdown
# Contributing to Gradio
|
|
|
|
Prequisites:
|
|
|
|
* [Python 3.7+](https://www.python.org/downloads/)
|
|
* [pnpm version 7.x](https://pnpm.io/7.x/installation) (optional for backend-only changes, but needed for any frontend changes)
|
|
|
|
More than 80 awesome developers have contributed to the `gradio` library, and we'd be thrilled if you would like be the next `gradio` contributor! Start by cloning this repo and installing Gradio locally:
|
|
|
|
### Install Gradio locally from the `main` branch
|
|
|
|
* Clone this repo
|
|
* Navigate to the repo folder and run
|
|
|
|
```bash
|
|
bash scripts/install_gradio.sh
|
|
```
|
|
|
|
* Build the front end
|
|
|
|
```
|
|
bash scripts/build_frontend.sh
|
|
```
|
|
|
|
|
|
### Install testing requirements
|
|
|
|
In order to be able to run the Python unit tests, do the following:
|
|
|
|
* Navigate to the repo folder and install test requirements (note that it is highly recommended to use a virtual environment running **Python 3.9** since the versions are pinned)
|
|
|
|
```
|
|
bash scripts/install_test_requirements.sh
|
|
```
|
|
* If you have a different Python version and conflicting packages during the installation, please first run:
|
|
|
|
```
|
|
bash scripts/create_test_requirements.sh
|
|
```
|
|
|
|
### Extra tidbits
|
|
|
|
* You can run gradio scripts in reload mode which will watch for changes in the `gradio` folder and reload the app if changes are made.
|
|
```
|
|
gradio app.py
|
|
```
|
|
|
|
* You can also start a local frontend development server (on port 3000 by default) that responds to any changes in the frontend.
|
|
|
|
```
|
|
bash scripts/run_frontend.sh
|
|
```
|
|
* To run all of the tests, do:
|
|
|
|
```
|
|
bash scripts/run_all_tests.sh
|
|
```
|
|
|
|
|
|
### Structure of the Repository
|
|
|
|
It's helpful to know the overall structure of the repository so that you can focus on the part of the source code you'd like to contribute to
|
|
|
|
* `/gradio`: contains the Python source code for the library
|
|
* `/gradio/interface.py`: contains the Python source code for the core `Interface` class
|
|
* `/gradio/blocks.py`: contains the Python source code for the core `Blocks` class
|
|
* `/gradio/components.py`: contains the Python source code for the `components`, you can add your custom components here.
|
|
* `/ui`: contains the HTML/JS/CSS source code for the library ([start here for frontend changes](/ui/README.md))
|
|
* `/test`: contains Python unit tests for the library
|
|
* `/demo`: contains demos that are used in the documentation, you can find `Gradio` examples over here.
|
|
* `/website`: contains the code for the Gradio website (www.gradio.app). See the README in the `/website` folder for more details
|
|
|
|
### Continuous Integration and Testing
|
|
|
|
All PRs must pass the continuous integration tests before merging. To test locally, you can run `python -m unittest` from the repo directory.
|
|
|
|
## Submitting PRs
|
|
|
|
All PRs should be against `main`. Direct commits to main are blocked, and PRs require an approving review to merge into main. By convention, the Gradio maintainers will review PRs when:
|
|
|
|
* An initial review has been requested, and
|
|
* A description of the change (with a link to the GitHub PR) has been added to CHANGELOG.md, and
|
|
* A maintainer (@abidlabs, @aliabid94, @aliabd, @AK391, @dawoodkhan82, @pngwn, @freddyaboulton) is tagged in the PR comments and asked to complete a review
|
|
|
|
We ask that you make sure initial CI checks are passing before requesting a review. One of the Gradio maintainers will merge the PR when all the checks are passing.
|
|
|
|
Do not forget the format the backend before pushing.
|
|
```
|
|
bash scripts/format_backend.sh
|
|
```
|
|
```
|
|
bash scripts/format_frontend.sh
|
|
```
|
|
You can run the circleci checks locally as well.
|
|
```
|
|
bash scripts/run_circleci.sh
|
|
```
|
|
|
|
*Could these guidelines be clearer? Feel free to open a PR to help us faciltiate open-source contributions!*
|