Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,44 @@ version: 2.1
orbs:
codecov: codecov/codecov@3.2.2
node: circleci/node@5.0.2
browser-tools: circleci/browser-tools@1.3.0
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is how you install the chrome driver on the new images

Docs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need chrome and chrome driver?


jobs:
test:
parameters:
test-type:
type: string
python-version:
type: string
environment:
NODE_OPTIONS: --max-old-space-size=4096
docker:
- image: circleci/python:3.9.2-browsers
- image: cimg/python:<< parameters.python-version >>-browsers
Comment thread
abidlabs marked this conversation as resolved.
Comment thread
abidlabs marked this conversation as resolved.
steps:
- checkout
- run: mkdir test-reports
- restore_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
key: deps3-{{ .Branch }}-{{ checksum "requirements.txt" }}-<< parameters.python-version >>
- run:
name: Install ffmpeg
command: |
sudo apt update
sudo apt install ffmpeg -y
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run:
name: Install Python deps in a venv
command: |
python3 -m venv venv
python -m venv venv
. venv/bin/activate
bash scripts/install_gradio.sh
bash scripts/install_test_requirements.sh
pip install -r test/requirements-python<< parameters.python-version >>.txt
- run:
command: |
chromedriver --version
name: Check chrome driver install
- save_cache:
key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }}
key: deps3-{{ .Branch }}-{{ checksum "requirements.txt" }}-<< parameters.python-version >>
paths:
- "venv"
- node/install:
Expand Down Expand Up @@ -81,3 +86,4 @@ workflows:
matrix:
parameters:
test-type: ["not flaky", "flaky"]
python-version: ["3.9.2", "3.7.12"]
Comment thread
abidlabs marked this conversation as resolved.
Outdated
17 changes: 7 additions & 10 deletions gradio/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@
import os
import pathlib
import shutil
import sys
import tempfile
import warnings
from copy import deepcopy
from types import ModuleType
from typing import Any, Callable, Dict, List, Optional, Tuple
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is for #1807


if sys.version_info[0] == 3 and sys.version_info[1] >= 8:
if TYPE_CHECKING:
Comment thread
abidlabs marked this conversation as resolved.
from typing import TypedDict
else:
from typing_extensions import TypedDict

class DataframeData(TypedDict):
headers: List[str]
data: List[List[str | int | bool]]


import matplotlib.figure
import numpy as np
Expand Down Expand Up @@ -2400,11 +2402,6 @@ def style(
)


class DataframeData(TypedDict):
headers: List[str]
data: List[List[str | int | bool]]


@document()
class Dataframe(Changeable, IOComponent):
"""
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ uvicorn
Jinja2
fsspec
httpx
pydantic
typing-extensions
pydantic
5 changes: 3 additions & 2 deletions scripts/create_test_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ if [ -z "$(ls | grep CONTRIBUTING.md)" ]; then
echo "Please run the script from repo directory"
exit -1
else
echo "Creating requirements under test/requirements.txt using requirements.in. Please run this script from unix or wsl!"
echo "Creating requirements under test/requirements.txt using requirements.in. Please run this script from unix or wsl in a python3.9 env!"
python -c "import sys; assert sys.version_info >= (3, 9) and sys.version_info < (3, 10), 'Run from python 3.9!'" || exit 1
cd test
pip install --upgrade pip-tools
pip-compile
pip-compile --output-file requirements-python3.9.2.txt
fi
11 changes: 11 additions & 0 deletions scripts/create_test_requirements_py37.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
if [ -z "$(ls | grep CONTRIBUTING.md)" ]; then
echo "Please run the script from repo directory"
exit -1
else
echo "Creating requirements under test/requirements-python3.7.12.txt using requirements.in. Please run this script from unix or wsl in a python 3.7 env!"
python -c "import sys; assert sys.version_info < (3, 8) and sys.version_info > (3, 6), 'Run from python 3.7!'" || exit 1
cd test
pip install --upgrade pip-tools
pip-compile --output-file requirements-python3.7.12.txt
fi
Loading