datasette icon indicating copy to clipboard operation
datasette copied to clipboard

Upgrade more plugins to Datasette 1.0a20+, including plugins previously pinned to 1.0a19

Open simonw opened this issue 2 months ago • 6 comments

I'm going to ship new versions of those plugins that I previously pinned, this time requiring >=1.0a20.

  • [x] https://github.com/datasette/datasette-acl
  • [x] https://github.com/datasette/datasette-alerts
  • [x] https://github.com/simonw/datasette-allow-permissions-debug
  • [x] https://github.com/datasette/datasette-checkbox
  • [x] https://github.com/datasette/datasette-debug-actors-from-ids
  • [x] https://github.com/datasette/datasette-debug-events
  • [x] https://github.com/datasette/datasette-enrichments
  • [x] https://github.com/datasette/datasette-enrichments-llm
  • [x] https://github.com/datasette/datasette-events-db
  • [x] https://github.com/datasette/datasette-events-forward
  • [x] https://github.com/datasette/datasette-import
  • [x] https://github.com/datasette/datasette-llm-usage
  • [x] https://github.com/datasette/datasette-load
  • [x] https://github.com/datasette/datasette-metadata-editable
  • [x] https://github.com/datasette/datasette-pins
    • [x] PR: https://github.com/datasette/datasette-pins/pull/9
  • [x] https://github.com/datasette/datasette-profiles
  • [x] https://github.com/datasette/datasette-query-assistant
  • [x] https://github.com/datasette/datasette-remote-actors
  • [x] https://github.com/datasette/datasette-remove-database
  • [x] https://github.com/datasette/datasette-tail
  • [x] https://github.com/datasette/datasette-write-ui
  • [ ] https://github.com/simonw/datasette-graphql
    • [ ] https://github.com/simonw/datasette-graphql/issues/102
  • [x] https://github.com/simonw/datasette-configure-fts
  • [x] https://github.com/simonw/datasette-edit-templates
  • [x] https://github.com/simonw/datasette-upload-csvs
  • [x] https://github.com/simonw/datasette-auth-tokens
  • [x] https://github.com/simonw/datasette-upload-dbs
  • [x] https://github.com/simonw/datasette-edit-schema
  • [x] https://github.com/datasette/datasette-export-database
  • [x] https://github.com/datasette/datasette-paste (actually this is archived so skipping it)
  • [x] https://github.com/simonw/datasette-ripgrep
  • [x] https://github.com/datasette/datasette-extract
  • [x] https://github.com/datasette/datasette-create-view
  • [x] https://github.com/simonw/datasette-write
  • [x] https://github.com/datasette/datasette-queries
  • [x] https://github.com/datasette/datasette-write-ui - didn't need changes
  • [ ] https://github.com/datasette/datasette-public
    • [ ] https://github.com/datasette/datasette-public/issues/16
  • [x] https://github.com/datasette/datasette-secrets
  • [x] https://github.com/datasette/datasette-comments
codex exec --dangerously-bypass-approvals-and-sandbox \
"Run the command tadd and look at the errors and then
read ~/dev/datasette/docs/upgrade-1.0a20.md and apply
fixes and run the tests again and get them to pass"

Upgrading setup.py:

claude --permission-mode acceptEdits -p '
Convert setup.py to pyproject.toml, inspired by this example:
https://raw.githubusercontent.com/simonw/datasette-plugin-template-demo/refs/heads/main/pyproject.toml'

Following:

  • #2516
  • #2575

simonw avatar Nov 04 '25 01:11 simonw

This diff may be useful for helping coding agents upgrade other plugins:

commit 04d457bf206042848621a72a192041a301094420
Author: Simon Willison <[email protected]>
Date:   Mon Nov 3 17:31:55 2025 -0800

    datasette-tail for datasette>=1.0a20
    
    Refs https://github.com/simonw/datasette/issues/2577

diff --git a/datasette_tail/__init__.py b/datasette_tail/__init__.py
index ea00684..8e8462f 100644
--- a/datasette_tail/__init__.py
+++ b/datasette_tail/__init__.py
@@ -1,4 +1,5 @@
 from datasette import hookimpl, Forbidden, Response
+from datasette.resources import DatabaseResource
 import dictdiffer
 import json
 from markupsafe import escape
@@ -7,8 +8,8 @@ from markupsafe import escape
 @hookimpl
 def database_actions(datasette, actor, database):
     async def inner():
