Skip to content

Commit 52acbba

Browse files
authored
Merge pull request #80 from taskiq-python/develop
chore: drop python3.8
2 parents b113ee0 + 41e3b50 commit 52acbba

File tree

17 files changed

+107
-46
lines changed

17 files changed

+107
-46
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,16 @@ updates:
1010
directory: "/"
1111
schedule:
1212
interval: "weekly"
13+
groups:
14+
github-actions:
15+
patterns:
16+
- "*"
1317
# Python
1418
- package-ecosystem: "pip" # See documentation for possible values
1519
directory: "/" # Location of package manifests
1620
schedule:
1721
interval: "weekly"
22+
groups:
23+
pip:
24+
patterns:
25+
- "*"

.github/workflows/test.yml

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ on:
55
branches:
66
- master
77
pull_request:
8-
types: [opened, synchronize]
8+
types:
9+
- opened
10+
- synchronize
11+
- ready_for_review
912

1013
jobs:
1114
static_analysis:
@@ -16,31 +19,36 @@ jobs:
1619
- uses: actions/setup-python@v5
1720
with:
1821
python-version: 3.9
19-
- name: Install Dependencies and library
20-
shell: bash
21-
run: |
22-
set -ux
23-
python -m pip install --upgrade pip
24-
pip install -e ".[dev]"
22+
23+
- uses: actions/cache@v4
24+
id: cache
25+
with:
26+
path: ${{ env.pythonLocation }}
27+
key: ${{ runner.os }}-static-analysis-${{ hashFiles('pyproject.toml') }}-test-v03
28+
- uses: astral-sh/setup-uv@v6
29+
if: steps.cache.outputs.cache-hit != 'true'
30+
with:
31+
version: "latest"
32+
- name: Install Dependencies
33+
if: steps.cache.outputs.cache-hit != 'true'
34+
run: uv pip install --system ".[dev]"
2535

2636
- name: Run formatter
2737
shell: bash
2838
run: ruff format taskiq_faststream
29-
39+
- name: Run ruff
40+
shell: bash
41+
run: ruff check taskiq_faststream
3042
- name: Run mypy
3143
shell: bash
3244
run: mypy taskiq_faststream
3345

34-
- name: Run ruff
35-
shell: bash
36-
run: ruff taskiq_faststream
37-
3846
test:
3947
if: github.event.pull_request.draft == false
4048
runs-on: ubuntu-latest
4149
strategy:
4250
matrix:
43-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
51+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
4452
fail-fast: false
4553

4654
steps:
@@ -49,14 +57,20 @@ jobs:
4957
uses: actions/setup-python@v5
5058
with:
5159
python-version: ${{ matrix.python-version }}
60+
5261
- uses: actions/cache@v4
5362
id: cache
5463
with:
5564
path: ${{ env.pythonLocation }}
5665
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test-v03
66+
- uses: astral-sh/setup-uv@v6
67+
if: steps.cache.outputs.cache-hit != 'true'
68+
with:
69+
version: "latest"
5770
- name: Install Dependencies
5871
if: steps.cache.outputs.cache-hit != 'true'
59-
run: pip install -e .[test]
72+
run: uv pip install --system ".[test]"
73+
6074
- run: mkdir coverage
6175
- name: Test
6276
run: bash scripts/test.sh
@@ -69,6 +83,7 @@ jobs:
6983
name: .coverage.${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.pydantic-version }}
7084
path: coverage
7185
if-no-files-found: error
86+
include-hidden-files: true
7287

7388
coverage-combine:
7489
needs: [test]
@@ -79,7 +94,11 @@ jobs:
7994

8095
- uses: actions/setup-python@v5
8196
with:
82-
python-version: '3.8'
97+
python-version: 3.9
98+
99+
- uses: astral-sh/setup-uv@v6
100+
with:
101+
version: "latest"
83102

84103
- name: Get coverage files
85104
uses: actions/download-artifact@v4
@@ -88,7 +107,7 @@ jobs:
88107
path: coverage
89108
merge-multiple: true
90109

