Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

fix: Update typing using pyright #509

Merged
merged 13 commits into from
Dec 28, 2021
Merged

fix: Update typing using pyright #509

merged 13 commits into from
Dec 28, 2021

Conversation

achimnol
Copy link
Member

This PR fixes typing issues found by pyright, though we are not going to include pyright in CI yet.

* Migrate from aiotools.actxmgr to contextlib.asynccontextmanager
  to utilize typeshed.

* Correct typing of aiohttp cleanup contexts.
@achimnol achimnol added this to the 21.03 milestone Dec 28, 2021
@achimnol achimnol self-assigned this Dec 28, 2021
@codecov
Copy link

codecov bot commented Dec 28, 2021

Codecov Report

Merging #509 (15fcbdd) into main (cf1ef92) will decrease coverage by 0.03%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #509      +/-   ##
==========================================
- Coverage   48.87%   48.83%   -0.04%     
==========================================
  Files          54       54              
  Lines        8952     8965      +13     
==========================================
+ Hits         4375     4378       +3     
- Misses       4577     4587      +10     
Impacted Files Coverage Δ
src/ai/backend/manager/api/events.py 35.90% <0.00%> (-0.14%) ⬇️
src/ai/backend/manager/models/domain.py 58.28% <0.00%> (ø)
src/ai/backend/manager/models/group.py 45.51% <0.00%> (ø)
src/ai/backend/manager/scheduler/dispatcher.py 25.40% <0.00%> (-0.14%) ⬇️
src/ai/backend/manager/config.py 43.86% <33.33%> (ø)
src/ai/backend/manager/idle.py 30.38% <33.33%> (-0.47%) ⬇️
src/ai/backend/manager/registry.py 17.12% <42.85%> (+0.01%) ⬆️
src/ai/backend/manager/api/types.py 91.66% <87.50%> (-8.34%) ⬇️
src/ai/backend/manager/background.py 95.40% <100.00%> (ø)
src/ai/backend/manager/server.py 60.21% <100.00%> (+0.10%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf1ef92...15fcbdd. Read the comment docs.

@achimnol achimnol merged commit 10867fd into main Dec 28, 2021
@achimnol achimnol deleted the fix/update-typing branch December 28, 2021 07:22
achimnol added a commit that referenced this pull request Dec 28, 2021
* Migrate from `aiotools.actxmgr` to `contextlib.asynccontextmanager`
  to utilize typeshed.
* Correct typing of aiohttp cleanup contexts.
* Apply type narrowing (assertions, explicitly raising exceptions on
  non-path branches, etc.)
* Use good fallback return values to remove complicated optional typing
* Fix many "possibly unbound variables" errors
* Now all DB engine refs are `ExtendedAsyncSAEngine`
* test: Use `MagicMock` to let type checkers correctly infer typing
  of mocked objects as the original class
* Migrate `asyncio.ensure_future()` to `asyncio.create_task()`
* Don't use "+" operator to extend `__slots__` in subclasses

Backported-From: main (22.03)
Backported-To: 21.09
achimnol added a commit that referenced this pull request Dec 28, 2021
* Migrate from `aiotools.actxmgr` to `contextlib.asynccontextmanager`
  to utilize typeshed.
* Correct typing of aiohttp cleanup contexts.
* Apply type narrowing (assertions, explicitly raising exceptions on
  non-path branches, etc.)
* Use good fallback return values to remove complicated optional typing
* Fix many "possibly unbound variables" errors
* Now all DB engine refs are `ExtendedAsyncSAEngine`
* test: Use `MagicMock` to let type checkers correctly infer typing
  of mocked objects as the original class
* Migrate `asyncio.ensure_future()` to `asyncio.create_task()`
* Don't use "+" operator to extend `__slots__` in subclasses

Backported-From: main (22.03)
Backported-To: 21.03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant