Skip to content

Commit

Permalink
Merge pull request #13 from wwakabobik/0.0.7
Browse files Browse the repository at this point in the history
0.0.7
  • Loading branch information
wwakabobik authored Oct 15, 2023
2 parents 2288af8 + 7a1ec4c commit 1303180
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Linters
name: Linters-PR

on:
push:
Expand All @@ -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
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/master-linters.yml
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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) [![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).

![Leonardo.ai interface](https://raw.githubusercontent.com/wwakabobik/leonardo_api/master/src/assets/leonardo_interface.jpg)
Expand Down
1 change: 0 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
- Get rid of 'no_implicit_optional = False' mypy stub
16 changes: 16 additions & 0 deletions __init__.py
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 # 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
15 changes: 14 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ version = "0.0.6"
authors = [
{ name="Iliya Vereshchagin", email="[email protected]" },
]
maintainers = [
{ name="Iliya Vereshchagin", email="[email protected]" },
]
keywords = ["leonardo", "ai", "image generation", "artificial intelligence", "api", "llm", "leonardo.ai", "stablediffusion"]
description = "Leonardo.ai Python API"
readme = "README.md"
license = { file="LICENSE" }
Expand All @@ -25,9 +29,18 @@ 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",
"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 = [
Expand Down
18 changes: 15 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,27 @@ name = leonardo_api
version = attr: leonardo_api.0.0.6
author = Iliya Vereshchagin
author_email = [email protected]
maintainer = Iliya Vereshchagin
maintainer_email = [email protected]
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
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 =
Expand Down
2 changes: 2 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -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) [![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).

![Leonardo.ai interface](https://raw.githubusercontent.com/wwakabobik/leonardo_api/master/src/assets/leonardo_interface.jpg)
Expand Down
4 changes: 2 additions & 2 deletions src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions src/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 # 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
4 changes: 2 additions & 2 deletions src/leonardo_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1303180

Please sign in to comment.