|
19 | 19 | from ._collections import FreezableDefaultDict, Pair |
20 | 20 | from ._functools import method_cache |
21 | 21 | from ._itertools import unique_everseen |
| 22 | +from ._meta import PackageMetadata, SimplePath |
22 | 23 |
|
23 | 24 | from contextlib import suppress |
24 | 25 | from importlib import import_module |
@@ -611,10 +612,11 @@ def __init__(self, **kwargs): |
611 | 612 | @property |
612 | 613 | def path(self): |
613 | 614 | """ |
614 | | - The path that a distribution finder should search. |
| 615 | + The sequence of directory path that a distribution finder |
| 616 | + should search. |
615 | 617 |
|
616 | | - Typically refers to Python package paths and defaults |
617 | | - to ``sys.path``. |
| 618 | + Typically refers to Python installed package paths such as |
| 619 | + "site-packages" directories and defaults to ``sys.path``. |
618 | 620 | """ |
619 | 621 | return vars(self).get('path', sys.path) |
620 | 622 |
|
@@ -771,11 +773,10 @@ def invalidate_caches(cls): |
771 | 773 |
|
772 | 774 |
|
773 | 775 | class PathDistribution(Distribution): |
774 | | - def __init__(self, path): |
775 | | - """Construct a distribution from a path to the metadata directory. |
| 776 | + def __init__(self, path: SimplePath): |
| 777 | + """Construct a distribution. |
776 | 778 |
|
777 | | - :param path: A pathlib.Path or similar object supporting |
778 | | - .joinpath(), __div__, .parent, and .read_text(). |
| 779 | + :param path: SimplePath indicating the metadata directory. |
779 | 780 | """ |
780 | 781 | self._path = path |
781 | 782 |
|
@@ -869,7 +870,7 @@ def requires(distribution_name): |
869 | 870 | Return a list of requirements for the named package. |
870 | 871 |
|
871 | 872 | :return: An iterator of requirements, suitable for |
872 | | - packaging.requirement.Requirement. |
| 873 | + packaging.requirement.Requirement. |
873 | 874 | """ |
874 | 875 | return distribution(distribution_name).requires |
875 | 876 |
|
|
0 commit comments