Skip to content

Commit

Permalink
CP logic of #1393. (#1405)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-dkurokawa authored Aug 28, 2024
1 parent 5f25ec6 commit a550455
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions trulens_eval/trulens_eval/utils/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from packaging import requirements
from packaging import version
from pip._internal.req import parse_requirements
import pkg_resources

from trulens_eval import __name__ as trulens_name

Expand All @@ -28,16 +28,9 @@
def requirements_of_file(path: Path) -> Dict[str, requirements.Requirement]:
"""Get a dictionary of package names to requirements from a requirements
file."""

pip_reqs = parse_requirements(str(path), session=None)

mapping = {}

for pip_req in pip_reqs:
req = requirements.Requirement(pip_req.requirement)
mapping[req.name] = req

return mapping
with open(path) as fh:
reqs = pkg_resources.parse_requirements(fh)
return {req.name: req for req in reqs}


if sys.version_info >= (3, 9):
Expand Down

0 comments on commit a550455

Please sign in to comment.