Skip to content

Commit

Permalink
🔥 Cut comments off dependency lines
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Apr 16, 2019
1 parent 88545ff commit 4733b89
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tox/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def postprocess(self, testenv_config, value):
name_start = "{} ".format(option)
if name.startswith(name_start):
name = "{}={}".format(option, name[len(option) :].strip())
name = self._cut_off_dep_comment(name)
name = self._replace_forced_dep(name, config)
deps.append(DepConfig(name, ixserver))
return deps
Expand All @@ -176,6 +177,10 @@ def _replace_forced_dep(self, name, config):
return forced_dep
return name

@staticmethod
def _cut_off_dep_comment(name):
return re.sub(r'\s+#.*', '', name).strip()

@classmethod
def _is_same_dep(cls, dep1, dep2):
"""Definitions are the same if they refer to the same package, even if versions differ."""
Expand Down

0 comments on commit 4733b89

Please sign in to comment.