-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a11c1f9
commit a93361d
Showing
10 changed files
with
90 additions
and
13 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
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: Linters | ||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install pylint | ||
pip install mypy | ||
pip install wemake-python-styleguide | ||
pip install black | ||
- name: Analysing the code with pylint | ||
id: pylint | ||
continue-on-error: true | ||
run: PYTHONPATH=. pylint $(find . -name '*.py') | ||
- name: Analysing the code with mypy | ||
id: mypy | ||
continue-on-error: true | ||
run: | | ||
mkdir -p .mypy_cache | ||
PYTHONPATH=. mypy $(find . -name '*.py') --install-types --non-interactive --ignore-missing-imports --exclude __main__.py | ||
- name: Check code with flake8 | ||
id: flake8 | ||
continue-on-error: true | ||
run: PYTHONPATH=. flake8 $(find . -name '*.py') | ||
- name: Check code with Black | ||
id: black | ||
continue-on-error: true | ||
run: PYTHONPATH=. black --diff --check --color $(find . -name '*.py') | ||
- name: Check runner state | ||
run: | | ||
if [[ "${{ steps.pylint.outcome }}" == "failure" || "${{ steps.black.outcome }}" == "failure" || "${{ steps.mypy.outcome }}" == "failure" ]]; then | ||
echo "Linters failed, refer to related sections for info" | ||
exit 1 | ||
fi |
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 +0,0 @@ | ||
- Get rid of 'no_implicit_optional = False' mypy stub | ||
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,16 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Filename: __init__.py | ||
Author: Iliya Vereshchagin | ||
Copyright (c) 2023. All rights reserved. | ||
Created: 15.10.2023 | ||
Last Modified: 15.10.2023 | ||
Description: | ||
This file contains module init | ||
""" | ||
from .src.leonardo_api.leonardo_async import Leonardo as LeonardoAsync # pylint: disable=unused-import | ||
from .src.leonardo_api.leonardo_sync import Leonardo as Leonardo # pylint: disable=unused-import | ||
from .src.leonardo_api.models import platform_models, custom_models, nsfw_models # pylint: disable=unused-import | ||
from .src.leonardo_api.logger_config import setup_logger # pylint: disable=unused-import |
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,5 +1,5 @@ | ||
[metadata] | ||
name = leonardo_api | ||
name = leonardo-api | ||
version = attr: leonardo_api.0.0.6 | ||
author = Iliya Vereshchagin | ||
author_email = [email protected] | ||
|
@@ -11,7 +11,10 @@ keywords = leonardo, leonardo.ai, image generation, stablediffusion, api | |
license = MIT License | ||
classifiers = | ||
License :: OSI Approved :: MIT License | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Programming Language :: Python :: 3.10 | ||
Programming Language :: Python :: 3.11 | ||
|
||
[options] | ||
install_requires = | ||
|
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,9 +1,9 @@ | ||
aiohttp==3.8.5 | ||
aiohttp==3.8.6 | ||
aiofiles==23.2.1 | ||
asyncio==3.4.3 | ||
requests==2.31.0 | ||
urllib3==2.0.5 | ||
urllib3==2.0.6 | ||
async-timeout==4.0.3 | ||
certifi==2023.7.22 | ||
charset-normalizer==3.2.0 | ||
charset-normalizer==3.3.0 | ||
frozenlist==1.4.0 |