diff --git a/setup.py b/setup.py index fb12161..a2ab4ad 100644 --- a/setup.py +++ b/setup.py @@ -4,41 +4,37 @@ Setup script for the Python implementation of LD Patch """ -from setuptools import setup +from setuptools import setup, find_packages -from ast import literal_eval +#from ast import literal_eval -def get_version(source='hydra/__init__.py'): - """ - Retrieve version number without importing the script. - """ - with open(source) as pyfile: - for line in pyfile: - if line.startswith('__version__'): - return literal_eval(line.partition('=')[2].lstrip()) - raise ValueError("VERSION not found") +try: # for pip >= 10 + from pip._internal.req import parse_requirements + from pip._internal.download import PipSession +except ImportError: # for pip <= 9.0.3 + from pip.req import parse_requirements + from pip.download import PipSession -README = '' -with open('README.rst', 'r') as f: - README = f.read() -INSTALL_REQ = [] -with open('requirements.txt', 'r') as f: - # Get requirements depencies as written in the file - INSTALL_REQ = [ i[:-1] for i in f if i[0] != "#" ] +install_requires = parse_requirements('requirements.txt', session=PipSession()) +dependencies = [str(package.req) for package in install_requires] + setup(name = 'python-hydra-agent', - version = get_version(), - packages = ['hydra'], + include_package_data=True, + version = '0.0.1', description = 'A Hydra implementation for Python', - long_description = README, author='W3C Hydra Contributors', author_email='public-hydra@w3.org', - license='LGPL v3', - platforms='OS Independant', url='https://github.com/HTTP-APIs/python-hydra-agent', - include_package_data=True, - install_requires=INSTALL_REQ, - scripts=[], - ) + python_requires='>=3', + install_requires=dependencies, + packages=find_packages( + exclude=['hydra','examples','test*','python_hydra_agent.egg-info']), + package_dir = {'hydra_redis': + 'hydra_redis'}, + + license='LGPL v3', + + )