{"html_url": "https://github.com/simonw/datasette/pull/2165#issuecomment-1699802028", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2165", "id": 1699802028, "node_id": "IC_kwDOBm6k_c5lUOus", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-30T20:35:02Z", "updated_at": "2023-08-30T20:35:02Z", "author_association": "OWNER", "body": "Testing this is going to be a bit of a pain.\r\n\r\nI think I'll add a whole separate test block to CI which installs a couple of plugins and then exercises this feature using `datasette plugins`.\r\n\r\nI'll use `datasette-init` and `datasette-json-html` just because they are small and simple.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1874327336, "label": "DATASETTE_LOAD_PLUGINS environment variable for loading specific plugins"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2165#issuecomment-1699809688", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2165", "id": 1699809688, "node_id": "IC_kwDOBm6k_c5lUQmY", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-30T20:41:06Z", "updated_at": "2023-08-30T20:41:06Z", "author_association": "OWNER", "body": "Slight weirdness: I noticed that the output from the `datasette plugins` command looks like this for plugins loaded with the new environment variable:\r\n```json\r\n {\r\n \"name\": \"datasette_pretty_json\",\r\n \"static\": false,\r\n \"templates\": false,\r\n \"version\": null,\r\n \"hooks\": [\r\n \"render_cell\"\r\n ]\r\n },\r\n```\r\nThat should ideally be `datasette-pretty-json`, not `datasette_pretty_json`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1874327336, "label": "DATASETTE_LOAD_PLUGINS environment variable for loading specific plugins"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2165#issuecomment-1699811810", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2165", "id": 1699811810, "node_id": "IC_kwDOBm6k_c5lURHi", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-30T20:42:41Z", "updated_at": "2023-08-30T20:42:41Z", "author_association": "OWNER", "body": "The `load_setuptools_entrypoints()` function in Pluggy [does this](https://github.com/pytest-dev/pluggy/blob/0b41c9766508a46ae666cf281684df3164b3e2a9/src/pluggy/_manager.py#L376):\r\n\r\n```python\r\n for ep in dist.entry_points:\r\n if (\r\n ep.group != group\r\n or (name is not None and ep.name != name)\r\n # already registered\r\n or self.get_plugin(ep.name)\r\n or self.is_blocked(ep.name)\r\n ):\r\n continue\r\n plugin = ep.load()\r\n self.register(plugin, name=ep.name)\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1874327336, "label": "DATASETTE_LOAD_PLUGINS environment variable for loading specific plugins"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2165#issuecomment-1699812599", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2165", "id": 1699812599, "node_id": "IC_kwDOBm6k_c5lURT3", "user": {"value": 22429695, "label": "codecov[bot]"}, "created_at": "2023-08-30T20:43:19Z", "updated_at": "2023-08-30T22:05:05Z", "author_association": "NONE", "body": "## [Codecov](https://app.codecov.io/gh/simonw/datasette/pull/2165?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) Report\nPatch coverage: **`26.66%`** and project coverage change: **`-0.17%`** :warning:\n> Comparison is base [(`30b28c8`)](https://app.codecov.io/gh/simonw/datasette/commit/30b28c8367a9c6870386ea10a202705b40862457?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) 92.84% compared to head [(`5eddf34`)](https://app.codecov.io/gh/simonw/datasette/pull/2165?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) 92.68%.\n\n> :exclamation: Current head 5eddf34 differs from pull request most recent head 6321c9c. Consider uploading reports for the commit 6321c9c to get more accurate results\n\n
Additional details and impacted files\n\n\n```diff\n@@ Coverage Diff @@\n## main #2165 +/- ##\n==========================================\n- Coverage 92.84% 92.68% -0.17% \n==========================================\n Files 40 40 \n Lines 5998 6012 +14 \n==========================================\n+ Hits 5569 5572 +3 \n- Misses 429 440 +11 \n```\n\n\n| [Files Changed](https://app.codecov.io/gh/simonw/datasette/pull/2165?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) | Coverage \u0394 | |\n|---|---|---|\n| [datasette/plugins.py](https://app.codecov.io/gh/simonw/datasette/pull/2165?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison#diff-ZGF0YXNldHRlL3BsdWdpbnMucHk=) | `64.58% <26.66%> (-17.77%)` | :arrow_down: |\n\n\n
\n\n[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/simonw/datasette/pull/2165?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). \n:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison).\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1874327336, "label": "DATASETTE_LOAD_PLUGINS environment variable for loading specific plugins"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2165#issuecomment-1699884314", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2165", "id": 1699884314, "node_id": "IC_kwDOBm6k_c5lUi0a", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-30T21:38:29Z", "updated_at": "2023-08-30T21:39:51Z", "author_association": "OWNER", "body": "Here's the reason for that name disparity:\r\n\r\nhttps://github.com/simonw/datasette/blob/30b28c8367a9c6870386ea10a202705b40862457/datasette/plugins.py#L54-L65\r\n\r\nNote how the `distinfo.project_name` name is used when available. That seems to work for regularly installed plugins but not for plugins loaded via `DATASETTE_LOAD_PLUGINS`.\r\n\r\nAnd that's looking things up in `plugin_to_distinfo` which is populated here:\r\n\r\nhttps://github.com/simonw/datasette/blob/30b28c8367a9c6870386ea10a202705b40862457/datasette/plugins.py#L37", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1874327336, "label": "DATASETTE_LOAD_PLUGINS environment variable for loading specific plugins"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2165#issuecomment-1699910555", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2165", "id": 1699910555, "node_id": "IC_kwDOBm6k_c5lUpOb", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-30T22:05:14Z", "updated_at": "2023-08-30T22:05:14Z", "author_association": "OWNER", "body": "Documentation preview: https://github.com/simonw/datasette/blob/6321c9c055a640ed6ea98e231dc5813dcde1f773/docs/plugins.rst#controlling-which-plugins-are-loaded", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1874327336, "label": "DATASETTE_LOAD_PLUGINS environment variable for loading specific plugins"}, "performed_via_github_app": null}