MCPcopy
hub / github.com/python-poetry/poetry / get_dependency

Function get_dependency

tests/helpers.py:63–79  ·  view source on GitHub ↗
(
    name: str,
    constraint: str | dict[str, Any] | None = None,
    groups: list[str] | None = None,
    optional: bool = False,
    allows_prereleases: bool = False,
)

Source from the content-addressed store, hash-verified

61
62
63def get_dependency(
64 name: str,
65 constraint: str | dict[str, Any] | None = None,
66 groups: list[str] | None = None,
67 optional: bool = False,
68 allows_prereleases: bool = False,
69) -> Dependency:
70 if constraint is None:
71 constraint = "*"
72
73 if isinstance(constraint, str):
74 constraint = {"version": constraint}
75
76 constraint["optional"] = optional
77 constraint["allow-prereleases"] = allows_prereleases
78
79 return Factory.create_dependency(name, constraint or "*", groups=groups)
80
81
82def copy_path(source: Path, dest: Path) -> None:

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…