Skip to content

Commit

Permalink
chore: Migrate to uv
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Sep 25, 2024
1 parent 3de8449 commit 58e9384
Show file tree
Hide file tree
Showing 20 changed files with 574 additions and 915 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ jobs:
uses: seriaati/create-release@main
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
python_version: "3.11"
python_version: "3.11"
uv: "0.4.16"
2 changes: 2 additions & 0 deletions akasha/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from .client import *
from .enums import *
from .errors import *
Expand Down
2 changes: 2 additions & 0 deletions akasha/client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import Any, Final, Self

from aiohttp_client_cache.backends.sqlite import SQLiteBackend
Expand Down
2 changes: 2 additions & 0 deletions akasha/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from .enums import ArtifactStat, CharaStatType

PERCENT_STAT_TYPES: set[CharaStatType | ArtifactStat] = {
Expand Down
2 changes: 2 additions & 0 deletions akasha/enums.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from enum import StrEnum

__all__ = ("ArtifactStat", "CharaStatType", "Element", "EquipType", "Language")
Expand Down
2 changes: 2 additions & 0 deletions akasha/errors.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

__all__ = ("DESC_TO_ERROR", "AkashaAPIError", "UIDNotFoundError")


Expand Down
2 changes: 2 additions & 0 deletions akasha/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from .artifact import *
from .category import *
from .leaderboard import *
Expand Down
2 changes: 2 additions & 0 deletions akasha/models/artifact.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import Any

from pydantic import BaseModel, Field, computed_field, field_validator, model_validator
Expand Down
2 changes: 2 additions & 0 deletions akasha/models/category.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import datetime
from typing import Any, Literal

Expand Down
2 changes: 2 additions & 0 deletions akasha/models/user_calc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import Any, Literal

from pydantic import BaseModel, Field, computed_field, field_validator
Expand Down
807 changes: 0 additions & 807 deletions poetry.lock

This file was deleted.

128 changes: 21 additions & 107 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,118 +1,32 @@
[project]
name = "akasha-py"
requires-python = ">=3.11"

[tool.poetry]
authors = ["seria <seria.ati@gmail.com>"]
version = "0.2.3"
description = "Async API wrapper for akasha.cv written in Python"
documentation = "https://github.com/seriaati/akasha-py/wiki"
license = "GPL-3.0"
name = "akasha-py"
packages = [
{include = "akasha"},
]
readme = "README.md"
repository = "https://github.com/seriaati/akasha-py"
version = "0.2.3"

[tool.poetry.dependencies]
aiohttp = "^3.9.5"
aiohttp-client-cache = {extras = ["sqlite"], version = "^0.11.0"}
loguru = "^0.7.2"
pydantic = "^2.7.4"
python = "^3.11"

[tool.poetry.group.test]
optional = true

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

[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core"]

[tool.ruff]
line-length = 100

[tool.ruff.lint]
ignore = [
"E501",
"ANN401",
"ANN101",
"ANN102",
"PLR0913",
"PLR2004",
"PLR0917",
"PLR6301",
"ANN002",
"ERA001",
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
"RUF100",
]
preview = true
select = [
"E",
"W",
"C90",
"F",
"UP",
"B",
"SIM",
"I",
"N",
"TCH",
"ANN",
"ASYNC",
"A",
"C4",
"EM",
"FA",
"ICN",
"G",
"PIE",
"T20",
"ARG",
"ERA",
"LOG",
"PL",
"TRY",
"D",
"RUF",
]

[tool.ruff.lint.per-file-ignores]
"**/__init__.py" = ["F403", "F401"]
"./migrations/*.py" = ["ALL"]
"hoyo_buddy/draw/**/*.py" = ["PLR", "C"]
"hoyo_buddy/models.py" = ["TCH002"]
"test.py" = ["ALL"]

[tool.ruff.lint.flake8-type-checking]
quote-annotations = true
runtime-evaluated-base-classes = ["pydantic.BaseModel"]

[tool.pyright]
ignore = [
"hoyo_buddy/db/models.py",
requires-python = ">=3.11"
dependencies = [
"aiohttp>=3.10.6",
"aiohttp-client-cache[sqlite]>=0.11.1",
"loguru>=0.7.2",
"pydantic>=2.9.2",
]
authors = [{ "name" = "seriaati", "email" = "seria.ati@gmail.com" }]
license = { file = "LICENSE" }

reportIncompatibleMethodOverride = false
reportIncompatibleVariableOverride = false
[project.urls]
Homepage = "https://github.com/seriaati/akasha-py"
Repository = "https://github.com/seriaati/akasha-py.git"
Issues = "https://github.com/seriaati/akasha-py/issues"

[tool.ruff.lint.mccabe]
max-complexity = 15
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.hatch.build.targets.wheel]
packages = ["akasha"]

[tool.pytest.ini_options]
asyncio_mode = "auto"

[tool.pyright]
typeCheckingMode = "standard"
73 changes: 73 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
line-length = 100
target-version = "py311"

[lint]
ignore = [
"E501",
"ANN401",
"ANN101",
"ANN102",
"PLR0913",
"PLR2004",
"PLR0917",
"PLR6301",
"ANN002",
"ERA001",
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
"RUF100",
]
preview = true
select = [
"E",
"W",
"C90",
"F",
"UP",
"B",
"SIM",
"I",
"N",
"TCH",
"ANN",
"ASYNC",
"A",
"C4",
"EM",
"FA",
"ICN",
"G",
"PIE",
"T20",
"ARG",
"ERA",
"LOG",
"PL",
"TRY",
"D",
"RUF",
]

[lint.per-file-ignores]
"**/__init__.py" = ["F403", "F401"]
"test.py" = ["ALL"]

[lint.mccabe]
max-complexity = 15

[lint.pydocstyle]
convention = "google"

[lint.isort]
required-imports = ["from __future__ import annotations"]
split-on-trailing-comma = false

[lint.flake8-type-checking]
quote-annotations = true
runtime-evaluated-base-classes = ["pydantic.BaseModel"]
2 changes: 2 additions & 0 deletions tests/models/test_artifact.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import akasha


Expand Down
2 changes: 2 additions & 0 deletions tests/models/test_category.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import akasha


Expand Down
2 changes: 2 additions & 0 deletions tests/models/test_leaderboard.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import akasha


Expand Down
2 changes: 2 additions & 0 deletions tests/models/test_translation.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import akasha


Expand Down
2 changes: 2 additions & 0 deletions tests/models/test_user.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import akasha


Expand Down
2 changes: 2 additions & 0 deletions tests/models/test_user_calc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import akasha


Expand Down
Loading

0 comments on commit 58e9384

Please sign in to comment.