From ee3fc29f95cf04d9ef98ec8d732ce4ce78b1926c Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Fri, 8 Apr 2022 11:07:08 -0700 Subject: [PATCH] Fixed /plugins and /plugins/datasette-dashboards for non-release packages, refs #98 --- build_directory.py | 9 +++++---- plugin_repos.yml | 1 + scripts/test.sh | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/build_directory.py b/build_directory.py index bf824e3..b0b89fb 100644 --- a/build_directory.py +++ b/build_directory.py @@ -191,8 +191,8 @@ def cli( users.login as owner, repos.description as description, repos.stargazers_count, - releases.tag_name, - max(releases.created_at) as latest_release_at, + pypi_versions.name, + max(pypi_releases.upload_time) as latest_release_at, repos.created_at as created_at, datasette_repos.openGraphImageUrl, datasette_repos.usesCustomOpenGraphImage, @@ -224,7 +224,8 @@ def cli( from datasette_repos join repos on datasette_repos.id = repos.node_id - join releases on repos.id = releases.repo + left join pypi_releases on pypi_releases.package = repos.name + left join pypi_versions on pypi_releases.version = pypi_versions.id join users on users.id = repos.owner where datasette_repos.nameWithOwner in ( @@ -236,7 +237,7 @@ def cli( group by repos.id order by - latest_release_at desc + latest_release_at desc; """.format( repo_table=repo_table ).strip(), diff --git a/plugin_repos.yml b/plugin_repos.yml index ee17ed3..f811722 100644 --- a/plugin_repos.yml +++ b/plugin_repos.yml @@ -81,3 +81,4 @@ - simonw/datasette-packages - simonw/datasette-auth0 - simonw/datasette-hovercards +- rclement/datasette-dashboards \ No newline at end of file diff --git a/scripts/test.sh b/scripts/test.sh index 8f5f630..3e4cee4 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -18,7 +18,7 @@ test_path "/for/exploratory-analysis" test_path "/plugins" test_path "/plugins/datasette-cluster-map" test_path "/plugins/datasette-geojson" -test_path "/plugins/datasette-dashboard" +test_path "/plugins/datasette-dashboards" test_path "/tools" test_path "/tools/shapefile-to-sqlite" test_path "/news"