How to use get_executable method in tox

Best Python code snippet using tox_python

executables.py

Source:executables.py Github

copy

Full Screen

...47 else:48 self._cache[name] = self._find_exe(name, requires, install_txt)49 return self._cache[name]50 def _find_exe(self, name, requires=(), install_txt=None):51 fexe = get_executable(name)52 if not fexe: # pragma: nocover53 # try $PKG/node_modules/.bin/<exe|cmd>54 noderoot = Package().root / 'node_modules/.bin'55 if name + '.cmd' in noderoot:56 return str(noderoot / (name + '.cmd'))57 if not install_txt: # pragma: nocover58 install_txt = "Missing command: %r" % name59 if requires:60 install_txt += " [requires: %s]" % requires61 raise MissingCommand(install_txt)62 return fexe63 def find_wheel(self):64 exename = 'wheel'65 exepath = get_executable(exename)66 if not exepath:67 pip = get_executable('pip')68 cmd = pip + ' install wheel[signatures]'69 if win32:70 # self.ctx.run(cmd, echo=True)71 runners.run(cmd)72 wheel = get_executable(exename)73 # generate signing key if downloading wheel74 runners.run(wheel + ' keygen')75 else:76 raise MissingCommand("Missing wheel (%s)" % cmd)77 print('Your ~/.pypirc file should have a [pypi] section instead of a [server-login] section')78 return exepath79 def find_twine(self):80 exename = 'twine'81 exepath = get_executable(exename)82 if not exepath:83 pip = get_executable('pip')84 cmd = pip + ' install twine'85 if win32:86 # self.ctx.run(cmd, echo=True)87 runners.run(cmd)88 exepath = get_executable(exename)89 else:90 raise MissingCommand("Missing twine (%s)" % cmd)91 print('Your ~/.pypirc file should have a [pypi] section instead of a [server-login] section')92 return exepath93 def find_uglify(self):94 exename = 'uglifyjs'95 exepath = get_executable(exename)96 if not exepath:97 npminstall = "npm install -g uglify-js --no-color"98 if win32:99 self.ctx.run(npminstall, echo=False, encoding="utf-8")100 exepath = get_executable(exename)101 else:102 raise MissingCommand("Missing uglifyjs (%s)" % npminstall)103 return exepath104 def find_browserify(self):105 exename = 'browserify'106 exepath = get_executable(exename)107 npminstall = "npm install -g browserify --no-color"108 if not exepath:109 if win32:110 # self.ctx.run(npminstall, echo=False, encoding="utf-8")111 self.ctx.run(npminstall, echo=True, encoding="utf-8")112 exepath = get_executable(exename)113 else:114 raise MissingCommand("Missing browserify (%s)" % npminstall)115 return exepath116 def find_babili(self):117 exename = 'babili'118 exepath = get_executable(exename)119 npminstall = "npm install -g babili --no-color"120 if not exepath:121 if win32:122 self.ctx.run(npminstall, echo=False, encoding="utf-8")123 exepath = get_executable(exename)124 else:125 raise MissingCommand("Missing babili (%s)" % npminstall)126 return exepath127 def find_babel(self):128 exename = 'babel'129 exepath = get_executable(exename)130 npminstall = "npm install -g babel-cli --no-color"131 if not exepath:132 if win32:133 self.ctx.run(npminstall, echo=False, encoding="utf-8")134 exepath = get_executable(exename)135 else:136 raise MissingCommand("Missing babel (%s)" % npminstall)137 return exepath138 # def find_babel(self):139 # exename = 'babel'140 # exepath = get_executable(exename)141 # npminstall = "npm install -g babel --no-color"142 # if not exepath:143 # if win32:144 # self.ctx.run(npminstall, echo=False, encoding="utf-8")145 # exepath = get_executable(exename)146 # else:147 # raise MissingCommand("Missing babel (%s)" % npminstall)148 # return exepath149 def find_nodejs(self): # pragma: nocover150 """Find :program:`node`.151 """152 if sys.platform == 'win32':153 node_exe = get_executable('node')154 else:155 node_exe = get_executable('nodejs') or get_executable('node')156 if not node_exe: # pragma: nocover157 raise MissingCommand("""158 Install Node.js using your OS package manager159 https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager160 """)161 return node_exe162 def find_npm(self):163 """Find the node package manager (:program:`npm`).164 """165 npm_exe = get_executable('npm')166 if not npm_exe: # pragma: nocover167 raise MissingCommand("""168 Install Node.js using your OS package manager169 https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager170 """)171 return npm_exe172#: public interface to the :py:class:`Executables` class173exe = Executables()174def requires(*deps):175 """Decorator to declare global dependencies/requirements.176 Usage (``@task`` must be last)::177 @requires('nodejs', 'npm', 'lessc')178 @task179 def mytask(..)...

Full Screen

Full Screen

install.py

Source:install.py Github

copy

Full Screen

