How to use _get_local_file method in avocado

Best Python code snippet using avocado_python

setup.py

Source:setup.py Github

copy

Full Screen

1from datetime import datetime2from pathlib import Path3from setuptools import setup, find_packages4BASEDIR = Path(__file__).absolute().parent5def _get_local_file(file_path):6 """Load file in same directory than setup.py."""7 return open(8 BASEDIR.joinpath(file_path), 'r', encoding='utf-8'9 )10def _get_requirements(requirements_file="requirements.txt"):11 """Parse requirements.txt and return list."""12 requirements_file = BASEDIR.joinpath(requirements_file)13 if requirements_file.is_file():14 with open(requirements_file, 'r') as requirements:15 # Ensure deps order16 return [17 line.strip() for line in reversed(requirements.readlines())18 if not line.startswith('#')19 ]20 return []21VERSION = _get_local_file("VERSION").read().strip() or datetime.today().strftime("%Y.%m.%d")22setup(23 # Project informations24 name='defacto',25 version=VERSION,26 author='Grympler',27 author_email='grympler@protonmail.com',28 maintainer="Grympler",29 maintainer_email="grympler@protonmail.com",30 url="https://github.com/grympler/defacto",31 download_url="https://github.com/grympler/defacto",32 # License and description33 license=_get_local_file("LICENSE").read(),34 description='defacto reverse peer programming test',35 long_description=_get_local_file("README.md").read() + "\n",36 # requirements37 install_requires=_get_requirements(),38 # Package, scripts informations39 packages=find_packages(),40 package_data={'': ["*.tar.xz"]},41 include_package_data=True,42 classifiers=[43 'Environment :: Console',44 'Programming Language :: Python :: 3.9',45 'Programming Language :: Python :: 3 :: Only',46 'License :: Other/Proprietary License'47 ],48 # Magic !49 zip_safe=False...

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