91-
- run: pip install coverage[toml]
110+
- run: uv pip install --system "coverage[toml]"
92111

93112
- run: ls -la coverage
94113
- run: coverage combine coverage
@@ -100,6 +119,8 @@ jobs:
100119
with:
101120
name: coverage-html
102121
path: htmlcov
122+
if-no-files-found: error
123+
include-hidden-files: true
103124

104125
# https://github.com/marketplace/actions/alls-green#why
105126
check: # This job does nothing and is only used for the branch protection

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
uv.lock
2+
13
# Byte-compiled / optimized / DLL files
24
__pycache__/
35
*.py[cod]
@@ -143,6 +145,8 @@ venv.bak/
143145
.dmypy.json
144146
dmypy.json
145147

148+
.ruff_cache/
149+
146150
# Pyre type checker
147151
.pyre/
148152

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ pip install taskiq-faststream[rabbit]
4040
pip install taskiq-faststream[kafka]
4141
# or
4242
pip install taskiq-faststream[nats]
43+
# or
44+
pip install taskiq-faststream[redis]
4345
```
4446

4547
## Usage

pyproject.toml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ authors = [
1313

1414
keywords = ["taskiq", "tasks", "distributed", "async", "FastStream"]
1515

16-
requires-python = ">=3.8"
16+
requires-python = ">=3.9"
1717

1818
classifiers = [
1919
"Development Status :: 5 - Production/Stable",
2020
"License :: OSI Approved :: MIT License",
2121
"Programming Language :: Python",
2222
"Programming Language :: Python :: 3",
2323
"Programming Language :: Python :: 3 :: Only",
24-
"Programming Language :: Python :: 3.8",
2524
"Programming Language :: Python :: 3.9",
2625
"Programming Language :: Python :: 3.10",
2726
"Programming Language :: Python :: 3.11",
2827
"Programming Language :: Python :: 3.12",
28+
"Programming Language :: Python :: 3.13",
2929
"Operating System :: OS Independent",
3030
"Topic :: Software Development :: Libraries :: Python Modules",
3131
"Topic :: Software Development :: Libraries",
@@ -81,10 +81,9 @@ test = [
8181

8282
dev = [
8383
"taskiq-faststream[test]",
84-
85-
"mypy>=1.8.0,<1.12.0",
86-
"ruff==0.4.1",
87-
"pre-commit >=3.6.0,<4.0.0",
84+
"mypy==1.11.2",
85+
"ruff==0.11.8",
86+
"pre-commit >=3.6.0,<5.0.0",
8887
]
8988

9089
[project.urls]
@@ -107,7 +106,7 @@ exclude = [
107106
]
108107

109108
[tool.mypy]
110-
python_version = "3.8"
109+
python_version = "3.9"
111110
strict = true
112111
ignore_missing_imports = true
113112
allow_subclassing_any = true
@@ -125,12 +124,14 @@ known_third_party = ["faststream", "taskiq"]
125124

126125
[tool.ruff]
127126
fix = true
128-
target-version = "py38"
127+
target-version = "py39"
129128
line-length = 88
130-
mccabe = { max-complexity = 10 }
131129

130+
[tool.ruff.lint]
132131
# List of enabled rulsets.
133132
# See https://docs.astral.sh/ruff/rules/ for more information.
133+
mccabe = { max-complexity = 10 }
134+
134135
select = [
135136
"E", # Error
136137
"F", # Pyflakes
@@ -167,8 +168,6 @@ ignore = [
167168
"D401", # First line should be in imperative mood
168169
"D104", # Missing docstring in public package
169170
"D100", # Missing docstring in public module
170-
"ANN102", # Missing type annotation for self in method
171-
"ANN101", # Missing type annotation for argument
172171
"ANN401", # typing.Any are disallowed in `**kwargs
173172
"PLR0913", # Too many arguments for function call
174173
"D106", # Missing docstring in public nested class
@@ -177,7 +176,7 @@ ignore = [
177176
]
178177
exclude = [".venv/"]
179178

