Skip to content

Commit 49264ab

Browse files
authored
fix extract if pytorch dist is an extra (#29)
1 parent 4b261f9 commit 49264ab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

light_the_torch/_pip/extract.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ def required_pytorch_dists(self) -> List[str]:
7676
if not dists:
7777
return []
7878

79+
# If the distribution was found in an extra requirement, pip appends this as
80+
# additional information. We remove that here.
81+
dists = [dist.split(";")[0] for dist in dists]
82+
7983
if not any(self._pytorch_core_pattern.match(dist) for dist in dists):
8084
torch = self.PYTORCH_CORE
8185

0 commit comments

Comments
 (0)