Skip to content

Commit

Permalink
Merge pull request #8 from pokedim13/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Дмитрий Бондарев authored Oct 3, 2024
2 parents e066dfd + c108185 commit 0d2fd6a
Show file tree
Hide file tree
Showing 23 changed files with 666 additions and 1,104 deletions.
490 changes: 271 additions & 219 deletions poetry.lock

Large diffs are not rendered by default.

45 changes: 37 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,47 @@
[tool.poetry]
name = "wombo"
version = "0.2.1"
description = ""
authors = ["H3try <skinxedovich@vk.com>"]
version = "0.3.0"
description = "AI picture generated tool"
authors = ["Алексей Баев <baev@cumproject.ru>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.8"
pydantic = "2.1.1"
httpx = "^0.24.1"
pillow = {version = "^10.0.0", optional = true}
httpx = "^0.27.2"
pydantic = "^2.9.2"

[tool.poetry.extras]
gif = ["pillow"]
[tool.poetry.group.dev.dependencies]
ruff = "^0.6.8"

[tool.poetry.group.test.dependencies]
pytest = "^8.3.3"
pytest-asyncio = "^0.24.0"


[tool.ruff]
line-length = 120
exclude = [
"migrations",
"manage.py",
]

[tool.ruff.lint]
unfixable = ["B"]
select = [
"F",
"B",
"E",
"I",
"UP",
"N",
"ANN",
"Q"
]
ignore = ["ANN002", "ANN003", "ANN101", "ANN102", "ANN204"]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402"]
"**/{tests,docs,tools}/*" = ["E402"]


[build-system]
Expand Down
11 changes: 11 additions & 0 deletions tests/example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from wombo import AsyncDream, Dream
import asyncio

async def main():
dream = AsyncDream()
print(await dream.generate("anime waifu"))


dream = Dream()
print(dream.generate("anime waifu"))
asyncio.run(main())
13 changes: 13 additions & 0 deletions tests/test_async.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from wombo import AsyncDream, models

import pytest

dream = AsyncDream()

@pytest.mark.asyncio
async def test_generate():
assert isinstance(await dream.generate("anime waifu"), models.TaskModel)

@pytest.mark.asyncio
async def test_styles():
assert isinstance(await dream.style._get_styles(), models.StyleModel)
9 changes: 9 additions & 0 deletions tests/test_sync.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from wombo import Dream, models

dream = Dream()

def test_generate():
assert isinstance(dream.generate("anime waifu"), models.TaskModel)

def test_styles():
assert isinstance(dream.style._get_styles(), models.StyleModel)
4 changes: 2 additions & 2 deletions wombo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from wombo import models
from wombo.api import AsyncDream, Dream
from wombo.base_models import Style

__all__ = ["AsyncDream", "Dream", "Style"]
__all__ = ["models", "AsyncDream", "Dream"]
6 changes: 3 additions & 3 deletions wombo/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .async_dream import AsyncDream
from .dream import Dream
from wombo.api.async_dream import AsyncDream
from wombo.api.dream import Dream

__all__ = ["Dream", "AsyncDream"]
__all__ = ["AsyncDream", "Dream"]
Loading

0 comments on commit 0d2fd6a

Please sign in to comment.