Skip to content

Commit

Permalink
Merge branch 'main' into py313
Browse files Browse the repository at this point in the history
  • Loading branch information
fkiraly committed Sep 29, 2024
2 parents 211894f + f439012 commit a330681
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions skpro/utils/git_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def _get_packages_with_changed_specs():
-------
tuple of str : names of packages with changed or added specs
"""
from packaging.requirements import Requirement
from packaging.requirements import InvalidRequirement, Requirement

changed_lines = get_changed_lines("pyproject.toml")

Expand All @@ -175,8 +175,12 @@ def _get_packages_with_changed_specs():
if ";" in req:
req = req.split(";")[0]

pkg = Requirement(req).name
packages.append(pkg)
try: # deal with lines that are not package requirement strings
pkg = Requirement(req).name
except InvalidRequirement:
continue
else:
packages.append(pkg)

# make unique
packages = tuple(set(packages))
Expand Down

0 comments on commit a330681

Please sign in to comment.