diff --git a/pyproject.toml b/pyproject.toml index d51af2b4..816c96b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,8 @@ dev = [ "pytest-timeout >=2.2.0", "black >=24.3.0", "flake8 >=6.1.0", - "isort >=5.12.0", + "isort >=7.0.0; python_version >= '3.10'", + "isort >=5.12.0, <7.0; python_version < '3.10'", ] [project.urls] @@ -87,17 +88,17 @@ coverage = ">=7.10.6" pytest-django = "^4.5.2" mypy = "^1.5.0" bandit = "^1.7" -# pylint is conditionally installed based on Python version to maintain Python 3.9 compatibility -# Python 3.10+: pylint >=4.0.0 (use pip install -e ".[dev]" for conditional installation) -# Python 3.9: pylint >=2.0, <4.0 -# Note: Poetry doesn't support multiple conditional version constraints for the same package. -# This entry uses the Python 3.9-compatible version. Python 3.10+ users can upgrade manually -# or use: pip install -e ".[dev]" which respects the conditional markers in [project.optional-dependencies] -pylint = ">=2.0,<4.0" +pylint = [ + {version = ">=4.0.0", python = ">=3.10"}, + {version = ">=2.0,<4.0", python = "<3.10"}, +] pycodestyle = "^2.0" pytest-asyncio = "^0.26.0" pytest-timeout = "^2.2.0" black = "^26.0.0" flake8 = "^7.0.0" -isort = "^8.0.0" +isort = [ + {version = ">=7.0.0", python = ">=3.10"}, + {version = ">=5.12.0,<7.0", python = "<3.10"}, +] diff --git a/requirements.txt b/requirements.txt index b2dd807b..66190964 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,7 +28,11 @@ coverage>=7.10.6 pytest-timeout>=2.2.0 black>=23.7.0 flake8>=6.1.0 -isort>=5.12.0 +# Note: isort version is conditional based on Python version +# Python 3.10+: isort >=7.0.0, Python 3.9: isort >=5.12.0, <7.0 +# Conditional markers mirror pyproject.toml [project.optional-dependencies.dev] +isort>=7.0.0; python_version >= '3.10' +isort>=5.12.0,<7.0; python_version < '3.10' mypy>=1.5.0 PyYAML>=6.0.1 twine>=4.0.2 diff --git a/testv2/testv2_framework/test_fastapi_framework.py b/testv2/testv2_framework/test_fastapi_framework.py index 36f07678..75b7d99b 100644 --- a/testv2/testv2_framework/test_fastapi_framework.py +++ b/testv2/testv2_framework/test_fastapi_framework.py @@ -1,6 +1,9 @@ import unittest from unittest.mock import AsyncMock, MagicMock, patch +pytest = __import__("pytest") +pytest.importorskip("fastapi", reason="fastapi not installed") + from fastapi import FastAPI from starlette.testclient import TestClient from starlette.middleware.sessions import SessionMiddleware diff --git a/testv2/testv2_framework/test_flask_framework.py b/testv2/testv2_framework/test_flask_framework.py index b214aa17..0a2b1879 100644 --- a/testv2/testv2_framework/test_flask_framework.py +++ b/testv2/testv2_framework/test_flask_framework.py @@ -3,6 +3,11 @@ import tempfile import shutil from unittest.mock import Mock, patch, call + +pytest = __import__("pytest") +pytest.importorskip("flask", reason="flask not installed") +pytest.importorskip("flask_session", reason="flask-session not installed") + from flask import Flask from kinde_flask.framework.flask_framework import FlaskFramework from kinde_sdk.auth.oauth import OAuth