Skip to content

Commit 7920525

Browse files
committed
Updated code to be compatible with the latest 5.0 upstream code
1 parent 9f67405 commit 7920525

File tree

6 files changed

+25
-32
lines changed

6 files changed

+25
-32
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.10"]
13+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.10"]
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
@@ -24,7 +24,9 @@ jobs:
2424
- name: Start external services
2525
run: docker compose up -d
2626
- name: Install dependencies
27-
run: pip install -e .[test]
27+
run: |
28+
pip install git+https://github.com/asphalt-framework/asphalt.git
29+
pip install -e .[test]
2830
- name: Test with pytest
2931
run: coverage run -m pytest -v
3032
- name: Generate coverage report

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"sphinx.ext.autodoc",
88
"sphinx.ext.intersphinx",
99
"sphinx_autodoc_typehints",
10+
"sphinx_rtd_theme",
1011
]
1112

1213
templates_path = ["_templates"]

pyproject.toml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ classifiers = [
1717
"License :: OSI Approved :: Apache Software License",
1818
"Programming Language :: Python",
1919
"Programming Language :: Python :: 3",
20-
"Programming Language :: Python :: 3.8",
2120
"Programming Language :: Python :: 3.9",
2221
"Programming Language :: Python :: 3.10",
2322
"Programming Language :: Python :: 3.11",
2423
"Programming Language :: Python :: 3.12",
24+
"Programming Language :: Python :: 3.13",
2525
]
26-
requires-python = ">=3.8"
26+
requires-python = ">=3.9"
2727
dependencies = [
2828
"asphalt ~= 4.8",
2929
"aiokafka >= 0.10",
@@ -73,7 +73,7 @@ extend-select = [
7373
known-first-party = ["asphalt.kafka"]
7474

7575
[tool.mypy]
76-
python_version = "3.8"
76+
python_version = "3.9"
7777
strict = true
7878
explicit_package_bases = true
7979
mypy_path = ["src", "tests", "examples"]
@@ -90,21 +90,14 @@ branch = true
9090
show_missing = true
9191

9292
[tool.tox]
93-
legacy_tox_ini = """
94-
[tox]
95-
envlist = py38, py39, py310, py311, py312, pypy3
93+
env_list = ["py39", "py310", "py311", "py312", "py313", "pypy3"]
9694
skip_missing_interpreters = true
97-
minversion = 4.0
9895

99-
[testenv]
100-
extras = test
101-
commands = python -m pytest {posargs}
102-
package = editable
96+
[tool.tox.env_run_base]
97+
commands = [["python", "-m", "pytest", { replace = "posargs", extend = true }]]
98+
package = "editable"
99+
extras = ["test"]
103100

104-
[testenv:pypy3]
105-
commands = pytest {posargs}
106-
107-
[testenv:docs]
108-
extras = doc
109-
commands = sphinx-build -W -n docs build/sphinx {posargs}
110-
"""
101+
[tool.tox.env.docs]
102+
commands = [["sphinx-build", "-W", "-n", "docs", "build/sphinx", { replace = "posargs", extend = true }]]
103+
extras = ["doc"]

src/asphalt/kafka/_admin.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing import Any
77

88
from aiokafka.admin import AIOKafkaAdminClient
9+
910
from asphalt.core import Component, add_resource, get_resource
1011

1112

@@ -31,9 +32,7 @@ class KafkaAdminComponent(Component):
3132
async def start(self) -> None:
3233
if self.existing_resource is not None:
3334
if isinstance(self.existing_resource, str):
34-
client = await get_resource(
35-
AIOKafkaAdminClient, self.existing_resource, wait=True
36-
)
35+
client = await get_resource(AIOKafkaAdminClient, self.existing_resource)
3736
else:
3837
client = self.existing_resource
3938

@@ -43,7 +42,7 @@ async def start(self) -> None:
4342
return
4443

4544
if isinstance(self.ssl_context, str):
46-
self.options["ssl_context"] = await get_resource(SSLContext, wait=True)
45+
self.options["ssl_context"] = await get_resource(SSLContext)
4746
elif self.ssl_context is not None:
4847
self.options["ssl_context"] = self.ssl_context
4948

src/asphalt/kafka/_consumer.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from typing import Any
99

1010
from aiokafka import AIOKafkaConsumer
11+
1112
from asphalt.core import Component, add_resource, context_teardown, get_resource
1213

1314

@@ -35,9 +36,7 @@ class KafkaConsumerComponent(Component):
3536
async def start(self) -> AsyncGenerator[None, Any]:
3637
if self.existing_resource is not None:
3738
if isinstance(self.existing_resource, str):
38-
consumer = await get_resource(
39-
AIOKafkaConsumer, self.existing_resource, wait=True
40-
)
39+
consumer = await get_resource(AIOKafkaConsumer, self.existing_resource)
4140
else:
4241
consumer = self.existing_resource
4342

@@ -48,7 +47,7 @@ async def start(self) -> AsyncGenerator[None, Any]:
4847
return
4948

5049
if isinstance(self.ssl_context, str):
51-
self.options["ssl_context"] = await get_resource(SSLContext, wait=True)
50+
self.options["ssl_context"] = await get_resource(SSLContext)
5251
elif self.ssl_context is not None:
5352
self.options["ssl_context"] = self.ssl_context
5453

src/asphalt/kafka/_producer.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing import Any
77

88
from aiokafka import AIOKafkaProducer
9+
910
from asphalt.core import Component, add_resource, get_resource
1011

1112

@@ -28,9 +29,7 @@ class KafkaProducerComponent(Component):
2829
async def start(self) -> None:
2930
if self.existing_resource is not None:
3031
if isinstance(self.existing_resource, str):
31-
producer = await get_resource(
32-
AIOKafkaProducer, self.existing_resource, wait=True
33-
)
32+
producer = await get_resource(AIOKafkaProducer, self.existing_resource)
3433
else:
3534
producer = self.existing_resource
3635

@@ -40,7 +39,7 @@ async def start(self) -> None:
4039
return
4140

4241
if isinstance(self.ssl_context, str):
43-
self.options["ssl_context"] = await get_resource(SSLContext, wait=True)
42+
self.options["ssl_context"] = await get_resource(SSLContext)
4443
elif self.ssl_context is not None:
4544
self.options["ssl_context"] = self.ssl_context
4645

0 commit comments

Comments
 (0)