Skip to content

Commit

Permalink
add field 'ignore_specifiers' to ignore the specifiers of a list of d…
Browse files Browse the repository at this point in the history
…ependencies
  • Loading branch information
Simon Guigui committed Dec 6, 2019
1 parent 40d5873 commit 32999fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/_wheel2deb/context.py
Expand Up @@ -18,6 +18,7 @@ class Context:
ignore_entry_points = attr.ib(default=False)
ignore_upstream_versions = attr.ib(default=False)
ignore_requirements = attr.ib(factory=list)
ignore_specifiers = attr.ib(factory=list)
map = attr.ib(factory=dict)
depends = attr.ib(factory=list)
conflicts = attr.ib(factory=list)
Expand Down
5 changes: 4 additions & 1 deletion src/_wheel2deb/depends.py
Expand Up @@ -135,7 +135,10 @@ def check(x):
logger.error('could not find a candidate for requirement %s', req)
missing_deps.append(str(req))

if not ctx.ignore_upstream_versions and len(req.specifier):
if req.name in ctx.ignore_specifiers:
logger.warning('ignoring specifiers for dependency %s', req.name)
debian_deps.append(pdep)
elif not ctx.ignore_upstream_versions and len(req.specifier):
for specifier in req.specifier:
# != can't be translated to a package relationship in debian...
if specifier.operator != '!=':
Expand Down

0 comments on commit 32999fe

Please sign in to comment.