{"html_url": "https://github.com/simonw/datasette/issues/1737#issuecomment-1115470180", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1737", "id": 1115470180, "node_id": "IC_kwDOBm6k_c5CfLlk", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-05-02T23:39:29Z", "updated_at": "2022-05-02T23:39:29Z", "author_association": "OWNER", "body": "Test ran in 38 seconds and passed! https://github.com/simonw/datasette/runs/6265954274?check_suite_focus=true\r\n\r\nI'm going to have it run on every commit and PR.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1223459734, "label": "Automated test for Pyodide compatibility"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1737#issuecomment-1115468193", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1737", "id": 1115468193, "node_id": "IC_kwDOBm6k_c5CfLGh", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-05-02T23:35:26Z", "updated_at": "2022-05-02T23:35:26Z", "author_association": "OWNER", "body": "https://github.com/simonw/datasette/runs/6265915080?check_suite_focus=true failed but looks like it passed because I forgot to use `set -e` at the start of the bash script.\r\n\r\nIt failed because it didn't have `build` available.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1223459734, "label": "Automated test for Pyodide compatibility"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1737#issuecomment-1115464097", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1737", "id": 1115464097, "node_id": "IC_kwDOBm6k_c5CfKGh", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-05-02T23:27:40Z", "updated_at": "2022-05-02T23:27:40Z", "author_association": "OWNER", "body": "I'm going to start off by running this manually - I may run it on every commit once this is all a little bit more stable.\r\n\r\nI can base the workflow on https://github.com/simonw/scrape-hacker-news-by-domain/blob/main/.github/workflows/scrape.yml", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1223459734, "label": "Automated test for Pyodide compatibility"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1737#issuecomment-1115462720", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1737", "id": 1115462720, "node_id": "IC_kwDOBm6k_c5CfJxA", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-05-02T23:25:03Z", "updated_at": "2022-05-02T23:25:03Z", "author_association": "OWNER", "body": "Here's a script that seems to work. It builds the wheel, starts a Python web server that serves the wheel, runs a test with `shot-scraper` and then shuts down the server again.\r\n\r\n```bash\r\n#!/bin/bash\r\n\r\n# Build the wheel\r\npython3 -m build\r\n\r\n# Find name of wheel\r\nwheel=$(basename $(ls dist/*.whl))\r\n# strip off the dist/\r\n\r\n\r\n# Create a blank index page\r\necho '\r\n\r\n' > dist/index.html\r\n\r\n# Run a server for that dist/ folder\r\ncd dist\r\npython3 -m http.server 8529 &\r\ncd ..\r\n\r\nshot-scraper javascript http://localhost:8529/ \"\r\nasync () => {\r\n let pyodide = await loadPyodide();\r\n await pyodide.loadPackage(['micropip', 'ssl', 'setuptools']);\r\n let output = await pyodide.runPythonAsync(\\`\r\n import micropip\r\n await micropip.install('h11==0.12.0')\r\n await micropip.install('http://localhost:8529/$wheel')\r\n import ssl\r\n import setuptools\r\n from datasette.app import Datasette\r\n ds = Datasette(memory=True, settings={'num_sql_threads': 0})\r\n (await ds.client.get('/_memory.json?sql=select+55+as+itworks&_shape=array')).text\r\n \\`);\r\n if (JSON.parse(output)[0].itworks != 55) {\r\n throw 'Got ' + output + ', expected itworks: 55';\r\n }\r\n return 'Test passed!';\r\n}\r\n\"\r\n\r\n# Shut down the server\r\npkill -f 'http.server 8529'\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1223459734, "label": "Automated test for Pyodide compatibility"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1733#issuecomment-1115404729", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1733", "id": 1115404729, "node_id": "IC_kwDOBm6k_c5Ce7m5", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-05-02T21:49:01Z", "updated_at": "2022-05-02T21:49:38Z", "author_association": "OWNER", "body": "That alpha release works!\r\n\r\nhttps://pyodide.org/en/stable/console.html\r\n\r\n```pycon\r\nWelcome to the Pyodide terminal emulator \ud83d\udc0d\r\nPython 3.10.2 (main, Apr 9 2022 20:52:01) on WebAssembly VM\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import micropip\r\n>>> await micropip.install(\"datasette==0.62a0\")\r\n>>> import ssl\r\n>>> import setuptools\r\n>>> from datasette.app import Datasette\r\n>>> ds = Datasette(memory=True, settings={\"num_sql_threads\": 0})\r\n>>> await ds.client.get(\"/.json\")\r\n\r\n>>> (await ds.client.get(\"/.json\")).json()\r\n{'_memory': {'name': '_memory', 'hash': None, 'color': 'a6c7b9', 'path': '/_memory', 'tables_and_views_truncated': [], 'tab\r\nles_and_views_more': False, 'tables_count': 0, 'table_rows_sum': 0, 'show_table_row_counts': False, 'hidden_table_rows_sum'\r\n: 0, 'hidden_tables_count': 0, 'views_count': 0, 'private': False}}\r\n>>> \r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1223234932, "label": "Get Datasette compatible with Pyodide"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1733#issuecomment-1115318417", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1733", "id": 1115318417, "node_id": "IC_kwDOBm6k_c5CemiR", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-05-02T20:13:43Z", "updated_at": "2022-05-02T20:13:43Z", "author_association": "OWNER", "body": "This is good enough to push an alpha.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1223234932, "label": "Get Datasette compatible with Pyodide"}, "performed_via_github_app": null}
{"html_url": "https://github.com/simonw/datasette/issues/1733#issuecomment-1115318303", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1733", "id": 1115318303, "node_id": "IC_kwDOBm6k_c5Cemgf", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-05-02T20:13:36Z", "updated_at": "2022-05-02T20:13:36Z", "author_association": "OWNER", "body": "I got a build from the `pyodide` branch to work!\r\n\r\n```\r\nWelcome to the Pyodide terminal emulator \ud83d\udc0d\r\nPython 3.10.2 (main, Apr 9 2022 20:52:01) on WebAssembly VM\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import micropip\r\n>>> await micropip.install(\"https://s3.amazonaws.com/simonwillison-cors-allowed-public/datasette-0.62a0-py3-none-any.whl\")\r\nTraceback (most recent call last):\r\n File \"\", line 1, in \r\n File \"/lib/python3.10/asyncio/futures.py\", line 284, in __await__\r\n yield self # This tells Task to wait for completion.\r\n File \"/lib/python3.10/asyncio/tasks.py\", line 304, in __wakeup\r\n future.result()\r\n File \"/lib/python3.10/asyncio/futures.py\", line 201, in result\r\n raise self._exception\r\n File \"/lib/python3.10/asyncio/tasks.py\", line 234, in __step\r\n result = coro.throw(exc)\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 183, in install\r\n transaction = await self.gather_requirements(requirements, ctx, keep_going)\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 173, in gather_requirements\r\n await gather(*requirement_promises)\r\n File \"/lib/python3.10/asyncio/futures.py\", line 284, in __await__\r\n yield self # This tells Task to wait for completion.\r\n File \"/lib/python3.10/asyncio/tasks.py\", line 304, in __wakeup\r\n future.result()\r\n File \"/lib/python3.10/asyncio/futures.py\", line 201, in result\r\n raise self._exception\r\n File \"/lib/python3.10/asyncio/tasks.py\", line 232, in __step\r\n result = coro.send(None)\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 245, in add_requirement\r\n await self.add_wheel(name, wheel, version, (), ctx, transaction)\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 316, in add_wheel\r\n await self.add_requirement(recurs_req, ctx, transaction)\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 291, in add_requirement\r\n await self.add_wheel(\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 316, in add_wheel\r\n await self.add_requirement(recurs_req, ctx, transaction)\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 291, in add_requirement\r\n await self.add_wheel(\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 316, in add_wheel\r\n await self.add_requirement(recurs_req, ctx, transaction)\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 276, in add_requirement\r\n raise ValueError(\r\nValueError: Requested 'h11<0.13,>=0.11', but h11==0.13.0 is already installed\r\n>>> await micropip.install(\"https://s3.amazonaws.com/simonwillison-cors-allowed-public/datasette-0.62a0-py3-none-any.whl\")\r\nTraceback (most recent call last):\r\n File \"\", line 1, in \r\n File \"/lib/python3.10/asyncio/futures.py\", line 284, in __await__\r\n yield self # This tells Task to wait for completion.\r\n File \"/lib/python3.10/asyncio/tasks.py\", line 304, in __wakeup\r\n future.result()\r\n File \"/lib/python3.10/asyncio/futures.py\", line 201, in result\r\n raise self._exception\r\n File \"/lib/python3.10/asyncio/tasks.py\", line 234, in __step\r\n result = coro.throw(exc)\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 183, in install\r\n transaction = await self.gather_requirements(requirements, ctx, keep_going)\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 173, in gather_requirements\r\n await gather(*requirement_promises)\r\n File \"/lib/python3.10/asyncio/futures.py\", line 284, in __await__\r\n yield self # This tells Task to wait for completion.\r\n File \"/lib/python3.10/asyncio/tasks.py\", line 304, in __wakeup\r\n future.result()\r\n File \"/lib/python3.10/asyncio/futures.py\", line 201, in result\r\n raise self._exception\r\n File \"/lib/python3.10/asyncio/tasks.py\", line 232, in __step\r\n result = coro.send(None)\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 245, in add_requirement\r\n await self.add_wheel(name, wheel, version, (), ctx, transaction)\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 316, in add_wheel\r\n await self.add_requirement(recurs_req, ctx, transaction)\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 291, in add_requirement\r\n await self.add_wheel(\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 316, in add_wheel\r\n await self.add_requirement(recurs_req, ctx, transaction)\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 291, in add_requirement\r\n await self.add_wheel(\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 316, in add_wheel\r\n await self.add_requirement(recurs_req, ctx, transaction)\r\n File \"/lib/python3.10/site-packages/micropip/_micropip.py\", line 276, in add_requirement\r\n raise ValueError(\r\nValueError: Requested 'h11<0.13,>=0.11', but h11==0.13.0 is already installed\r\n>>> await micropip.install(\"h11==0.12\")\r\n>>> await micropip.install(\"https://s3.amazonaws.com/simonwillison-cors-allowed-public/datasette-0.62a0-py3-none-any.whl\")\r\n>>> import datasette\r\n>>> from datasette.app import Datasette\r\nTraceback (most recent call last):\r\n File \"\", line 1, in \r\n File \"/lib/python3.10/site-packages/datasette/app.py\", line 9, in \r\n import httpx\r\n File \"/lib/python3.10/site-packages/httpx/__init__.py\", line 2, in \r\n from ._api import delete, get, head, options, patch, post, put, request, stream\r\n File \"/lib/python3.10/site-packages/httpx/_api.py\", line 4, in \r\n from ._client import Client\r\n File \"/lib/python3.10/site-packages/httpx/_client.py\", line 9, in \r\n from ._auth import Auth, BasicAuth, FunctionAuth\r\n File \"/lib/python3.10/site-packages/httpx/_auth.py\", line 10, in \r\n from ._models import Request, Response\r\n File \"/lib/python3.10/site-packages/httpx/_models.py\", line 16, in \r\n from ._content import ByteStream, UnattachedStream, encode_request, encode_response\r\n File \"/lib/python3.10/site-packages/httpx/_content.py\", line 17, in \r\n from ._multipart import MultipartStream\r\n File \"/lib/python3.10/site-packages/httpx/_multipart.py\", line 7, in \r\n from ._types import (\r\n File \"/lib/python3.10/site-packages/httpx/_types.py\", line 5, in \r\n import ssl\r\n File \"/lib/python3.10/ssl.py\", line 98, in \r\n import _ssl # if we can't import it, let the error propagate\r\nModuleNotFoundError: No module named '_ssl'\r\n>>> import ssl\r\n>>> from datasette.app import Datasette\r\nTraceback (most recent call last):\r\n File \"\", line 1, in \r\n File \"/lib/python3.10/site-packages/datasette/app.py\", line 14, in \r\n import pkg_resources\r\nModuleNotFoundError: No module named 'pkg_resources'\r\n>>> import setuptools\r\n>>> from datasette.app import Datasette\r\n>>> ds = Datasette(memory=True)\r\n>>> ds\r\n\r\n>>> await ds.client.get(\"/\")\r\nTraceback (most recent call last):\r\n File \"/lib/python3.10/site-packages/datasette/app.py\", line 1268, in route_path\r\n response = await view(request, send)\r\n File \"/lib/python3.10/site-packages/datasette/views/base.py\", line 134, in view\r\n return await self.dispatch_request(request)\r\n File \"/lib/python3.10/site-packages/datasette/views/base.py\", line 89, in dispatch_request\r\n await self.ds.refresh_schemas()\r\n File \"/lib/python3.10/site-packages/datasette/app.py\", line 353, in refresh_schemas\r\n await self._refresh_schemas()\r\n File \"/lib/python3.10/site-packages/datasette/app.py\", line 358, in _refresh_schemas\r\n await init_internal_db(internal_db)\r\n File \"/lib/python3.10/site-packages/datasette/utils/internal_db.py\", line 65, in init_internal_db\r\n await db.execute_write_script(create_tables_sql)\r\n File \"/lib/python3.10/site-packages/datasette/database.py\", line 116, in execute_write_script\r\n results = await self.execute_write_fn(_inner, block=block)\r\n File \"/lib/python3.10/site-packages/datasette/database.py\", line 155, in execute_write_fn\r\n self._write_thread.start()\r\n File \"/lib/python3.10/threading.py\", line 928, in start\r\n _start_new_thread(self._bootstrap, ())\r\nRuntimeError: can't start new thread\r\n\r\n>>> ds = Datasette(memory=True, settings={\"num_sql_threads\": 0})\r\n>>> await ds.client.get(\"/\")\r\n\r\n>>> (await ds.client.get(\"/\")).text\r\n'\\n\\n\\n Datasette: _memory\\n \\n \\n\\n\\n\\n