--version-note for datasette, datasette publish and datasette package

This is a relatively obscure new command-line argument that helps solve the
problem of showing accurate version information in deployed instances of
Datasette even if they were deployed directly from source code.

You can pass --version-note to datasette publish and package and it will then
in turn be passed to datasette when it starts:

    datasette --version-note=hello fixtures.db

Now if you visit /-/versions.json you will see this:

    {
        "datasette": {
            "note": "hello",
            "version": "0+unknown"
        },
        "python": {
            "full": "3.6.5 (default, Jun  6 2018, 19:19:24) \n[GCC 6.3.0 20170516]",
            "version": "3.6.5"
        },
        ...
    }

I plan to use this in some Travis CI configuration, refs #313
This commit is contained in:
Simon Willison 2018-06-17 13:14:55 -07:00
commit db1e6bc182
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
5 changed files with 24 additions and 3 deletions

View file

@ -252,6 +252,7 @@ def test_temporary_docker_directory_uses_hard_link():
static=[],
install=[],
spatialite=False,
version_note=None,
) as temp_docker:
hello = os.path.join(temp_docker, 'hello')
assert 'world' == open(hello).read()
@ -278,6 +279,7 @@ def test_temporary_docker_directory_uses_copy_if_hard_link_fails(mock_link):
static=[],
install=[],
spatialite=False,
version_note=None,
) as temp_docker:
hello = os.path.join(temp_docker, 'hello')
assert 'world' == open(hello).read()