Best Python code snippet using tox_python
_venv.py
Source:_venv.py
...185 self._pcall(args, venv=False, action=action, cwd=basepath)186 self.just_created = True187 def finish(self):188 self._getliveconfig().writeconfig(self.path_config)189 def _needs_reinstall(self, setupdir, action):190 setup_py = setupdir.join('setup.py')191 setup_cfg = setupdir.join('setup.cfg')192 args = [self.envconfig.envpython, str(setup_py), '--name']193 output = action.popen(args, cwd=setupdir, redirect=False,194 returnout=True)195 name = output.strip()196 egg_info = setupdir.join('.'.join((name, 'egg-info')))197 for conf_file in (setup_py, setup_cfg):198 if (not egg_info.check() or (conf_file.check()199 and conf_file.mtime() > egg_info.mtime())):200 return True201 return False202 def developpkg(self, setupdir, action):203 assert action is not None204 if getattr(self, 'just_created', False):205 action.setactivity("develop-inst", setupdir)206 self.finish()207 extraopts = []208 else:209 if not self._needs_reinstall(setupdir, action):210 action.setactivity("develop-inst-noop", setupdir)211 return212 action.setactivity("develop-inst-nodeps", setupdir)213 extraopts = ['--no-deps']214 self._install(['-e', setupdir], extraopts=extraopts, action=action)215 def installpkg(self, sdistpath, action):216 assert action is not None217 if getattr(self, 'just_created', False):218 action.setactivity("inst", sdistpath)219 self.finish()220 extraopts = []221 else:222 action.setactivity("inst-nodeps", sdistpath)223 extraopts = ['-U', '--no-deps']...
venv.py
Source:venv.py
...178 self._pcall(args, venv=False, action=action, cwd=basepath)179 self.just_created = True180 def finish(self):181 self._getliveconfig().writeconfig(self.path_config)182 def _needs_reinstall(self, setupdir, action):183 setup_py = setupdir.join('setup.py')184 setup_cfg = setupdir.join('setup.cfg')185 args = [self.envconfig.envpython, str(setup_py), '--name']186 output = action.popen(args, cwd=setupdir, redirect=False,187 returnout=True)188 name = output.strip()189 egg_info = setupdir.join('.'.join((name, 'egg-info')))190 for conf_file in (setup_py, setup_cfg):191 if (not egg_info.check()192 or (conf_file.check() and conf_file.mtime() > egg_info.mtime())):193 return True194 return False195 def developpkg(self, setupdir, action):196 assert action is not None197 if getattr(self, 'just_created', False):198 action.setactivity("develop-inst", setupdir)199 self.finish()200 extraopts = []201 else:202 if not self._needs_reinstall(setupdir, action):203 action.setactivity("develop-inst-noop", setupdir)204 return205 action.setactivity("develop-inst-nodeps", setupdir)206 extraopts = ['--no-deps']207 self._install(['-e', setupdir], extraopts=extraopts, action=action)208 def installpkg(self, sdistpath, action):209 assert action is not None210 if getattr(self, 'just_created', False):211 action.setactivity("inst", sdistpath)212 self.finish()213 extraopts = []214 else:215 action.setactivity("inst-nodeps", sdistpath)216 extraopts = ['-U', '--no-deps']...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!