Skip to content

Commit

Permalink
Merge pull request #522 from VChristiaens/master
Browse files Browse the repository at this point in the history
Fixed bug in setup.py related to latest version of pip
  • Loading branch information
VChristiaens authored Apr 26, 2022
2 parents fe98488 + 29ee7ce commit f6428c5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
hciplot>=0.2.1
numpy
scipy
astropy
Expand All @@ -14,4 +13,5 @@ psutil
pyprind
munch
nbsphinx
opencv-python
opencv-python
hciplot>=0.2.1
35 changes: 20 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion vip_hci/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.2.2"
__version__ = "1.2.3"

from . import preproc
from . import config
Expand Down

0 comments on commit f6428c5

Please sign in to comment.