#!/usr/bin/env python # -*- coding: utf-8 -*- """ PyPI Boilerplate 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 setup, find_packages from pypi_boilerplate 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 interal PyPI server url (-i). Args: path (str): File path for requirements text file. Returns: Array of requirements libraries.""" requirements = [] 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='pypi-boilerplate', version=__version__, description='Boilerplate PyPI setup application.', author='The Orchard', author_email='webdev@theorchard.com', url='https://github.com/theorchard/docs', packages=find_packages(), include_package_data=True, test_suite='tests', zip_safe=False, install_requires=install_requires, tests_require=tests_require )