diff --git a/requirements.txt b/requirements.txt index 325523ef..f605dbd2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -hciplot>=0.2.1 numpy scipy astropy @@ -14,4 +13,5 @@ psutil pyprind munch nbsphinx -opencv-python \ No newline at end of file +opencv-python +hciplot>=0.2.1 \ No newline at end of file diff --git a/setup.py b/setup.py index 793a2b85..2af141f8 100644 --- a/setup.py +++ b/setup.py @@ -3,10 +3,19 @@ import os import re from setuptools import setup -try: # pip >= 10 +try: + # pip >=20 + from pip._internal.network.session import PipSession from pip._internal.req import parse_requirements -except ImportError: # pip <= 9.0.3 - from pip.req import parse_requirements +except ImportError: + try: + # 10.0.0 <= pip <= 19.3.1 + from pip._internal.download import PipSession + from pip._internal.req import parse_requirements + except ImportError: + # pip <= 9.0.3 + from pip.download import PipSession + from pip.req import parse_requirements from setuptools.command.install import install from setuptools.command.develop import develop @@ -36,16 +45,12 @@ def resource(*args): # parse_requirements() returns generator of pip.req.InstallRequirement objects -reqs = parse_requirements(resource('requirements.txt'), session=False) -try: - reqs = [str(ir.req) for ir in reqs] -except: - reqs = [str(ir.requirement) for ir in reqs] -reqs_dev = parse_requirements(resource('requirements-dev.txt'), session=False) -try: - reqs_dev = [str(ir.req) for ir in reqs_dev] -except: - reqs_dev = [str(ir.requirement) for ir in reqs_dev] +reqs = parse_requirements(resource('requirements.txt'), session=PipSession) +requirements = [str(ir.requirement) for ir in reqs] + +reqs_dev = parse_requirements(resource('requirements-dev.txt'), + session=PipSession) +requirements_dev = [str(ir.requirement) for ir in reqs_dev] with open(resource('README.rst')) as readme_file: README = readme_file.read() @@ -80,8 +85,8 @@ def resource(*args): cmdclass={'install': InstallReqs, 'develop': InstallDevReqs}, packages=PACKAGES, - install_requires=reqs, - extras_require={"dev": reqs_dev}, + install_requires=requirements, + extras_require={"dev": requirements_dev}, zip_safe=False, classifiers=['Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', diff --git a/vip_hci/__init__.py b/vip_hci/__init__.py index 8d9672f9..9e578d6c 100644 --- a/vip_hci/__init__.py +++ b/vip_hci/__init__.py @@ -1,4 +1,4 @@ -__version__ = "1.2.2" +__version__ = "1.2.3" from . import preproc from . import config