From a93361dd7540f8890b4e48e8a51ca436afbd080a Mon Sep 17 00:00:00 2001 From: wwakabobik Date: Sun, 15 Oct 2023 16:35:30 +0200 Subject: [PATCH 1/3] Bump to 0.7 --- .github/workflows/linters.yml | 4 +-- .github/workflows/master-linters.yml | 52 ++++++++++++++++++++++++++++ README.md | 2 ++ TODO.md | 1 - __init__.py | 16 +++++++++ pyproject.toml | 5 ++- setup.cfg | 7 ++-- src/README.md | 2 ++ src/__main__.py | 8 ++--- src/requirements.txt | 6 ++-- 10 files changed, 90 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/master-linters.yml create mode 100644 __init__.py diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index ba70592..68466b1 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -1,4 +1,4 @@ -name: Linters +name: Linters-PR on: push: @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11.4"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/master-linters.yml b/.github/workflows/master-linters.yml new file mode 100644 index 0000000..2a0b4af --- /dev/null +++ b/.github/workflows/master-linters.yml @@ -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 diff --git a/README.md b/README.md index b26bfa3..5ed49af 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ ## This is Leonardo.ai API. +[![PyPI version](https://badge.fury.io/py/leonardo-api.svg)](https://badge.fury.io/py/leonardo-api) + This package contains Python API for [Leonardo.ai](https://leonardo.ai/) based on official [API documentation](https://docs.leonardo.ai/reference). ![Leonardo.ai interface](https://raw.githubusercontent.com/wwakabobik/leonardo_api/master/src/assets/leonardo_interface.jpg) diff --git a/TODO.md b/TODO.md index e8e291f..e69de29 100644 --- a/TODO.md +++ b/TODO.md @@ -1 +0,0 @@ -- Get rid of 'no_implicit_optional = False' mypy stub \ No newline at end of file diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..32ff308 --- /dev/null +++ b/__init__.py @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 31666fa..d47a10f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,10 @@ dependencies = [ 'frozenlist' ] classifiers = [ - "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] diff --git a/setup.cfg b/setup.cfg index a5b6666..92a3588 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [metadata] -name = leonardo_api +name = leonardo-api version = attr: leonardo_api.0.0.6 author = Iliya Vereshchagin author_email = i.vereshchagin@gmail.com @@ -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 = diff --git a/src/README.md b/src/README.md index b26bfa3..5ed49af 100644 --- a/src/README.md +++ b/src/README.md @@ -1,5 +1,7 @@ ## This is Leonardo.ai API. +[![PyPI version](https://badge.fury.io/py/leonardo-api.svg)](https://badge.fury.io/py/leonardo-api) + This package contains Python API for [Leonardo.ai](https://leonardo.ai/) based on official [API documentation](https://docs.leonardo.ai/reference). ![Leonardo.ai interface](https://raw.githubusercontent.com/wwakabobik/leonardo_api/master/src/assets/leonardo_interface.jpg) diff --git a/src/__main__.py b/src/__main__.py index e191d35..02a33eb 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -10,7 +10,7 @@ Description: This file contains module main init """ -from leonardo_api.leonardo_async import Leonardo as LeonardoAsync -from leonardo_api.leonardo_sync import Leonardo as Leonardo -from leonardo_api.models import platform_models, custom_models, nsfw_models -from leonardo_api.logger_config import setup_logger +from .leonardo_api.leonardo_async import Leonardo as LeonardoAsync # pylint: disable=unused-import +from .leonardo_api.leonardo_sync import Leonardo as Leonardo # pylint: disable=unused-import +from .leonardo_api.models import platform_models, custom_models, nsfw_models # pylint: disable=unused-import +from .leonardo_api.logger_config import setup_logger # pylint: disable=unused-import diff --git a/src/requirements.txt b/src/requirements.txt index 1c9e1a2..b651293 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -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 From c4c3989973ff9f898b11fd53ed0978aad4e0e42c Mon Sep 17 00:00:00 2001 From: wwakabobik Date: Sun, 15 Oct 2023 17:02:32 +0200 Subject: [PATCH 2/3] Bump to 0.0.7 --- README.md | 2 +- pyproject.toml | 10 ++++++++++ setup.cfg | 15 ++++++++++++--- src/README.md | 2 +- src/__init__.py | 4 ++-- src/__main__.py | 4 ++-- src/leonardo_api/__init__.py | 4 ++-- 7 files changed, 30 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 5ed49af..b01f29a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## This is Leonardo.ai API. -[![PyPI version](https://badge.fury.io/py/leonardo-api.svg)](https://badge.fury.io/py/leonardo-api) +[![PyPI version](https://badge.fury.io/py/leonardo-api.svg)](https://badge.fury.io/py/leonardo-api) [![Linters](https://github.com/wwakabobik/leonardo_api/actions/workflows/master-linters.yml/badge.svg?branch=master)](https://github.com/wwakabobik/leonardo_api/actions/workflows/master-linters.yml) This package contains Python API for [Leonardo.ai](https://leonardo.ai/) based on official [API documentation](https://docs.leonardo.ai/reference). diff --git a/pyproject.toml b/pyproject.toml index d47a10f..5e101af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,10 @@ version = "0.0.6" authors = [ { name="Iliya Vereshchagin", email="i.vereshchagin@gmail.com" }, ] +maintainers = [ + { name="Iliya Vereshchagin", email="i.vereshchagin@gmail.com" }, +] +keywords = ["leonardo", "ai", "image generation", "artificial intelligence", "api", "llm", "leonardo.ai", "stablediffusion"] description = "Leonardo.ai Python API" readme = "README.md" license = { file="LICENSE" } @@ -31,6 +35,12 @@ classifiers = [ "Programming Language :: Python :: 3.11", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", + "Intended Audience :: Developers", + "Intended Audience :: Information Technology", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Scientific/Engineering :: Image Processing", + "Topic :: Scientific/Engineering :: Visualization", ] install_requires = [ diff --git a/setup.cfg b/setup.cfg index 92a3588..da506bc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,20 +1,29 @@ [metadata] -name = leonardo-api +name = leonardo_api version = attr: leonardo_api.0.0.6 author = Iliya Vereshchagin author_email = i.vereshchagin@gmail.com +maintainer = Iliya Vereshchagin +maintainer_email = i.vereshchagin@gmail.com url = https://github.com/wwakabobik/leonardo_api description = Leonardo.ai Python API long_description = file: README.md long_description_content_type = text/markdown -keywords = leonardo, leonardo.ai, image generation, stablediffusion, api +keywords = leonardo, leonardo.ai, image generation, stablediffusion, api, llm, ai, artificial intelligence license = MIT License +python_requires = >=3.9 classifiers = - License :: OSI Approved :: MIT License Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Operating System :: OS Independent + Intended Audience :: Developers + Intended Audience :: Information Technology + Topic :: Software Development :: Libraries :: Python Modules + Topic :: Scientific/Engineering :: Artificial Intelligence + Topic :: Scientific/Engineering :: Image Processing + Topic :: Scientific/Engineering :: Visualization [options] install_requires = diff --git a/src/README.md b/src/README.md index 5ed49af..b01f29a 100644 --- a/src/README.md +++ b/src/README.md @@ -1,6 +1,6 @@ ## This is Leonardo.ai API. -[![PyPI version](https://badge.fury.io/py/leonardo-api.svg)](https://badge.fury.io/py/leonardo-api) +[![PyPI version](https://badge.fury.io/py/leonardo-api.svg)](https://badge.fury.io/py/leonardo-api) [![Linters](https://github.com/wwakabobik/leonardo_api/actions/workflows/master-linters.yml/badge.svg?branch=master)](https://github.com/wwakabobik/leonardo_api/actions/workflows/master-linters.yml) This package contains Python API for [Leonardo.ai](https://leonardo.ai/) based on official [API documentation](https://docs.leonardo.ai/reference). diff --git a/src/__init__.py b/src/__init__.py index 239dcef..ebf01a8 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -5,12 +5,12 @@ Copyright (c) 2023. All rights reserved. Created: 29.08.2023 -Last Modified: 29.09.2023 +Last Modified: 15.10.2023 Description: This file contains module init """ from .leonardo_api.leonardo_async import Leonardo as LeonardoAsync -from .leonardo_api.leonardo_sync import Leonardo as Leonardo +from .leonardo_api.leonardo_sync import Leonardo from .leonardo_api.models import platform_models, custom_models, nsfw_models from .leonardo_api.logger_config import setup_logger diff --git a/src/__main__.py b/src/__main__.py index 02a33eb..51bae09 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -5,12 +5,12 @@ Copyright (c) 2023. All rights reserved. Created: 29.08.2023 -Last Modified: 29.09.2023 +Last Modified: 15.10.2023 Description: This file contains module main init """ from .leonardo_api.leonardo_async import Leonardo as LeonardoAsync # pylint: disable=unused-import -from .leonardo_api.leonardo_sync import Leonardo as Leonardo # pylint: disable=unused-import +from .leonardo_api.leonardo_sync import Leonardo # pylint: disable=unused-import from .leonardo_api.models import platform_models, custom_models, nsfw_models # pylint: disable=unused-import from .leonardo_api.logger_config import setup_logger # pylint: disable=unused-import diff --git a/src/leonardo_api/__init__.py b/src/leonardo_api/__init__.py index fb85be0..72df46c 100644 --- a/src/leonardo_api/__init__.py +++ b/src/leonardo_api/__init__.py @@ -5,12 +5,12 @@ Copyright (c) 2023. All rights reserved. Created: 29.08.2023 -Last Modified: 29.09.2023 +Last Modified: 15.10.2023 Description: This file contains module init """ from .leonardo_async import Leonardo as LeonardoAsync -from .leonardo_sync import Leonardo as Leonardo +from .leonardo_sync import Leonardo from .models import platform_models, custom_models, nsfw_models from .logger_config import setup_logger From 7a1ec4ce8bb59ab4d566856fff19282fe5d5296e Mon Sep 17 00:00:00 2001 From: wwakabobik Date: Sun, 15 Oct 2023 17:05:47 +0200 Subject: [PATCH 3/3] Bump to 0.0.7 --- __init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 32ff308..8a932b8 100644 --- a/__init__.py +++ b/__init__.py @@ -11,6 +11,6 @@ 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.leonardo_sync import 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