-
-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- support type checks with pyright - add github workflow for lint/typecheck/test - configure inclusion/exclusion rules for black - can now be run from the root dir - move all downloaded models to one folder for caching - adds cache to github workflow - add dependencies for type checking - fix type check issues with latest PyQt5 module - fix download_models minimal missing control nets - ignore windows-only constant in type checks - move image out of LFS for CI tests it's tiny, and the rest of the images aren't needed at the moment
- Loading branch information
Showing
27 changed files
with
159 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Lint, Typecheck and Test | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
- name: Dependencies | ||
run: pip install -r requirements.txt | ||
- name: Typecheck | ||
uses: jakebailey/pyright-action@v1 | ||
with: | ||
pylance-version: latest-release | ||
- name: Lint | ||
if: ${{ !cancelled() }} | ||
uses: psf/black@stable | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
- name: Dependencies | ||
run: pip install -r requirements.txt | ||
- name: Cache models | ||
uses: actions/cache@v3 | ||
with: | ||
path: scripts/docker/downloads | ||
key: models-v1 | ||
- name: Download models | ||
run: python scripts/download_models.py --minimal scripts/docker/downloads | ||
- name: Test installer | ||
run: python -m pytest tests/test_server.py -vs --test-install | ||
- name: Test | ||
run: python -m pytest tests -vs --ci | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
[tool.black] | ||
line-length=100 | ||
preview=1 | ||
preview=1 | ||
include='(ai_diffusion|scripts|tests)/.*\.pyi?$' | ||
extend-exclude='websockets|krita\.pyi$' | ||
|
||
[tool.pyright] | ||
include = [ | ||
"ai_diffusion", | ||
"scripts/*.py", | ||
"tests" | ||
] | ||
exclude = [ | ||
"**/__pycache__", | ||
"**/.pytest_cache", | ||
"**/.server", | ||
"ai_diffusion/websockets", | ||
] | ||
ignore = [ | ||
"ai_diffusion/websockets", | ||
"krita.pyi" | ||
] | ||
extraPaths = ["scripts/typeshed"] | ||
reportMissingModuleSource = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.