Wykres commitów

29 Commity (main)

Autor SHA1 Wiadomość Data
Simon Willison 69c6e95323 Fixed a bunch of unused imports spotted with ruff 2024-02-06 17:27:20 -08:00
Simon Willison bcc4f6bf1f
track_event() mechanism for analytics and plugins
* Closes #2240
* Documentation for event plugin hooks, refs #2240
* Include example track_event plugin in docs, refs #2240
* Tests for track_event() and register_events() hooks, refs #2240
* Initial documentation for core events, refs #2240
* Internals documentation for datasette.track_event()
2024-01-31 15:21:40 -08:00
Alex Garcia b2ec8717c3
Plugin configuration now lives in datasette.yaml/json
* Checkpoint, moving top-level plugin config to datasette.json
* Support database-level and table-level plugin configuration in datasette.yaml

Refs #2093
2023-09-13 14:06:25 -07:00
Simon Willison d1d369456a Move HTTPS test to a bash script
See https://github.com/simonw/datasette/issues/1955#issuecomment-1356627931
2022-12-17 18:33:07 -08:00
Simon Willison 8b73fc6b47 Put AsgiLifestyle back so server starts up again, refs #1955 2022-12-17 17:22:00 -08:00
Simon Willison 0e42444866 invoke_startup() inside ds_client fixture, refs #1959 2022-12-17 13:47:55 -08:00
Simon Willison 1335bcb893 Use my own global variable instead of scope=session
Refs https://github.com/simonw/datasette/pull/1960#issuecomment-1354148139
2022-12-17 13:47:55 -08:00
Simon Willison d94d363ec0 Don't use pytest_asyncio.fixture(scope="session") any more, refs #1959
Also got rid of the weird memory=False hack:

https://github.com/simonw/datasette/pull/1960#issuecomment-1354053151
2022-12-17 13:47:55 -08:00
Simon Willison b077e63dc6 Ported test_api.py app_client test to ds_client, refs #1959 2022-12-17 13:47:55 -08:00
Simon Willison 8bf06a76b5
register_permissions() plugin hook (#1940)
* Docs for permissions: in metadata, refs #1636
* Refactor default_permissions.py to help with implementation of #1636
* register_permissions() plugin hook, closes #1939 - also refs #1938
* Tests for register_permissions() hook, refs #1939
* Documentation for datasette.permissions, refs #1939
* permission_allowed() falls back on Permission.default, refs #1939
* Raise StartupError on duplicate permissions
* Allow dupe permisisons if exact matches
2022-12-12 18:05:54 -08:00
Simon Willison c7dd76c262 Poll until servers start, refs #1854 2022-10-25 12:42:45 -07:00
Simon Willison 96b1d0b7b4 Attempted fix for too-long UDS bug in #1407 2021-07-31 11:48:33 -07:00
Simon Willison 180c7a5328 --uds option for binding to Unix domain socket, closes #1388 2021-07-10 16:37:30 -07:00
Simon Willison 030deb4b25 Try to handle intermittent FileNotFoundError in tests
Refs #1361
2021-06-05 16:02:03 -07:00
Konstantin Baikov 8e18c79431
Use context manager instead of plain open (#1211)
Context manager with open closes the files after usage.

When the object is already a pathlib.Path i used read_text
write_text functions

In some cases pathlib.Path.open were used in context manager,
it is basically the same as builtin open.

Thanks, Konstantin Baikov!
2021-03-11 08:15:49 -08:00
Simon Willison eda652cf6e
--ssl-keyfile and --ssl-certfile options to "datasette serve"
Closes #1221
2021-02-11 16:52:16 -08:00
Simon Willison 461670a0b8
Support for generated columns
* Support for generated columns, closes #1116
* Show SQLite version in pytest report header
* Use table_info() if SQLite < 3.26.0
* Cache sqlite_version() rather than re-calculate every time
* Adjust test_database_page for SQLite 3.26.0 or higher
2020-11-30 13:29:57 -08:00
Simon Willison 20b1de86a1 Fix for test I broke in #947 2020-09-11 15:04:23 -07:00
Simon Willison 45414f8412 --get now calls startup() plugin hooks, closes #934 2020-08-15 13:52:41 -07:00
Simon Willison 799c5d5357 Renamed resource_identifier to resource, refs #817 2020-06-08 11:59:53 -07:00
Simon Willison c9f1ec616e Removed resource_type from permissions system, closes #817
Refs #811, #699
2020-06-08 11:51:03 -07:00
Simon Willison 86dec9e8ff Added permission check to every view, closes #808 2020-06-06 22:30:36 -07:00
Simon Willison 67fc9c5720
--port argument for datasette package, plus tests - closes #661
From pull request #663
2020-01-29 14:46:43 -08:00
Simon Willison fcfcae21e6
extra_template_vars plugin hook (#542)
* extra_template_vars plugin hook

Closes #541

* Workaround for cwd bug

Based on https://github.com/pytest-dev/pytest/issues/1235#issuecomment-175295691
2019-07-05 17:05:56 -07:00
Simon Willison 24bf79d2f0 Run sanity checks, not .inspect(), on startup
Also fixes tests that did NOT like a call to run_until_complete in the Datasette() constructor.
2019-05-11 16:22:55 -07:00
Simon Willison c692cd2911 Fix test ordering 2019-05-11 15:03:52 -07:00
Simon Willison a187c81e0c Black + fix broken test 2019-05-11 14:45:59 -07:00
Simon Willison 35d6ee2790
Apply black to everything, enforce via unit tests (#449)
I've run the black code formatting tool against everything:

    black tests datasette setup.py

I also added a new unit test, in tests/test_black.py, which will fail if the code does not
conform to black's exacting standards.

This unit test only runs on Python 3.6 or higher, because black itself doesn't run on 3.5.
2019-05-03 22:15:14 -04:00
Simon Willison ad9de774f7 Added missing file, refs #438 2019-05-01 22:10:23 -07:00