#!/bin/env python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # See LICENSE for more details. # # Copyright: Red Hat Inc. 2013-2014 # Author: Lucas Meneghel Rodrigues import glob import os # pylint: disable=E0611 from distutils.core import setup import avocado.version def get_settings_dir(): settings_system_wide = os.path.join('/etc', 'avocado') settings_local_install = os.path.join('etc', 'avocado') if 'VIRTUAL_ENV' in os.environ: return settings_local_install else: return settings_system_wide def get_tests_dir(): settings_system_wide = os.path.join('/usr', 'share', 'avocado', 'tests') settings_local_install = os.path.join('tests') if 'VIRTUAL_ENV' in os.environ: return settings_local_install else: return settings_system_wide def get_docs_dir(): settings_system_wide = os.path.join('/usr', 'share', 'doc', 'avocado') settings_local_install = '' if 'VIRTUAL_ENV' in os.environ: return settings_local_install else: return settings_system_wide def get_data_files(): data_files = [(get_settings_dir(), ['etc/settings.ini'])] data_files += [(get_tests_dir(), glob.glob('tests/*.py'))] for data_dir in glob.glob('tests/*.data'): fmt_str = '%s/*' % data_dir data_files += [(os.path.join(get_tests_dir(), os.path.basename(data_dir)), [glob.glob(fmt_str)[0]])] data_files.append((get_docs_dir(), ['man/avocado.rst'])) return data_files setup(name='avocado', version=avocado.version.VERSION, description='Avocado Test Framework', author='Lucas Meneghel Rodrigues', author_email='lmr@redhat.com', url='http://github.com/avocado-framework/avocado', packages=['avocado', 'avocado.cli', 'avocado.core', 'avocado.external', 'avocado.linux', 'avocado.utils', 'avocado.plugins'], data_files=get_data_files(), scripts=['scripts/avocado'])