diff --git a/sentinel_api/__init__.py b/sentinel_api/__init__.py index 205e195..01de33c 100644 --- a/sentinel_api/__init__.py +++ b/sentinel_api/__init__.py @@ -1 +1,8 @@ -from .sentinel_api import SentinelDownloader \ No newline at end of file +from .sentinel_api import SentinelDownloader + +from pkg_resources import get_distribution, DistributionNotFound +try: + __version__ = get_distribution(__name__).version +except DistributionNotFound: + # package is not installed + pass diff --git a/sentinel_api/sentinel_api.py b/sentinel_api/sentinel_api.py index 12d87c3..63ce3b3 100644 --- a/sentinel_api/sentinel_api.py +++ b/sentinel_api/sentinel_api.py @@ -8,8 +8,6 @@ - Documentation """ -__version__ = '0.5.1' - ########################################################### # imports ########################################################### diff --git a/setup.py b/setup.py index 9c1d8cb..69ab0b4 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,8 @@ setup(name='sentinel_api', packages=find_packages(), include_package_data=True, - version='0.5.2', + setup_requires=['setuptools_scm'], + use_scm_version=True, description='ESA Sentinel Search & Download API', classifiers=[ 'Programming Language :: Python',