Skip to content

Commit

Permalink
Consider root package with all extras
Browse files Browse the repository at this point in the history
  • Loading branch information
maksbotan committed Aug 7, 2022
1 parent dff84dc commit 643903a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/poetry/mixology/version_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ def solve(self) -> SolverResult:
or raises an error if no such set is available.
"""
start = time.time()
root_dependency = Dependency(self._root.name, self._root.version)
root_dependency = Dependency(self._root.name, self._root.version, extras=list(self._root.extras))
root_dependency.is_root = True

self._add_incompatibility(
Incompatibility([Term(root_dependency, False)], RootCause())
)

try:
next: str | None = self._root.name
next: str | None = root_dependency.complete_name
while next is not None:
self._propagate(next)
next = self._choose_package_version()
Expand Down
4 changes: 2 additions & 2 deletions src/poetry/puzzle/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ def debug(self, message: str, depth: int = 0) -> None:

if message.startswith("fact:"):
if "depends on" in message:
m = re.match(r"fact: (.+?) depends on (.+?) \((.+?)\)", message)
m = re.match(r"fact: (.+?) depends on ([^() ]+)(.*)", message)
if m is None:
raise ValueError(f"Unable to parse fact: {message}")
m2 = re.match(r"(.+?) \((.+?)\)", m.group(1))
Expand All @@ -847,7 +847,7 @@ def debug(self, message: str, depth: int = 0) -> None:

message = (
f"<fg=blue>fact</>: <c1>{name}</c1>{version} "
f"depends on <c1>{m.group(2)}</c1> (<c2>{m.group(3)}</c2>)"
f"depends on <c1>{m.group(2)}</c1> (<c2>{m.group(3).strip(' ()')}</c2>)"
)
elif " is " in message:
message = re.sub(
Expand Down

0 comments on commit 643903a

Please sign in to comment.