-        if await datasette.permission_allowed(
-            actor, "view-database", resource=database
+        if await datasette.allowed(
+            actor=actor, action="view-database", resource=DatabaseResource(database)
         ):
             return [
                 {
@@ -22,8 +23,8 @@ def database_actions(datasette, actor, database):
 
 async def _shared(datasette, request):
     database = request.url_vars["database"]
-    if not await datasette.permission_allowed(
-        request.actor, "view-database", resource=database
+    if not await datasette.allowed(
+        actor=request.actor, action="view-database", resource=DatabaseResource(database)
     ):
         raise Forbidden("view-database permission is required")
 
diff --git a/pyproject.toml b/pyproject.toml
index 27ee4ca..72ff1a2 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,17 +1,16 @@
 [project]
 name = "datasette-tail"
-version = "0.1a1"
+version = "0.1a2"
 description = "Tools for tailing your database"
 readme = "README.md"
 authors = [{name = "Simon Willison"}]
-license = {text = "Apache-2.0"}
+license = "Apache-2.0"
 classifiers=[
     "Framework :: Datasette",
-    "License :: OSI Approved :: Apache Software License"
 ]
-requires-python = ">=3.8"
+requires-python = ">=3.10"
 dependencies = [
-    "datasette==1.0a19",
+    "datasette>=1.0a20",
     "dictdiffer"
 ]

simonw avatar Nov 04 '25 01:11 simonw

Here's the simplest version of the release notes:

- Upgraded for compatibility with [Datasette 1.0a20](https://docs.datasette.io/en/latest/changelog.html#a20-2025-11-03).

simonw avatar Nov 04 '25 01:11 simonw

And the commit message:

git commit -a -m "$(basename "$PWD") for datasette>=1.0a20" \
  -m "Refs https://github.com/simonw/datasette/issues/2577"

simonw avatar Nov 04 '25 01:11 simonw

  • https://pypi.org/project/datasette-tail/0.1a2/
  • https://pypi.org/project/datasette-events-forward/0.1a3/
  • https://pypi.org/project/datasette-allow-permissions-debug/0.2a0/
  • https://pypi.org/project/datasette-acl/0.5a0/
  • https://pypi.org/project/datasette-enrichments/0.6a0/
  • https://pypi.org/project/datasette-checkbox/0.1a4/
  • https://pypi.org/project/datasette-debug-actors-from-ids/0.1a3/
  • https://pypi.org/project/datasette-debug-events/0.1a2/
  • https://pypi.org/project/datasette-remove-database/0.1a2/
  • https://pypi.org/project/datasette-remote-actors/0.1a7/
  • https://pypi.org/project/datasette-events-db/0.1a2/
  • https://pypi.org/project/datasette-profiles/0.1a5/
  • https://pypi.org/project/datasette-write-ui/0.0.1a14/
  • https://pypi.org/project/datasette-alerts/0.0.1a6/
  • https://pypi.org/project/datasette-load/0.1a5/
  • https://pypi.org/project/datasette-import/0.1a6/
  • https://pypi.org/project/datasette-metadata-editable/0.2a3/
  • https://pypi.org/project/datasette-query-assistant/0.1a5/
  • https://pypi.org/project/datasette-enrichments-llm/0.1a2/
  • https://pypi.org/project/datasette-llm-usage/0.1a2/
  • https://pypi.org/project/datasette-edit-templates/0.5a0/
  • https://pypi.org/project/datasette-upload-csvs/0.10a0/
  • https://pypi.org/project/datasette-configure-fts/1.2a0/
  • https://pypi.org/project/datasette-auth-tokens/0.4a11/
  • https://pypi.org/project/datasette-upload-dbs/0.4a0/
  • https://pypi.org/project/datasette-edit-schema/0.8a5/
  • https://pypi.org/project/datasette-export-database/0.3a0/
  • https://pypi.org/project/datasette-write/0.5a0/
  • https://pypi.org/project/datasette-extract/0.1a12/
  • https://pypi.org/project/datasette-create-view/0.2a0/
  • https://pypi.org/project/datasette-secrets/0.3a0/
  • https://pypi.org/project/datasette-queries/0.1.3a0/
  • https://pypi.org/project/datasette-ripgrep/0.9a0/
  • https://pypi.org/project/datasette-comments/0.1.1a3/
  • https://pypi.org/project/datasette-pins/0.1a6/

simonw avatar Nov 04 '25 02:11 simonw

I have a folder with checkouts of every single Datasette plugin... so I ran this:

rg -t py permission_allowed -l | cut -d/ -f1 | sort | uniq

And got back 29:

datasette-app-support
datasette-big-local
datasette-big-local-temp
datasette-comments
datasette-create-view
datasette-debug-permissions
datasette-embeddings
datasette-extract
datasette-files
datasette-import-table
datasette-indieauth
datasette-insert
datasette-insert-unsafe
datasette-jsonschema-forms
datasette-litestream
datasette-paste
datasette-permissions-metadata
datasette-permissions-sql
datasette-public
datasette-queries
datasette-ripgrep
datasette-sandstorm-support
datasette-secrets
datasette-short-links
datasette-socrata
datasette-test-plugin
datasette-tiddlywiki
datasette-write
datasette-write-ui

simonw avatar Nov 11 '25 00:11 simonw

I'm now using this new upgrade command:

codex exec --dangerously-bypass-approvals-and-sandbox \
'Run the command tadd and look at the errors and then
read ~/dev/datasette/docs/upgrade-1.0a20.md and apply
fixes and run the tests again and get them to pass.

Also delete the .github directory entirely and replace
it by running this:

cp -r ~/dev/ecosystem/datasette-os-info/.github .

Run a git diff against that to make sure it looks OK
- if there are any notable differences e.g. switching
from Twine to the PyPI uploader or deleting code that
does a special deploy or configures something like 
playwright include that in your final report.

If the project still uses setup.py then edit that new
test.yml and publish.yaml to mention setup.py not pyproject.toml

If this project has pyproject.toml make sure the license
line in that looks like this:

license = "Apache-2.0"

And remove any license thing from the classifiers= array

Update the Datasette dependency in pyproject.toml or
setup.py to "datasette>=1.0a21"

And make sure requires-python is >=3.10'

simonw avatar Nov 11 '25 00:11 simonw