diff --git a/pyproject.toml b/pyproject.toml
index 2818cf1e14ddaf25d6b565c2bc4dd8fd7a848255..b728ca6fa2c090f2a69014ea730f98e054e02e18 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -23,6 +23,9 @@ classifiers=[
 [project.optional-dependencies]
 testing = [
     "pytest>=8.0",
-    "pytest-cov>=5,<6",  # Use pytest-cov version 5.x which supports Python 3.8
-    "requests>=2.0"
+    "requests>=2.0",
+    # For Python 3.9 and up, use pytest-cov>=6.0
+    'pytest-cov>=6.0; python_version >= "3.9"',
+    # For older versions, use an older version of pytest-cov or omit it:
+    'pytest-cov>=5,<6; python_version < "3.9"'
 ]
\ No newline at end of file