{"id": 521323012, "node_id": "MDExOlB1bGxSZXF1ZXN0MzM5NzIyNzkw", "number": 627, "title": "Support Python 3.8, stop supporting Python 3.5", "user": {"value": 9599, "label": "simonw"}, "state": "closed", "locked": 0, "assignee": null, "milestone": null, "comments": 2, "created_at": "2019-11-12T04:36:33Z", "updated_at": "2020-04-05T10:23:58Z", "closed_at": "2019-11-12T05:09:12Z", "author_association": "OWNER", "pull_request": "simonw/datasette/pulls/627", "body": "Refs #622", "repo": {"value": 107914493, "label": "datasette"}, "type": "pull", "active_lock_reason": null, "performed_via_github_app": null, "reactions": "{\"url\": \"https://api.github.com/repos/simonw/datasette/issues/627/reactions\", \"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "draft": 0, "state_reason": null} {"id": 521275281, "node_id": "MDU6SXNzdWU1MjEyNzUyODE=", "number": 13, "title": "Set up a live demo Datasette instance", "user": {"value": 9599, "label": "simonw"}, "state": "closed", "locked": 0, "assignee": null, "milestone": {"value": 5225818, "label": "1.0"}, "comments": 9, "created_at": "2019-11-12T01:27:02Z", "updated_at": "2020-03-24T00:03:26Z", "closed_at": "2020-03-24T00:03:25Z", "author_association": "MEMBER", "pull_request": null, "body": "I deployed https://github-to-sqlite-releases-j7hipcg4aq-uc.a.run.app/ by running this:\r\n```\r\n#!/bin/bash\r\n# Fetch repos for simonw and dogsheep\r\ngithub-to-sqlite repos github.db simonw dogsheep -a auth.json\r\n\r\n# Fetch releases for the repos tagged 'datasette-io'\r\nsqlite-utils github.db \"\r\nselect full_name from repos where rowid in (\r\n select repos.rowid from repos, json_each(repos.topics) j\r\n where j.value = 'datasette-io'\r\n)\" --csv --no-headers | while read repo;\r\n do github-to-sqlite releases \\\r\n github.db $(echo $repo | tr -d '\\r') \\\r\n -a auth.json;\r\n sleep 2;\r\n done;\r\n```\r\nAnd then deploying using this:\r\n```\r\n$ datasette publish cloudrun github.db \\\r\n --title \"github-to-sqlite releases demo\" \\\r\n --about_url=\"https://github.com/simonw/github-to-sqlite\" \\\r\n --about='github-to-sqlite' \\\r\n --install=datasette-render-markdown \\\r\n --install=datasette-json-html \\\r\n --service=github-to-sqlite-releases\r\n```\r\nThis should happen automatically for every release. I can run it once a day in Circle CI to keep the demo database up-to-date.", "repo": {"value": 207052882, "label": "github-to-sqlite"}, "type": "issue", "active_lock_reason": null, "performed_via_github_app": null, "reactions": "{\"url\": \"https://api.github.com/repos/dogsheep/github-to-sqlite/issues/13/reactions\", \"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "draft": null, "state_reason": "completed"} {"id": 521868864, "node_id": "MDU6SXNzdWU1MjE4Njg4NjQ=", "number": 66, "title": "The \".upsert()\" method is misnamed", "user": {"value": 9599, "label": "simonw"}, "state": "closed", "locked": 0, "assignee": null, "milestone": null, "comments": 15, "created_at": "2019-11-12T23:48:28Z", "updated_at": "2019-12-31T01:30:21Z", "closed_at": "2019-12-31T01:30:20Z", "author_association": "OWNER", "pull_request": null, "body": "This thread here is illuminating: https://stackoverflow.com/questions/3634984/insert-if-not-exists-else-update\r\n\r\nThe term `UPSERT` in SQLite has a specific meaning as-of 3.24.0 (2018-06-04): https://www.sqlite.org/lang_UPSERT.html\r\n\r\nIt means \"behave as an UPDATE or a no-op if the INSERT would violate a uniqueness constraint\". The syntax in 3.24.0+ looks like this (confusingly it does not use the term \"upsert\"):\r\n```sql\r\nINSERT INTO phonebook(name,phonenumber) VALUES('Alice','704-555-1212')\r\n ON CONFLICT(name) DO UPDATE SET phonenumber=excluded.phonenumber\r\n```\r\nHere's the problem: the `sqlite-utils` `.upsert()` and `.upsert_all()` methods don't do this. They use the following SQL:\r\n\r\n```sql\r\nINSERT OR REPLACE INTO [{table}] ({columns}) VALUES {rows};\r\n```\r\n\r\nIf the record already exists, it will be entirely replaced by a new record - as opposed to updating any specified fields but leaving existing fields as they are (the behaviour of \"upsert\" in SQLite itself).", "repo": {"value": 140912432, "label": "sqlite-utils"}, "type": "issue", "active_lock_reason": null, "performed_via_github_app": null, "reactions": "{\"url\": \"https://api.github.com/repos/simonw/sqlite-utils/issues/66/reactions\", \"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "draft": null, "state_reason": "completed"} {"id": 521329771, "node_id": "MDU6SXNzdWU1MjEzMjk3NzE=", "number": 628, "title": "Render jinja2 templates in async mode", "user": {"value": 9599, "label": "simonw"}, "state": "closed", "locked": 0, "assignee": null, "milestone": null, "comments": 2, "created_at": "2019-11-12T05:01:55Z", "updated_at": "2019-11-14T23:28:09Z", "closed_at": "2019-11-14T23:14:24Z", "author_association": "OWNER", "pull_request": null, "body": "I started playing with this in #404 and got good results but it didn't work in Python 3.5. As of #627 I don't support 3.5 any more so this can go ahead.\r\n\r\nRendering templates in async mode will mean that template plugins can include async code... which opens the door to custom template functions that execute SQL queries!", "repo": {"value": 107914493, "label": "datasette"}, "type": "issue", "active_lock_reason": null, "performed_via_github_app": null, "reactions": "{\"url\": \"https://api.github.com/repos/simonw/datasette/issues/628/reactions\", \"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "draft": null, "state_reason": "completed"} {"id": 521335335, "node_id": "MDU6SXNzdWU1MjEzMzUzMzU=", "number": 629, "title": "\"datasette publish\" commands should deploy with Python 3.8", "user": {"value": 9599, "label": "simonw"}, "state": "closed", "locked": 0, "assignee": null, "milestone": null, "comments": 1, "created_at": "2019-11-12T05:22:31Z", "updated_at": "2019-11-12T06:03:10Z", "closed_at": "2019-11-12T06:03:10Z", "author_association": "OWNER", "pull_request": null, "body": "Now that we support 3.8 (#627) `datasette publish` should always deploy using Python 3.8.", "repo": {"value": 107914493, "label": "datasette"}, "type": "issue", "active_lock_reason": null, "performed_via_github_app": null, "reactions": "{\"url\": \"https://api.github.com/repos/simonw/datasette/issues/629/reactions\", \"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "draft": null, "state_reason": "completed"} {"id": 521346800, "node_id": "MDExOlB1bGxSZXF1ZXN0MzM5NzQyNDMy", "number": 630, "title": "Use python:3.8 base Docker image", "user": {"value": 9599, "label": "simonw"}, "state": "closed", "locked": 0, "assignee": null, "milestone": null, "comments": 0, "created_at": "2019-11-12T06:02:37Z", "updated_at": "2019-11-12T06:03:10Z", "closed_at": "2019-11-12T06:03:10Z", "author_association": "OWNER", "pull_request": "simonw/datasette/pulls/630", "body": "Closes #629", "repo": {"value": 107914493, "label": "datasette"}, "type": "pull", "active_lock_reason": null, "performed_via_github_app": null, "reactions": "{\"url\": \"https://api.github.com/repos/simonw/datasette/issues/630/reactions\", \"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "draft": 0, "state_reason": null} {"id": 521282013, "node_id": "MDU6SXNzdWU1MjEyODIwMTM=", "number": 626, "title": "Unit tests should fail under Python 3.8", "user": {"value": 9599, "label": "simonw"}, "state": "closed", "locked": 0, "assignee": null, "milestone": null, "comments": 1, "created_at": "2019-11-12T01:54:11Z", "updated_at": "2019-11-12T04:31:26Z", "closed_at": "2019-11-12T04:31:13Z", "author_association": "OWNER", "pull_request": null, "body": "The unit tests currently pass under Python 3.8.\r\n\r\nBut... when you actually attempt to run Datasette you get an error:\r\n```\r\n~/Dropbox/Development/datasette $ venv-py3.8.0/bin/datasette --memory -p 8855\r\nServe! files=() (immutables=()) on port 8855\r\nTraceback (most recent call last):\r\n File \"venv-py3.8.0/bin/datasette\", line 11, in \r\n load_entry_point('datasette', 'console_scripts', 'datasette')()\r\n File \"/Users/simonw/Dropbox/Development/datasette/venv-py3.8.0/lib/python3.8/site-packages/click/core.py\", line 764, in __call__\r\n return self.main(*args, **kwargs)\r\n File \"/Users/simonw/Dropbox/Development/datasette/venv-py3.8.0/lib/python3.8/site-packages/click/core.py\", line 717, in main\r\n rv = self.invoke(ctx)\r\n File \"/Users/simonw/Dropbox/Development/datasette/venv-py3.8.0/lib/python3.8/site-packages/click/core.py\", line 1137, in invoke\r\n return _process_result(sub_ctx.command.invoke(sub_ctx))\r\n File \"/Users/simonw/Dropbox/Development/datasette/venv-py3.8.0/lib/python3.8/site-packages/click/core.py\", line 956, in invoke\r\n return ctx.invoke(self.callback, **ctx.params)\r\n File \"/Users/simonw/Dropbox/Development/datasette/venv-py3.8.0/lib/python3.8/site-packages/click/core.py\", line 555, in invoke\r\n return callback(*args, **kwargs)\r\n File \"/Users/simonw/Dropbox/Development/datasette/datasette/cli.py\", line 365, in serve\r\n uvicorn.run(ds.app(), host=host, port=port, log_level=\"info\")\r\n File \"/Users/simonw/Dropbox/Development/datasette/venv-py3.8.0/lib/python3.8/site-packages/uvicorn/main.py\", line 279, in run\r\n server.run()\r\n File \"/Users/simonw/Dropbox/Development/datasette/venv-py3.8.0/lib/python3.8/site-packages/uvicorn/main.py\", line 305, in run\r\n self.config.setup_event_loop()\r\n File \"/Users/simonw/Dropbox/Development/datasette/venv-py3.8.0/lib/python3.8/site-packages/uvicorn/config.py\", line 218, in setup_event_loop\r\n loop_setup()\r\n File \"/Users/simonw/Dropbox/Development/datasette/venv-py3.8.0/lib/python3.8/site-packages/uvicorn/loops/auto.py\", line 3, in auto_loop_setup\r\n import uvloop\r\n File \"/Users/simonw/Dropbox/Development/datasette/venv-py3.8.0/lib/python3.8/site-packages/uvloop/__init__.py\", line 7, in \r\n from .loop import Loop as __BaseLoop # NOQA\r\n File \"uvloop/includes/stdlib.pxi\", line 114, in init uvloop.loop\r\nAttributeError: module 'sys' has no attribute 'set_coroutine_wrapper'\r\n~/Dropbox/Development/datasette $ \r\n```\r\nIf Datasette doesn't work under Python 3.8 the tests should fail.", "repo": {"value": 107914493, "label": "datasette"}, "type": "issue", "active_lock_reason": null, "performed_via_github_app": null, "reactions": "{\"url\": \"https://api.github.com/repos/simonw/datasette/issues/626/reactions\", \"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "draft": null, "state_reason": "completed"}