180-
[tool.ruff.per-file-ignores]
179+
[tool.ruff.lint.per-file-ignores]
181180
"tests/*" = [
182181
"S101", # Use of assert detected
183182
"S301", # Use of pickle detected
@@ -187,14 +186,14 @@ exclude = [".venv/"]
187186
"D101", # Missing docstring in public class
188187
]
189188

190-
[tool.ruff.pydocstyle]
189+
[tool.ruff.lint.pydocstyle]
191190
convention = "google"
192191
ignore-decorators = ["typing.overload"]
193192

194-
[tool.ruff.pylint]
193+
[tool.ruff.lint.pylint]
195194
allow-magic-value-types = ["int", "str", "float"]
196195

197-
[tool.ruff.flake8-bugbear]
196+
[tool.ruff.lint.flake8-bugbear]
198197
extend-immutable-calls = []
199198

200199
[tool.pytest.ini_options]

scripts/lint.sh

100644100755
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

3-
echo "Running ruff..."
4-
ruff taskiq_faststream tests --fix
5-
63
echo "Running ruff formatter..."
74
ruff format taskiq_faststream tests
85

6+
echo "Running ruff..."
7+
ruff check taskiq_faststream tests --fix
8+
99
echo "Running mypy..."
1010
mypy taskiq_faststream

taskiq_faststream/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""FastStream - taskiq integration to schedule FastStream tasks."""
22

3-
__version__ = "0.2.0"
3+
__version__ = "0.2.1"

taskiq_faststream/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from taskiq_faststream.scheduler import StreamScheduler
33

44
__all__ = (
5+
"AppWrapper",
56
"BrokerWrapper",
67
"StreamScheduler",
7-
"AppWrapper",
88
)

taskiq_faststream/broker.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
from typing import Any
44

55
import anyio
6-
from faststream.app import FastStream
6+
from faststream._internal.application import Application
77
from faststream.types import SendableMessage
88
from taskiq import AsyncBroker
99
from taskiq.acks import AckableMessage
1010
from taskiq.decor import AsyncTaskiqDecoratedTask
11-
from typing_extensions import TypeAlias, override
11+
from typing_extensions import TypeAlias
1212

1313
from taskiq_faststream.formatter import PatchedFormatter, PathcedMessage
1414
from taskiq_faststream.types import ScheduledTask
@@ -66,7 +66,6 @@ async def listen(
6666
yield b""
6767
await anyio.sleep(60)
6868

69-
@override
7069
def task( # type: ignore[override]
7170
self,
7271
message: typing.Union[
@@ -76,7 +75,7 @@ def task( # type: ignore[override]
7675
typing.Callable[[], typing.Awaitable[SendableMessage]],
7776
] = None,
7877
*,
79-
schedule: typing.List[ScheduledTask],
78+
schedule: list[ScheduledTask],
8079
**kwargs: PublishParameters,
8180
) -> "AsyncTaskiqDecoratedTask[[], None]":
8281
"""Register FastStream scheduled task.
@@ -107,7 +106,7 @@ class AppWrapper(BrokerWrapper):
107106
task : Register FastStream scheduled task.
108107
"""
109108

110-
def __init__(self, app: FastStream) -> None:
109+
def __init__(self, app: Application) -> None:
111110
super(BrokerWrapper, self).__init__()
112111
self.formatter = PatchedFormatter()
113112
self.app = app

taskiq_faststream/formatter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from dataclasses import dataclass
2-
from typing import Any, Dict
2+
from typing import Any
33

44
from taskiq.abc.formatter import TaskiqFormatter
55
from taskiq.message import TaskiqMessage
@@ -10,7 +10,7 @@ class PathcedMessage:
1010
"""DTO to transfer data to `broker.kick`."""
1111

1212
body: Any
13-
labels: Dict[str, Any]
13+
labels: dict[str, Any]
1414

1515

1616
class PatchedFormatter(TaskiqFormatter):

0 commit comments

Comments
 (0)