1+ from __future__ import annotations
2+
13import os
24import re
35import abc
2123from ._collections import FreezableDefaultDict , Pair
2224from ._compat import (
2325 NullFinder ,
24- StrPath ,
2526 install ,
2627)
2728from ._functools import method_cache , pass_none
@@ -387,7 +388,7 @@ def read_text(self, filename) -> Optional[str]:
387388 """
388389
389390 @abc .abstractmethod
390- def locate_file (self , path : StrPath ) -> SimplePath :
391+ def locate_file (self , path : os . PathLike [ str ] ) -> SimplePath :
391392 """
392393 Given a path to a file in this distribution, return a SimplePath
393394 to it.
@@ -432,7 +433,7 @@ def discover(
432433 )
433434
434435 @staticmethod
435- def at (path : StrPath ) -> "Distribution" :
436+ def at (path : os . PathLike [ str ] ) -> "Distribution" :
436437 """Return a Distribution for the indicated metadata path.
437438
438439 :param path: a string or path-like object
@@ -840,7 +841,7 @@ def __init__(self, path: SimplePath) -> None:
840841 """
841842 self ._path = path
842843
843- def read_text (self , filename : StrPath ) -> Optional [str ]:
844+ def read_text (self , filename : os . PathLike [ str ] ) -> Optional [str ]:
844845 with suppress (
845846 FileNotFoundError ,
846847 IsADirectoryError ,
@@ -854,7 +855,7 @@ def read_text(self, filename: StrPath) -> Optional[str]:
854855
855856 read_text .__doc__ = Distribution .read_text .__doc__
856857
857- def locate_file (self , path : StrPath ) -> SimplePath :
858+ def locate_file (self , path : os . PathLike [ str ] ) -> SimplePath :
858859 return self ._path .parent / path
859860
860861 @property
0 commit comments