Skip to content

Commit

Permalink
designate python runtime test
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrosquall committed Apr 16, 2022
1 parent 1fb4646 commit d2cc523
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ publish-vercel: install
datasette publish vercel demo/happy_planet_index.db \
--project=datasette-nteract-data-explorer \
--scope=datasette-visualization-plugin-demos \
--token=${VERCEL_TOKEN}
--token=${VERCEL_TOKEN} \
--vercel-json=vercel.json
2 changes: 2 additions & 0 deletions demo/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

# This is supposed to be added by the publish step.
pysqlite3-binary
sqlite-utils>=3.2
datasette>=0.61
6 changes: 3 additions & 3 deletions plugins/datasette_publish_vercel_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ def _publish_vercel(
{
"name": project,
"version": 2,
"builds": [{"src": "index.py", "use": "@vercel/python"}],
"routes": [{"src": "(.*)", "dest": "index.py"}],
"functions": {"api/index.py": {}},
"rewrites": [{ "source": "/(.*)", "destination": "api/index.py" }],
},
indent=4,
)
Expand Down Expand Up @@ -257,7 +257,7 @@ def _publish_vercel(

statics = [item[0] for item in static]

open("index.py", "w").write(
open("api/index.py", "w").write(
INDEX_PY.format(
database_files=json.dumps([os.path.split(f)[-1] for f in files]),
extras=", {}".format(", ".join(extras)) if extras else "",
Expand Down
10 changes: 2 additions & 8 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
{
"name": "datasette-nteract-data-explorer",
"version": 2,
"builds": [
{
"src": "index.py",
"use": "@vercel/python"
}
],
"functions": {
"index.py"
"api/index.py": {}
},
"rewrites": [{ "src": "/(.*)", "dest": "index.py" }]
"rewrites": [{ "source": "/(.*)", "destination": "api/index.py" }]
}

0 comments on commit d2cc523

Please sign in to comment.