Skip to content

Commit

Permalink
add caching to resolver to reuse candidates for build time requirements
Browse files Browse the repository at this point in the history
Signed-off-by: Shubh Bapna <[email protected]>
  • Loading branch information
Shubh Bapna committed Oct 11, 2024
1 parent c3946a9 commit 34f788e
Show file tree
Hide file tree
Showing 9 changed files with 271 additions and 121 deletions.
5 changes: 4 additions & 1 deletion src/fromager/build_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ def __init__(
for r in all_reqs:
try:
_, version = resolver.resolve(
ctx=ctx, req=r, sdist_server_url=resolver.PYPI_SERVER_URL
ctx=ctx,
req=r,
sdist_server_url=resolver.PYPI_SERVER_URL,
req_type=req_type,
)
except Exception as err:
resolutions.append(f"{r} -> {err}")
Expand Down
3 changes: 3 additions & 0 deletions src/fromager/requirements_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def __eq__(self, other: object) -> bool:
return self.value in allowed_values and other.value in allowed_values
return super.__eq__(self, other)

def __ne__(self, value: object) -> bool:
return not self == value


def parse_requirements_file(
req_file: pathlib.Path,
Expand Down
Loading

0 comments on commit 34f788e

Please sign in to comment.