How to use fetch_necessary_packages method in autotest

Best Python code snippet using autotest_python

build_externals.py

Source:build_externals.py Github

copy

Full Screen

...48 env_python_path = os.environ.get(env_python_path_varname, '')49 if install_dir+':' not in env_python_path:50 os.environ[env_python_path_varname] = ':'.join([51 install_dir, env_python_path])52 fetched_packages, fetch_errors = fetch_necessary_packages(package_dir,53 install_dir)54 install_errors = build_and_install_packages(fetched_packages, install_dir)55 # Byte compile the code after it has been installed in its final56 # location as .pyc files contain the path passed to compile_dir().57 # When printing exception tracebacks, python uses that path first to look58 # for the source code before checking the directory of the .pyc file.59 # Don't leave references to our temporary build dir in the files.60 logging.info('compiling .py files in %s to .pyc', install_dir)61 compileall.compile_dir(install_dir, quiet=True)62 # Some things install with whacky permissions, fix that.63 external_packages.system("chmod -R a+rX '%s'" % install_dir)64 errors = fetch_errors + install_errors65 for error_msg in errors:66 logging.error(error_msg)67 return len(errors)68def fetch_necessary_packages(dest_dir, install_dir):69 """70 Fetches all ExternalPackages into dest_dir.71 @param dest_dir: Directory the packages should be fetched into.72 @param install_dir: Directory where packages will later installed.73 @returns A tuple containing two lists:74 * A list of ExternalPackage instances that were fetched and75 need to be installed.76 * A list of error messages for any failed fetches.77 """78 names_to_check = sys.argv[1:]79 errors = []80 fetched_packages = []81 for package_class in external_packages.ExternalPackage.subclasses:82 package = package_class()...

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 autotest 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