How to use _cut_off_dep_comment method in tox

Best Python code snippet using tox_python

__init__.py

Source:__init__.py Github

copy

Full Screen

...134 for option in tox.PIP.INSTALL_LONG_OPTIONS_ARGUMENT:135 name_start = "{} ".format(option)136 if name.startswith(name_start):137 name = "{}={}".format(option, name[len(option) :].strip())138 name = self._cut_off_dep_comment(name)139 name = self._replace_forced_dep(name, config)140 deps.append(DepConfig(name, ixserver))141 return deps142 def _replace_forced_dep(self, name, config):143 """Override given dependency config name. Take ``--force-dep-version`` option into account.144 :param name: dep config, for example ["pkg==1.0", "other==2.0"].145 :param config: ``Config`` instance146 :return: the new dependency that should be used for virtual environments147 """148 if not config.option.force_dep:149 return name150 for forced_dep in config.option.force_dep:151 if self._is_same_dep(forced_dep, name):152 return forced_dep153 return name154 @staticmethod155 def _cut_off_dep_comment(name):156 return re.sub(r"\s+#.*", "", name).strip()157 @classmethod158 def _is_same_dep(cls, dep1, dep2):159 """Definitions are the same if they refer to the same package, even if versions differ."""160 dep1_name = pkg_resources.Requirement.parse(dep1).project_name161 try:162 dep2_name = pkg_resources.Requirement.parse(dep2).project_name163 except pkg_resources.RequirementParseError:164 # we couldn't parse a version, probably a URL165 return False166 return dep1_name == dep2_name167class PosargsOption:168 name = "args_are_paths"169 type = "bool"...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tox automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful