Skip to content

Commit 29c526a

Browse files
committed
fix: add conditional pytest-asyncio dependencies for pytest 9.0+ compatibility
Address CodeRabbit review comment: pytest-asyncio 0.26.0 does not support pytest 9.0+. According to pytest-asyncio changelog, explicit support for pytest 9 was added in version 1.3.0+. Changes: - Add conditional pytest-asyncio dependencies matching pytest versions: - Python <3.10: pytest-asyncio>=0.26.0 (compatible with pytest 7.4.x) - Python >=3.10: pytest-asyncio>=1.3.0 (required for pytest 9.0+) - Update both requirements.txt and pyproject.toml - Add comments explaining the version requirements This ensures Python 3.10+ environments with pytest 9.0+ use a compatible pytest-asyncio version, preventing runtime failures. Fixes: CodeRabbit review comment on PR kinde-oss#144
1 parent 6160041 commit 29c526a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

pyproject.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ dev = [
5454
"pytest>=9.0.0; python_version >= '3.10'",
5555
"pytest-cov>=4.1.0",
5656
"pytest-django>=4.5.2",
57-
"pytest-asyncio>=0.26.0",
57+
# pytest-asyncio: 0.26.0 supports pytest <9.0, 1.3.0+ required for pytest 9.0+
58+
# Python 3.9: pytest-asyncio 0.26.0 (compatible with pytest 7.4.x)
59+
# Python 3.10+: pytest-asyncio 1.3.0+ (required for pytest 9.0+)
60+
"pytest-asyncio>=0.26.0; python_version < '3.10'",
61+
"pytest-asyncio>=1.3.0; python_version >= '3.10'",
5862
"pytest-timeout>=2.2.0",
5963
"mypy>=1.5.0",
6064
"bandit>=1.7",
@@ -97,6 +101,8 @@ mypy = "^1.5.0"
97101
bandit = "^1.7"
98102
pylint = "^2.0"
99103
pycodestyle = "^2.0"
104+
# pytest-asyncio: Default to 0.26.0 for Python 3.9 compatibility
105+
# Python 3.10+ users should use requirements.txt or pip with environment markers
100106
pytest-asyncio = "^0.26.0"
101107
pytest-timeout = "^2.2.0"
102108
black = "^24.3.0"

requirements.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ pydantic>=2.0.0,<3.0.0
2626
pytest>=7.4.0,<9.0.0; python_version < "3.10"
2727
pytest>=9.0.0; python_version >= "3.10"
2828
pytest-django>=4.5.2
29-
pytest-asyncio>=0.26.0
29+
# pytest-asyncio: 0.26.0 supports pytest <9.0, 1.3.0+ required for pytest 9.0+
30+
# Python 3.9: pytest-asyncio 0.26.0 (compatible with pytest 7.4.x)
31+
# Python 3.10+: pytest-asyncio 1.3.0+ (required for pytest 9.0+)
32+
pytest-asyncio>=0.26.0; python_version < "3.10"
33+
pytest-asyncio>=1.3.0; python_version >= "3.10"
3034
pytest-cov>=4.1.0
3135
pytest-timeout>=2.2.0
3236
black>=24.3.0

0 commit comments

Comments
 (0)