Coder Social home page Coder Social logo

Comments (8)

simonw avatar simonw commented on July 2, 2024

This looks to be the step that is failing:

- name: Set up the alternate-route demo
run: |
echo '
from datasette import hookimpl
@hookimpl
def startup(datasette):
db = datasette.get_database("fixtures2")
db.route = "alternative-route"
' > plugins/alternative_route.py
cp fixtures.db fixtures2.db

from datasette.

simonw avatar simonw commented on July 2, 2024

Maybe plugins/ does not exist? It should have been created by this line:

- name: Build fixtures.db
run: python tests/fixtures.py fixtures.db fixtures.json plugins --extra-db-filename extra_database.db

from datasette.

simonw avatar simonw commented on July 2, 2024

I think I see the problem - it's from here: b2ec871#diff-5dbc88d6e5c3615caf10e32a9d6fc6ff683f5b5814948928cb84c3ab91c038b6L770

The config and metadata Click options are the wrong way round:

datasette/tests/fixtures.py

Lines 785 to 786 in 80a9cd9

@click.argument("metadata", required=False)
@click.argument("config", required=False)

def cli(db_filename, config, metadata, plugins_path, recreate, extra_db_filename):

from datasette.

simonw avatar simonw commented on July 2, 2024

New error: "Error: Metadata should end with .json"

https://github.com/simonw/datasette/actions/runs/6266720924/job/17018265851

CleanShot 2023-09-21 at 13 31 08@2x

from datasette.

simonw avatar simonw commented on July 2, 2024

Correct usage is now:

python tests/fixtures.py fixtures.db fixtures-config.json fixtures-metadata.json \
  plugins --extra-db-filename extra_database.db
Test tables written to fixtures.db
- metadata written to fixtures-metadata.json
- config written to fixtures-config.json
  Wrote plugin: plugins/register_output_renderer.py
  Wrote plugin: plugins/view_name.py
  Wrote plugin: plugins/my_plugin.py
  Wrote plugin: plugins/messages_output_renderer.py
  Wrote plugin: plugins/sleep_sql_function.py
  Wrote plugin: plugins/my_plugin_2.py
Test tables written to extra_database.db

from datasette.

simonw avatar simonw commented on July 2, 2024

... which raises the challenge that datasette publish doesn't yet know what to do with a config file!

datasette publish cloudrun fixtures.db fixtures2.db extra_database.db \
-m metadata.json \
--plugins-dir=plugins \
--branch=$GITHUB_SHA \
--version-note=$GITHUB_SHA \
--extra-options="--setting template_debug 1 --setting trace_debug 1 --crossdb" \
--install 'datasette-ephemeral-tables>=0.2.2' \
--service "datasette-latest$SUFFIX" \
--secret $LATEST_DATASETTE_SECRET

from datasette.

simonw avatar simonw commented on July 2, 2024

I'm going to disable this bit of the deploy for the moment, which will break the demo linked to from https://simonwillison.net/2022/Dec/2/datasette-write-api/

- name: Make some modifications to metadata.json
run: |
cat fixtures.json | \
jq '.databases |= . + {"ephemeral": {"allow": {"id": "*"}}}' | \
jq '.plugins |= . + {"datasette-ephemeral-tables": {"table_ttl": 900}}' \
> metadata.json
cat metadata.json

from datasette.

simonw avatar simonw commented on July 2, 2024

That worked

e4f8688 is the latest commit right now and https://latest.datasette.io/-/versions shows that as the deployed version.

from datasette.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.