ci: add mypy github action

pull/411/head^2
Bryce 6 months ago committed by Bryce Drennan
parent 012cc648d3
commit 62de446a92

@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.5.0
with:
python-version: 3.9
python-version: "3.10"
- name: Cache dependencies
uses: actions/cache@v3.2.4
id: cache
@ -35,7 +35,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.5.0
with:
python-version: 3.9
python-version: "3.10"
- name: Cache dependencies
uses: actions/cache@v3.2.4
id: cache
@ -73,3 +73,18 @@ jobs:
CUDA_LAUNCH_BLOCKING: 1
run: |
pytest --durations=10 -v
type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.5.0
with:
python-version: "3.10"
cache: pip
cache-dependency-path: requirements-dev.txt
- name: Install dependencies
run: |
python -m pip install -r requirements-dev.txt . --upgrade
- name: Run mypy
run: |
make type-check

@ -182,7 +182,7 @@ class LazyLoadingImage:
def as_base64(self):
self._load_img()
return self.save_image_as_base64(self._img) # type: ignore
return self.save_image_as_base64(self._img)
def as_pillow(self):
self._load_img()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 2.5 MiB

@ -9,5 +9,11 @@ markers =
[mypy]
plugins = pydantic.mypy
exclude = ^(downloads|dist|other|testing_support|imaginairy/vendored|imaginairy/modules/sgm)/.*
exclude = ^(\./|)(downloads|dist|build|other|testing_support|imaginairy/vendored|imaginairy/modules/sgm)
ignore_missing_imports = True
warn_unused_configs = True
warn_unused_ignores = True
[mypy-imaginairy.vendored.*]
follow_imports = skip
ignore_errors = True
Loading…
Cancel
Save