Skip to content

Commit

Permalink
ordered, unique collection backrefs
Browse files Browse the repository at this point in the history
  • Loading branch information
sivel committed Jan 30, 2024
1 parent 2805bd3 commit ce59c60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ansible_builder/_target_scripts/introspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def sanitize_requirements(collection_py_reqs):
logger.warning('Warning: failed to parse requirements from %s, error: %s', collection, e)
continue
req.name = canonicalize_name(req.name)
req.collections = [collection] # add backref for later
req.collections = {collection: None} # add backref for later
key = (req.name, req.marker)
if (prior_req := consolidated.get(key)):
specifiers = f'{prior_req.specifier},{req.specifier}'
Expand All @@ -355,7 +355,7 @@ def sanitize_requirements(collection_py_reqs):
# The first URL seen wins
prior_req.url = req.url
prior_req.extras.update(req.extras)
prior_req.collections.append(collection)
prior_req.collections.update({collection: None})
continue
consolidated[key] = req

Expand Down

0 comments on commit ce59c60

Please sign in to comment.