Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Replace pkg_resources with packaging for Python 3.12 compatibility.
  • Loading branch information
brunns committed May 4, 2023
commit e7b8e262a07f026b305146709e2ec25a849bfeaa
4 changes: 2 additions & 2 deletions pytest_mypy_plugins/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Set,
)

import pkg_resources
from packaging.version import Version
import py.path
import pytest
import yaml
Expand Down Expand Up @@ -152,7 +152,7 @@ def _eval_skip(self, skip_if: str) -> bool:
return eval(skip_if, {"sys": sys, "os": os, "pytest": pytest, "platform": platform})


if pkg_resources.parse_version(pytest.__version__) >= pkg_resources.parse_version("7.0.0rc1"):
if Version(pytest.__version__) >= Version("7.0.0rc1"):

def pytest_collect_file(file_path: pathlib.Path, parent: Node) -> Optional[YamlTestFile]:
if file_path.suffix in {".yaml", ".yml"} and file_path.name.startswith(("test-", "test_")):
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"pyyaml",
"chevron",
"regex",
"packaging",
]

setup(
Expand Down