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 39774f0 commit c049cb9
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 @@ -837,7 +837,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 @@ -850,7 +850,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 c049cb9

Please sign in to comment.