Skip to content

Commit

Permalink
Merge pull request #15 from sirosen/optimize-functional-interface
Browse files Browse the repository at this point in the history
Use only one resolver in functional API
  • Loading branch information
sirosen authored Nov 1, 2024
2 parents 1c99d4a + eac62d7 commit 181d9cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ CHANGELOG
Unreleased
----------

- Optimize the behavior of the ``resolve()`` function on multiple groups.

1.3.0
-----

Expand Down
7 changes: 2 additions & 5 deletions src/dependency_groups/_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,5 @@ def resolve(
:raises LookupError: if group name is absent
:raises packaging.requirements.InvalidRequirement: if a specifier is not valid
"""
return tuple(
str(r)
for group in groups
for r in DependencyGroupResolver(dependency_groups).resolve(group)
)
resolver = DependencyGroupResolver(dependency_groups)
return tuple(str(r) for group in groups for r in resolver.resolve(group))

0 comments on commit 181d9cd

Please sign in to comment.