...61 return local_filename62def mkdir_if_not_exist(d):63 if not os.path.isdir(d):64 os.makedirs(d)65def get_executable(e):66 return shutil.which(e)67def link(from_file, to_file, override_to_dir=''):68 from_file = os.path.join(root_dir, from_file)69 temp = override_to_dir if override_to_dir else home_dir70 to_file = os.path.join(temp, to_file)71 rm_if_exists(to_file)72 # logging.info('symlinking {} to {}'.format(from_file, to_file))73 if not os.path.isdir(os.path.dirname(to_file)):74 logging.info('making directory {}'.format(os.path.dirname(to_file)))75 os.makedirs(os.path.dirname(to_file))76 os.symlink(from_file, to_file)77if __name__ == '__main__':78 op_sys = get_os()79 logging.basicConfig(level=logging.INFO)80 logging.info('Hello, {}!'.format(os.environ['USER']))81 logging.info('Setting up your environment for {}'.format(op_sys))82 root_dir = os.path.abspath(os.path.dirname(__file__))83 logging.info('located config directory at {}'.format(root_dir))84 home_dir = os.path.abspath(os.environ['HOME'])85 logging.info('located home directory at {}'.format(home_dir))86 # homebrew87 if not get_executable('brew'):88 logging.info('Installing Homebrew')89 url = 'https://raw.githubusercontent.com/Homebrew/install/master/install.sh'90 fname = download_file(url)91 run('bash ' + fname)92 rm_if_exists(fname)93 else:94 logging.info('Homebrew is already installed')95 # anaconda96 if not get_executable('conda'):97 logging.info('Installing Anaconda')98 url = 'https://repo.continuum.io/archive/Anaconda3-5.2.0-{}-x86_64.sh'.format(99 'MacOSX' if op_sys == 'mac' else 'Linux')100 fname = download_file(url)101 run('bash {} -b -p {}/anaconda'.format(fname, os.environ.get('HOME')))102 rm_if_exists(fname)103 else:104 logging.info('Anaconda is already installed')105 # fish106 if not get_executable('fish'):107 run('brew install fish bc curl')108 run('curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish')109 # run('brew install npm', condition=not get_executable('npm'))110 run('brew install fzf', condition=not get_executable('fzf'))111 run('brew install grc', condition=not get_executable('grc'))112 run('brew install tmux', condition=not get_executable('tmux'))113 run('brew install neovim', condition=not get_executable('nvim'))114 link('conf/tmux', '.tmux.d')115 mkdir_if_not_exist('.config')116 link('conf/nvim', '.config/nvim')117 link('conf/dotfiles/fish.fish', '.config/fish/config.fish')118 link('conf/dotfiles/gitconfig.yml', '.gitconfig')119 link('conf/dotfiles/gitignore', '.gitignore')120 link('conf/dotfiles/tmux.sh', '.tmux.conf')121 link('local', '.mylocal')122 # powerline fonts123 powerline_dir = os.path.join('{}/.config/powerline'.format(124 os.environ['HOME']))125 if not os.path.isdir(powerline_dir):126 run('git clone https://github.com/powerline/fonts.git {}'.format(127 powerline_dir))128 curr_dir = os.getcwd()129 os.chdir(powerline_dir)130 run('./install.sh')131 os.chdir(curr_dir)132 # vim package manager133 to_file = '{}/.local/share/nvim/site/autoload/plug.vim'.format(134 os.environ['HOME'])135 if not os.path.isfile(to_file):136 mkdir_if_not_exist('{}/.local/share/nvim/site/autoload'.format(137 os.environ['HOME']))138 download_file(139 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim',140 to_file)141 print('you need to change your default shell to fish:')142 print('sudo echo "{}" >> /etc/shells'.format(get_executable('fish')))143 print('chsh -s {}'.format(get_executable('fish')))144 print('finished! you can now run the following to get started')145 print(get_executable('fish'))146 print('dont forget to run the following')...

Full Screen

Full Screen

configurations.py

Source:configurations.py Github

copy

Full Screen

...54def get_arg_for_spl(spl):55 spl = AVAILABLE_SPL[spl]56 return ("--feature-model=" + os.path.join(MODELS_PATH, spl.feature_model) + " " +57 "--uml-model=" + os.path.join(MODELS_PATH, spl.uml_model))58def get_executable(strategy, spl):59 '''60 Returns the corresponding executable for the given analysis configuration.61 '''62 return ("/usr/bin/time -v " + REANA_MAIN + " "63 + get_arg_for_strategy(strategy) + " "64 + get_arg_for_spl(spl))65CONFIGURATIONS= OrderedDict()66for strategy in ANALYSIS_STRATEGIES:67 for spl in SPL_ORDER:68 CONFIGURATIONS.update({(spl, strategy): get_executable(strategy, spl)})69# These 3 take a long time to run (between 1.5 and 3.5 hours), so it is best70#to run them separately and then merge the results in replay.json.71#CONFIGURATIONS = {72# ("MinePump", "Family-based"): get_executable("Family-based", "MinePump"),73# ("MinePump", "Family-product-based"): get_executable("Family-product-based", "MinePump"),74# ("Cloud", "Product-based"): get_executable("Product-based", "Cloud")...

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