Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mypy implementation for adapters in tiled #700

Merged
merged 45 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
fe79576
some more changes
Apr 4, 2024
1038553
typed zarr.py
Apr 4, 2024
7595639
typed tiff.py
Apr 4, 2024
06ac19c
xarray.py typed
Apr 4, 2024
a80caba
some more typing added
Apr 5, 2024
786a275
some more typing. still few problems in mapping.py
Apr 5, 2024
82a3d01
more typing
Apr 5, 2024
c5ac22b
still 1 mypy problem left
Apr 8, 2024
1a0b167
docstring skeletons added
Apr 8, 2024
2265002
some more improvement
Apr 9, 2024
c6358fd
solved some docs build problems
Apr 9, 2024
2777e3c
few more changes
Apr 9, 2024
84e64ac
change type_alliases.py
Apr 9, 2024
9a9486f
some more changes
Apr 9, 2024
64a3fdb
some more changes
Apr 9, 2024
8c32d0b
update python to 3.11 in doc compilation
Apr 10, 2024
090eda3
fixed failing tests
Apr 10, 2024
1f4536a
Add protocols
danielballan Apr 10, 2024
6a20cb9
change docs python to 3.10
Apr 10, 2024
be14c77
preliminary addressing to the comments
Apr 12, 2024
8509083
some tests for protocols
Apr 15, 2024
1be2018
some corrections in protocols tests
Apr 15, 2024
9331763
fix small bug in test_protocols.py
Apr 15, 2024
edf4e1f
try to solve EllipsisType that only exists in python 3.10
Apr 15, 2024
9c7aa41
change python version check
Apr 15, 2024
b066f41
some more fix
Apr 15, 2024
5c05e13
Bump Python version of docs build.
danielballan Apr 23, 2024
ed2a731
tests
Apr 24, 2024
95ffb51
some more unit tests for protocols
Apr 25, 2024
4d1f6b0
add accesspolicy protocol tests
Apr 25, 2024
bb0f108
few more fixes
Apr 25, 2024
809089c
python 3.8 MutableMapping problem: try to replacse with the one from …
Apr 26, 2024
126eed2
try to change collections.abc.MApping with typing.Mapping if python<3.8
Apr 26, 2024
b268500
small fixes for typing errors appeared in python 3.8
Apr 26, 2024
e9dfa6d
one more typing fix for python 3.8
Apr 26, 2024
07f717a
some more fix python3.8
Apr 26, 2024
6f4e773
Type awkward buffers dict more strictly
danielballan Apr 26, 2024
7038db5
Tighten typing on data_uris.
danielballan Apr 26, 2024
9f10eb9
Fix typing of partition parameter in read_partition.
danielballan Apr 26, 2024
d923f4f
Zarr accepts array data, not dataframe/tabular.
danielballan Apr 26, 2024
557e32f
Remove commented unused code
danielballan Apr 26, 2024
7d4a34e
Fix typo
danielballan Apr 26, 2024
d000794
Fix type of partition
danielballan Apr 26, 2024
453b807
added a changelog entry
Apr 26, 2024
e863422
Make python-version consistent for docs
danielballan Apr 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Checklist
- [ ] Add a Changelog entry
- [ ] Add the ticket number which this PR closes to the comment section
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: ["3.12"]
fail-fast: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: ["3.12"]
fail-fast: false

steps:
Expand Down
26 changes: 26 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[mypy]
ignore_errors = True
ignore_missing_imports = True
disallow_untyped_defs = False
disallow_untyped_calls = False
check_untyped_defs = False
disallow_incomplete_defs = False


[mypy-tiled.adapters.*]
ignore_errors = False
ignore_missing_imports = False
check_untyped_defs = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
disallow_untyped_calls = True
disallow_untyped_decorators = True

[mypy-tiled._tests.test_protocols]
ignore_errors = False
ignore_missing_imports = False
check_untyped_defs = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
disallow_untyped_calls = True
disallow_untyped_decorators = True
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ repos:
rev: 23.10.1
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
hooks:
- id: mypy
args: [--strict]
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Write the date in place of the "Unreleased" in the case a new version is release
- The `tiled serve ...` CLI commands now accept a `--log-config` option,
pointing to a custom uvicorn logging configuration file. An example
file was added to the repository root, `example_log_config.yml`.
- Added `tiled.adapters.protocols` which will provide possibility for user to
implement their custom adapters in a way that satisfies mypy.

### Changed

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ dev = [
"pytest <8", # TMP pin while plugins catch up
"pytest-asyncio",
"pytest-rerunfailures",
"pytest-mock",
"sphinx !=4.1.0, !=4.1.1, !=4.1.2, !=4.2.0",
# These are dependencies of various sphinx extensions for documentation.
"ipython",
Expand Down
3 changes: 2 additions & 1 deletion tiled/_tests/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ async def test_write_array_internal_direct(a, tmpdir):
)
x = await a.lookup_adapter(["x"])
await x.write(arr)
assert numpy.array_equal(await x.read(), arr)
val = await x.read()
assert numpy.array_equal(val, arr)


def test_write_array_internal_via_client(client):
Expand Down
Loading
Loading