How to use _replace_forced_dep method in tox

Best Python code snippet using tox_python

config.py

Source:config.py Github

copy

Full Screen

...89 ixserver = config.indexserver[iname]90 else:91 name = depline.strip()92 ixserver = None93 name = self._replace_forced_dep(name, config)94 deps.append(DepConfig(name, ixserver))95 return deps96 def _replace_forced_dep(self, name, config):97 """98 Override the given dependency config name taking --force-dep-version99 option into account.100 :param name: dep config, for example ["pkg==1.0", "other==2.0"].101 :param config: Config instance102 :return: the new dependency that should be used for virtual environments103 """104 if not config.option.force_dep:105 return name106 for forced_dep in config.option.force_dep:107 if self._is_same_dep(forced_dep, name):108 return forced_dep109 return name110 @classmethod...

Full Screen

Full Screen

_config.py

Source:_config.py Github

copy

Full Screen

...322 ixserver = config.indexserver[iname]323 else:324 name = depline.strip()325 ixserver = None326 name = self._replace_forced_dep(name, config)327 vc.deps.append(DepConfig(name, ixserver))328 vc.distribute = reader.getbool(section, "distribute", False)329 vc.sitepackages = self.config.option.sitepackages or \330 reader.getbool(section, "sitepackages", False)331 vc.downloadcache = None332 downloadcache = reader.getdefault(section, "downloadcache")333 if downloadcache:334 # env var, if present, takes precedence335 downloadcache = os.environ.get("PIP_DOWNLOAD_CACHE", downloadcache)336 vc.downloadcache = py.path.local(downloadcache)337 pip_default_opts = ["--pre", "{opts}", "{packages}"]338 vc.install_command = reader.getargv(339 section,340 "install_command",341 "pip install " + " ".join(pip_default_opts),342 )343 if '{packages}' not in vc.install_command:344 raise tox.exception.ConfigError(345 "'install_command' must contain '{packages}' substitution")346 return vc347 def _getenvlist(self, reader, toxsection):348 env = self.config.option.env349 if not env:350 env = os.environ.get("TOXENV", None)351 if not env:352 envlist = reader.getlist(toxsection, "envlist", sep=",")353 if not envlist:354 envlist = self.config.envconfigs.keys()355 return envlist356 envlist = _split_env(env)357 if "ALL" in envlist:358 envlist = list(self.config.envconfigs)359 envlist.sort()360 return envlist361 def _replace_forced_dep(self, name, config):362 """363 Override the given dependency config name taking --force-dep-version364 option into account.365 :param name: dep config, for example ["pkg==1.0", "other==2.0"].366 :param config: Config instance367 :return: the new dependency that should be used for virtual environments368 """369 if not config.option.force_dep:370 return name371 for forced_dep in config.option.force_dep:372 if self._is_same_dep(forced_dep, name):373 return forced_dep374 return name375 @classmethod...

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