mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Compare commits
7 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5619069968 | ||
|
|
0b1aa9d1a3 | ||
|
|
a0ff62aac1 | ||
|
|
8da5208561 | ||
|
|
265c62344a | ||
|
|
6b459c8732 | ||
|
|
41060e7e7c |
6 changed files with 57 additions and 8 deletions
1
.github/workflows/test.yml
vendored
1
.github/workflows/test.yml
vendored
|
|
@ -24,6 +24,7 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install -e '.[test]'
|
pip install -e '.[test]'
|
||||||
|
pip freeze
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
pytest -n auto -m "not serial"
|
pytest -n auto -m "not serial"
|
||||||
|
|
|
||||||
|
|
@ -549,6 +549,11 @@ def serve(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# De-duplicate files so 'datasette db.db db.db' only attaches one /db
|
||||||
|
files_seen = set()
|
||||||
|
deduped_files = [f for f in files if f not in files_seen and not files_seen.add(f)]
|
||||||
|
files = deduped_files
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ds = Datasette(files, **kwargs)
|
ds = Datasette(files, **kwargs)
|
||||||
except SpatialiteNotFound:
|
except SpatialiteNotFound:
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
__version__ = "0.60"
|
__version__ = "0.60.2"
|
||||||
__version_info__ = tuple(__version__.split("."))
|
__version_info__ = tuple(__version__.split("."))
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,20 @@
|
||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
.. _v0_60.2:
|
||||||
|
|
||||||
|
0.60.2 (2022-02-07)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
- Fixed a bug where Datasette would open the same file twice with two different database names if you ran ``datasette file.db file.db``. (:issue:`1632`)
|
||||||
|
|
||||||
|
.. _v0_60.1:
|
||||||
|
|
||||||
|
0.60.1 (2022-01-20)
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
- Fixed a bug where installation on Python 3.6 stopped working due to a change to an underlying dependency. This release can now be installed on Python 3.6, but is the last release of Datasette that will support anything less than Python 3.7. (:issue:`1609`)
|
||||||
|
|
||||||
.. _v0_60:
|
.. _v0_60:
|
||||||
|
|
||||||
0.60 (2022-01-13)
|
0.60 (2022-01-13)
|
||||||
|
|
|
||||||
31
setup.py
31
setup.py
|
|
@ -58,6 +58,23 @@ setup(
|
||||||
"mergedeep>=1.1.1,<1.4.0",
|
"mergedeep>=1.1.1,<1.4.0",
|
||||||
"itsdangerous>=1.1,<3.0",
|
"itsdangerous>=1.1,<3.0",
|
||||||
"python-baseconv==1.2.2",
|
"python-baseconv==1.2.2",
|
||||||
|
# The following are known to work with 3.6
|
||||||
|
'asgiref<=3.4.1;python_version<="3.6"',
|
||||||
|
'click<=8.0.3;python_version<="3.6"',
|
||||||
|
'click-default-group<=1.2.2;python_version<="3.6"',
|
||||||
|
'Jinja2<=3.0.3;python_version<="3.6"',
|
||||||
|
'hupper<=1.10.3;python_version<="3.6"',
|
||||||
|
'httpx<=0.21.3;python_version<="3.6"',
|
||||||
|
'pint<=0.17;python_version<="3.6"',
|
||||||
|
'pluggy<=1.0.0;python_version<="3.6"',
|
||||||
|
'uvicorn<=0.16.0;python_version<="3.6"',
|
||||||
|
'aiofiles<=0.8.0;python_version<="3.6"',
|
||||||
|
'janus<=0.7.0;python_version<="3.6"',
|
||||||
|
'asgi-csrf<=0.9;python_version<="3.6"',
|
||||||
|
'PyYAML<=6.0;python_version<="3.6"',
|
||||||
|
'mergedeep<=1.3.4;python_version<="3.6"',
|
||||||
|
'itsdangerous<=2.0.1;python_version<="3.6"',
|
||||||
|
'python-baseconv<=1.2.2;python_version<="3.6"',
|
||||||
],
|
],
|
||||||
entry_points="""
|
entry_points="""
|
||||||
[console_scripts]
|
[console_scripts]
|
||||||
|
|
@ -67,14 +84,14 @@ setup(
|
||||||
extras_require={
|
extras_require={
|
||||||
"docs": ["sphinx_rtd_theme", "sphinx-autobuild", "codespell"],
|
"docs": ["sphinx_rtd_theme", "sphinx-autobuild", "codespell"],
|
||||||
"test": [
|
"test": [
|
||||||
"pytest>=5.2.2,<6.3.0",
|
"pytest==6.2.5",
|
||||||
"pytest-xdist>=2.2.1,<2.6",
|
"pytest-xdist==2.5.0",
|
||||||
"pytest-asyncio>=0.10,<0.17",
|
"pytest-asyncio==0.16.0",
|
||||||
"beautifulsoup4>=4.8.1,<4.11.0",
|
"beautifulsoup4==4.10.0",
|
||||||
"black==21.12b0",
|
"black==21.12b0",
|
||||||
"pytest-timeout>=1.4.2,<2.1",
|
"pytest-timeout==2.0.2",
|
||||||
"trustme>=0.7,<0.10",
|
"trustme==0.9.0",
|
||||||
"cogapp>=3.3.0",
|
"cogapp==3.3.0",
|
||||||
],
|
],
|
||||||
"rich": ["rich"],
|
"rich": ["rich"],
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -259,6 +259,7 @@ def test_serve_create(ensure_eventloop, tmpdir):
|
||||||
|
|
||||||
|
|
||||||
def test_serve_duplicate_database_names(ensure_eventloop, tmpdir):
|
def test_serve_duplicate_database_names(ensure_eventloop, tmpdir):
|
||||||
|
"'datasette db.db nested/db.db' should attach two databases, /db and /db_2"
|
||||||
runner = CliRunner()
|
runner = CliRunner()
|
||||||
db_1_path = str(tmpdir / "db.db")
|
db_1_path = str(tmpdir / "db.db")
|
||||||
nested = tmpdir / "nested"
|
nested = tmpdir / "nested"
|
||||||
|
|
@ -272,6 +273,17 @@ def test_serve_duplicate_database_names(ensure_eventloop, tmpdir):
|
||||||
assert {db["name"] for db in databases} == {"db", "db_2"}
|
assert {db["name"] for db in databases} == {"db", "db_2"}
|
||||||
|
|
||||||
|
|
||||||
|
def test_serve_deduplicate_same_database_path(ensure_eventloop, tmpdir):
|
||||||
|
"'datasette db.db db.db' should only attach one database, /db"
|
||||||
|
runner = CliRunner()
|
||||||
|
db_path = str(tmpdir / "db.db")
|
||||||
|
sqlite3.connect(db_path).execute("vacuum")
|
||||||
|
result = runner.invoke(cli, [db_path, db_path, "--get", "/-/databases.json"])
|
||||||
|
assert result.exit_code == 0, result.output
|
||||||
|
databases = json.loads(result.output)
|
||||||
|
assert {db["name"] for db in databases} == {"db"}
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"filename", ["test-database (1).sqlite", "database (1).sqlite"]
|
"filename", ["test-database (1).sqlite", "database (1).sqlite"]
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue