Skip to content

Commit e1a752c

Browse files
committed
Merge commit '4d9d2c0d968d7f3299d74beaa6efc04675fd3bed' into decode-token
2 parents 2b2de4d + 4d9d2c0 commit e1a752c

22 files changed

+86
-420
lines changed

.github/workflows/publish-image.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
4545
- name: Build and push Docker image
4646
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
47+
if: startsWith(github.ref, 'refs/tags/')
4748
with:
4849
context: .
4950
file: Dockerfile
@@ -56,6 +57,7 @@ jobs:
5657
with:
5758
token: ${{ secrets.GITHUB_TOKEN }}
5859
id: install
60+
if: startsWith(github.ref, 'refs/tags/')
5961

6062
- name: Log in to the Chart registry
6163
run: |
@@ -65,4 +67,8 @@ jobs:
6567
run: |
6668
helm dependencies update helm/tiled
6769
helm package helm/tiled --version ${{ steps.meta.outputs.version }} --app-version ${{ steps.meta.outputs.version }} -d /tmp/
70+
71+
- name: Publish Helm chart
72+
if: startsWith(github.ref, 'refs/tags/')
73+
run: |
6874
helm push /tmp/tiled-${{ steps.meta.outputs.version }}.tgz oci://ghcr.io/bluesky/charts

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
<!-- Add the recent changes in the code under the relevant category.
22
Write the date in place of the "Unreleased" in the case a new version is released. -->
3-
43
# Changelog
54

5+
## Unreleased
6+
7+
### Changed
8+
9+
- Removed pydantic-based definitions of structures, which had duplicated
10+
the dataclass-based defintions in order to work around a pydantic bug
11+
which has since been resolved. All modules named `tiled.server.pydantic_*`
12+
have been removed. These were used internally by the server and should
13+
not affect user code.
14+
- Publish Container image and Helm chart only during a tagged release.
15+
- Stop warning when `data_sources()` are fetched after the item was already
16+
fetched. (Too noisy.)
17+
618
## v0.1.0-b17 (2024-01-29)
719

820
### Changed
@@ -24,6 +36,8 @@ Write the date in place of the "Unreleased" in the case a new version is release
2436

2537
- Do not attempt to use auth tokens if the server declares no authentication
2638
providers.
39+
- Prevent "incognito mode" (remember_me=False) from failing after a previous
40+
login session has since been logged out (no token files)
2741

2842
### Maintenance
2943

tiled/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
from ._version import __version__, __version_tuple__ # noqa: F401
1+
from ._version import __version__, __version_tuple__
2+
3+
__all__ = [
4+
"__version__",
5+
"__version_tuple__",
6+
]

tiled/_tests/test_asset_access.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,9 @@ def test_include_data_sources_method_on_self(client):
3535
"Calling include_data_sources() fetches data sources on self."
3636
x = client.write_array([1, 2, 3], key="x")
3737
# Fetch data_sources on x object directly.
38-
with pytest.warns(UserWarning):
39-
# This fetches the sources with an additional implicit request.
40-
x.data_sources()
38+
x.data_sources() is not None
4139
# Fetch data_sources on x object, looked up in client.
42-
with pytest.warns(UserWarning):
43-
# This fetches the sources with an additional implicit request.
44-
client["x"].data_sources()
40+
client["x"].data_sources() is not None
4541
assert client["x"].include_data_sources().data_sources() is not None
4642

4743

tiled/adapters/awkward_directory_container.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
import sys
1+
from collections.abc import Mapping
22
from pathlib import Path
33
from typing import Any, Iterator
44

5-
if sys.version_info < (3, 9):
6-
from typing_extensions import MutableMapping
75

8-
MappingType = MutableMapping
9-
else:
10-
import collections
11-
12-
MappingType = collections.abc.MutableMapping
13-
14-
15-
class DirectoryContainer(MappingType[str, bytes]):
6+
class DirectoryContainer(Mapping[str, bytes]):
167
""" """
178

189
def __init__(self, directory: Path, form: Any):

tiled/adapters/hdf5.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import collections.abc
21
import os
3-
import sys
42
import warnings
3+
from collections.abc import Mapping
54
from typing import Any, Iterator, List, Optional, Tuple, Union
65

76
import h5py
@@ -27,17 +26,7 @@ def from_dataset(dataset: NDArray[Any]) -> ArrayAdapter:
2726
return ArrayAdapter.from_array(dataset, metadata=getattr(dataset, "attrs", {}))
2827

2928

30-
if sys.version_info < (3, 9):
31-
from typing_extensions import Mapping
32-
33-
MappingType = Mapping
34-
else:
35-
import collections
36-
37-
MappingType = collections.abc.Mapping
38-
39-
40-
class HDF5Adapter(MappingType[str, Union["HDF5Adapter", ArrayAdapter]], IndexersMixin):
29+
class HDF5Adapter(Mapping[str, Union["HDF5Adapter", ArrayAdapter]], IndexersMixin):
4130
"""
4231
Read an HDF5 file or a group within one.
4332

tiled/adapters/mapping.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import collections.abc
21
import copy
32
import itertools
43
import operator
5-
import sys
64
from collections import Counter
75
from datetime import datetime, timedelta, timezone
86
from typing import (
@@ -20,6 +18,8 @@
2018
if TYPE_CHECKING:
2119
from fastapi import APIRouter
2220

21+
from collections.abc import Iterable, Mapping
22+
2323
from ..iterviews import ItemsView, KeysView, ValuesView
2424
from ..queries import (
2525
Comparison,
@@ -43,17 +43,8 @@
4343
from .protocols import AccessPolicy, AnyAdapter
4444
from .utils import IndexersMixin
4545

46-
if sys.version_info < (3, 9):
47-
from typing_extensions import Mapping
48-
49-
MappingType = Mapping
50-
else:
51-
import collections
52-
53-
MappingType = collections.abc.Mapping
54-
5546

56-
class MapAdapter(MappingType[str, AnyAdapter], IndexersMixin):
47+
class MapAdapter(Mapping[str, AnyAdapter], IndexersMixin):
5748
"""
5849
Adapt any mapping (dictionary-like object) to Tiled.
5950
"""
@@ -537,7 +528,7 @@ def walk_string_values(tree: MapAdapter, node: Optional[Any] = None) -> Iterator
537528
elif hasattr(value, "items"):
538529
for k, v in value.items():
539530
yield from walk_string_values(value, k)
540-
elif isinstance(value, collections.abc.Iterable):
531+
elif isinstance(value, Iterable):
541532
for item in value:
542533
if isinstance(item, str):
543534
yield item
@@ -706,7 +697,7 @@ def contains(query: Any, tree: MapAdapter) -> MapAdapter:
706697
matches = {}
707698
for key, value, term in iter_child_metadata(query.key, tree):
708699
if (
709-
isinstance(term, collections.abc.Iterable)
700+
isinstance(term, Iterable)
710701
and (not isinstance(term, str))
711702
and (query.value in term)
712703
):

tiled/adapters/protocols.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import collections.abc
2-
import sys
31
from abc import abstractmethod
2+
from collections.abc import Mapping
43
from typing import Any, Dict, List, Literal, Optional, Protocol, Tuple, Union
54

65
import dask.dataframe
@@ -35,17 +34,7 @@ def specs(self) -> List[Spec]:
3534
pass
3635

3736

38-
if sys.version_info < (3, 9):
39-
from typing_extensions import Mapping
40-
41-
MappingType = Mapping
42-
else:
43-
import collections
44-
45-
MappingType = collections.abc.Mapping
46-
47-
48-
class ContainerAdapter(MappingType[str, "AnyAdapter"], BaseAdapter):
37+
class ContainerAdapter(Mapping[str, "AnyAdapter"], BaseAdapter):
4938
structure_family: Literal[StructureFamily.container]
5039

5140
@abstractmethod

tiled/adapters/sparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Any, Dict, List, Optional, Tuple, Union
22

3-
import dask
3+
import dask.dataframe
44
import numpy
55
import pandas
66
import sparse

tiled/adapters/xarray.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import collections.abc
21
import itertools
3-
import sys
2+
from collections.abc import Mapping
43
from typing import Any, Iterator, List, Optional
54

65
import xarray
@@ -82,17 +81,7 @@ def inlined_contents_enabled(self, depth: int) -> bool:
8281
return True
8382

8483

85-
if sys.version_info < (3, 9):
86-
from typing_extensions import Mapping
87-
88-
MappingType = Mapping
89-
else:
90-
import collections
91-
92-
MappingType = collections.abc.Mapping
93-
94-
95-
class _DatasetMap(MappingType[str, Any]):
84+
class _DatasetMap(Mapping[str, Any]):
9685
def __init__(self, dataset: Any) -> None:
9786
"""
9887

0 commit comments

Comments
 (0)