Merge branch 'master' of github.com:gradio-app/gradio

This commit is contained in:
Abubakar Abid 2021-10-26 13:20:24 -05:00
commit 2c1ca70af8
6 changed files with 15 additions and 14 deletions

View File

@ -1,7 +1,7 @@
version: 2.1
orbs:
codecov: codecov/codecov@3.1.1
node: circleci/node@1.0.1
node: circleci/node@4.7.0
jobs:
build:
docker:
@ -27,8 +27,9 @@ jobs:
key: deps1-{{ .Branch }}-{{ checksum "gradio.egg-info/requires.txt" }}
paths:
- "venv"
- node/install
- node/install-npm
- node/install:
node-version: 14.17.4
npm-version: 8.1.0
- run:
name: Build frontend
command: |

View File

@ -17,23 +17,25 @@ module.exports = {
enable: true /* (default value) */,
mode: "extends" /* (default value) */ || "file"
},
configure: {
optimization: {
configure: (webpackConfig, { env, paths }) => {
webpackConfig.optimization = {
splitChunks: {
cacheGroups: {
default: false
}
},
runtimeChunk: false
},
entry: "./src/index",
output: {
};
webpackConfig.entry = "./src/index";
webpackConfig.output = {
publicPath: "",
path: path.resolve(__dirname, "../gradio/frontend"),
filename: "static/bundle.js",
chunkFilename: "static/js/[name].chunk.js"
}
}
};
paths.appBuild = webpackConfig.output.path;
return webpackConfig;
},
},
style: {
postcss: {

View File

@ -3,7 +3,6 @@
"main.css": "/static/css/main.ac4c682c.css",
"main.js": "/static/bundle.js",
"index.html": "/index.html",
"static/bundle.js.LICENSE.txt": "/static/bundle.js.LICENSE.txt",
"static/media/arrow-left.e497f657.svg": "/static/media/arrow-left.e497f657.svg",
"static/media/arrow-right.ea6059fd.svg": "/static/media/arrow-right.ea6059fd.svg",
"static/media/logo.411acfd1.svg": "/static/media/logo.411acfd1.svg",

View File

@ -134,7 +134,7 @@ def main():
@app.route("/static/<path:path>", methods=["GET"])
def static_resource(path):
if app.interface.share or os.getenv("GRADIO_TEST_MODE"):
if app.interface.share:
return redirect(GRADIO_STATIC_ROOT + path)
else:
return send_file(os.path.join(STATIC_PATH_LIB, path))

View File

@ -11,7 +11,6 @@ import random
import os
current_dir = os.getcwd()
os.environ["GRADIO_TEST_MODE"] = "1"
LOCAL_HOST = "http://localhost:{}"
GOLDEN_PATH = "test/golden/{}/{}.png"

View File

@ -69,7 +69,7 @@ class TestFlaskRoutes(unittest.TestCase):
def test_get_static_route(self):
response = self.client.get('/static/bundle.css')
self.assertEqual(response.status_code, 302) # This should redirect to static files.
self.assertEqual(response.status_code, 200)
def test_enable_sharing_route(self):
path = "www.gradio.app"