#!/usr/bin/env python # -*- coding: utf-8 -*- """ ISO Standards Setup Standard setup.py file which is used to package and distribute a Python package with Distutils so that it can be published to a PyPI server. This file belongs in the root directory of a project repository. This is an example that uses some basic options which are available for the setup of a PyPI package. It also reads and gathers example dependencies for a package. See: https://pythonhosted.org/setuptools/setuptools.html for more details. """ from setuptools import find_packages from setuptools import setup from iso_standards import __version__ def read_requirements(path): """Read requirements from file based on file path provided. Lines beginning with a dash are excluded, e.g. references to an internal PyPI server url (-i). Args: path (str): File path for requirements text file. Returns: Array of requirements libraries. """ with open(path, 'r') as fd: requirements = [ req.strip() for req in fd.readlines() if not req.startswith('-')] return requirements install_requires = list(read_requirements('requirements.txt')) tests_require = list(set( install_requires + read_requirements('requirements-dev.txt'))) setup( name='iso-standards', version=__version__, description='Shareable static data for accounting tasks.', author='The Orchard', author_email='webdev@theorchard.com', url='https://github.com/theorchard/iso-standards', packages=find_packages(), data_files=[ ('xml', [ 'iso_standards/data/xml/current_iso_currencies.xml', 'iso_standards/data/xml/historical_iso_currencies.xml' ]), ('json', [ 'iso_standards/data/json/countries_and_regions.json', ]) ], include_package_data=True, test_suite='tests', zip_safe=False, install_requires=install_requires, tests_require=tests_require )