Skip to content

Commit

Permalink
Merge pull request #109 from ikalnytskyi/chore/ruff-0.9
Browse files Browse the repository at this point in the history
Bump Ruff to 0.9
  • Loading branch information
ikalnytskyi authored Jan 12, 2025
2 parents 04967e4 + 899959c commit 8651d82
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 11 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import importlib.metadata


# -- Project settings
project = "Picobox"
author = "Ihor Kalnytskyi"
Expand Down
47 changes: 42 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,19 @@ Bugs = "https://github.com/ikalnytskyi/picobox/issues"
source = "vcs"

[tool.hatch.envs.test]
dependencies = ["pytest", "pytest-asyncio", "flask", "starlette", "httpx", "async-asgi-testclient"]
dependencies = [
"async-asgi-testclient",
"flask",
"httpx",
"pytest",
"pytest-asyncio",
"starlette",
]
scripts.run = "python -m pytest --strict-markers {args:-vv}"

[tool.hatch.envs.lint]
detached = true
dependencies = ["ruff == 0.7.*"]
dependencies = ["ruff == 0.9.*"]
scripts.run = ["ruff check {args:.}", "ruff format --check --diff {args:.}"]

[tool.hatch.envs.type]
Expand All @@ -56,13 +63,43 @@ line-length = 100

[tool.ruff.lint]
select = ["ALL"]
ignore = ["ANN", "PLR", "D107", "D203", "D213", "D401", "SIM117", "N801", "PLW2901", "PERF203", "COM812", "ISC001"]
ignore = [
"ANN401",
"COM812",
"D107",
"D203",
"D213",
"D401",
"PERF203",
"PLR",
"PLW2901",
"SIM117",
]

[tool.ruff.lint.isort]
lines-after-imports = 2

[tool.ruff.lint.pep8-naming]
extend-ignore-names = [
"_asgiscope",
"_flask_store_obj",
"_flaskscope",
"_wsgiscope",
"application",
"contextvars",
"namespacescope",
"noscope",
"request",
"singleton",
"threadlocal",
]

[tool.ruff.lint.per-file-ignores]
"docs/*" = ["INP001"]
"examples/*" = ["I", "D", "T20", "INP001"]
"examples/*" = ["ANN", "I", "D", "T20", "INP001"]
"examples/flask/wsgi.py" = ["F401", "E402"]
"tests/*" = ["D", "S101", "ARG001", "BLE001", "INP001"]
"tests/*" = ["ANN", "D", "S101", "ARG001", "BLE001", "INP001"]


[tool.mypy]
files = ["src"]
Expand Down
13 changes: 7 additions & 6 deletions src/picobox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
from ._scopes import Scope, contextvars, noscope, singleton, threadlocal
from ._stack import Stack, get, pass_, pop, push, put


__all__ = [
"Box",
"ChainBox",
"Scope",
"singleton",
"threadlocal",
"Stack",
"contextvars",
"get",
"noscope",
"Stack",
"push",
"pass_",
"pop",
"push",
"put",
"get",
"pass_",
"singleton",
"threadlocal",
]
1 change: 1 addition & 0 deletions src/picobox/_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from . import _scopes


if typing.TYPE_CHECKING:
from collections.abc import Awaitable, Callable, Hashable
from typing import Any, ParamSpec, TypeVar, Union
Expand Down
1 change: 1 addition & 0 deletions src/picobox/_scopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import typing
import weakref


if typing.TYPE_CHECKING:
from collections.abc import Hashable
from typing import Any
Expand Down
1 change: 1 addition & 0 deletions src/picobox/_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from ._box import Box, ChainBox, _unset


if typing.TYPE_CHECKING:
from collections.abc import Awaitable, Callable, Generator, Hashable
from contextlib import AbstractContextManager
Expand Down
1 change: 1 addition & 0 deletions src/picobox/ext/asgiscopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import picobox


if typing.TYPE_CHECKING:
from collections.abc import Awaitable, Callable, Hashable, MutableMapping
from typing import Any
Expand Down
1 change: 1 addition & 0 deletions src/picobox/ext/flaskscopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import picobox


if typing.TYPE_CHECKING:
from collections.abc import Hashable
from typing import Any
Expand Down
1 change: 1 addition & 0 deletions src/picobox/ext/wsgiscopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import picobox


if typing.TYPE_CHECKING:
from collections.abc import Hashable, Iterable
from typing import Any
Expand Down

0 comments on commit 8651d82

Please sign in to comment.