2323concrete versions of dependencies that can satisfy requirements.
2424
2525Classes:
26- Candidate: Abstract base class for all candidate types.
27- PackageIndexCandidate: Candidate from a package index registry.
28- PathCandidate: Candidate from a local filesystem path.
29- GitCandidate: Candidate from a git repository.
26+ - :py:class:` Candidate` : Abstract base class for all candidate types.
27+ - :py:class:` PackageIndexCandidate` : Candidate from a package index registry.
28+ - :py:class:` PathCandidate` : Candidate from a local filesystem path.
29+ - :py:class:` GitCandidate` : Candidate from a git repository.
3030
3131Functions:
32- candidate_factory: Singledispatch function to create candidates from requirements.
32+ - :py:func:` candidate_factory` : Singledispatch function to create candidates from requirements.
3333"""
3434
3535from __future__ import annotations
@@ -87,6 +87,7 @@ def satisfies(self, requirement: ConcreteRequirement) -> bool:
8787 """Check if this candidate satisfies the given requirement.
8888
8989 A candidate satisfies a requirement when:
90+
9091 - The requirement name and candidate name match
9192 - If the requirement specifies a version, the candidate's version matches
9293
@@ -114,8 +115,9 @@ class PackageIndexCandidate(Candidate):
114115 Artifactory. This implementation is currently a placeholder as package
115116 index registries are not yet fully implemented.
116117
117- Note:
118- Package index registry support is under development.
118+ .. warning::
119+
120+ Package index registry support is under development and is not currently implemented.
119121 """
120122
121123 def get_manifest (self ) -> Manifest | None :
@@ -169,9 +171,9 @@ def satisfies(self, requirement: ConcreteRequirement) -> bool:
169171 A path candidate satisfies a requirement when the requirement name
170172 and candidate name match, and type-specific conditions are met:
171173
172- * For PackageIndexRequirement: the candidate's version matches the specifier
173- * For PathRequirement: the candidate path ends with the requirement path
174- * For Git requirements: the path is a git repo and HEAD complies with
174+ - For PackageIndexRequirement: the candidate's version matches the specifier
175+ - For PathRequirement: the candidate path ends with the requirement path
176+ - For Git requirements: the path is a git repo and HEAD complies with
175177 the requirement's constraints (commit, branch, tag, or version)
176178
177179 Args:
@@ -191,7 +193,7 @@ def satisfies(self, requirement: ConcreteRequirement) -> bool:
191193 req_parts = requirement .path .parts
192194 cand_parts = self .path .parts
193195 if len (req_parts ) <= len (cand_parts ):
194- return cand_parts [- len (req_parts ) :] == req_parts
196+ return cand_parts [- len (req_parts ):] == req_parts
195197 return False
196198
197199 # Handle Git requirements: check if candidate points to a git repo
@@ -327,6 +329,7 @@ def satisfies(self, requirement: ConcreteRequirement) -> bool:
327329 """Check if this git candidate satisfies the given requirement.
328330
329331 A git candidate satisfies a requirement when:
332+
330333 - The requirement name and candidate name match
331334 - If the requirement specifies a version, the candidate's version matches
332335 - For PackageIndexRequirement: only if no specific index is required
@@ -400,9 +403,15 @@ def candidate_factory(
400403 Yields:
401404 Candidate objects that could satisfy the requirement.
402405
403- Note:
406+ .. note::
407+
404408 The base implementation yields no candidates. Specialized implementations
405- are registered for each concrete requirement type.
409+ are registered for each concrete requirement type through the singledispatch.
410+
411+ .. note::
412+
413+ Package index registries are not yet implemented, so this currently
414+ yields no candidates.
406415 """
407416 yield from []
408417
@@ -420,8 +429,7 @@ def _package_index_candidate_factory(
420429 Yields:
421430 PackageIndexCandidate objects matching the requirement.
422431
423- Note:
424- Package index registries are not yet implemented, so this currently
432+ .. note:: Package index registries are not yet implemented, so this currently
425433 yields no candidates.
426434 """
427435 yield from []
0 commit comments