Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Commit

Permalink
Merge b8d66a3 into a7f8392
Browse files Browse the repository at this point in the history
  • Loading branch information
ixje committed Aug 14, 2020
2 parents a7f8392 + b8d66a3 commit 26e510f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions setup.py
Expand Up @@ -2,10 +2,16 @@
"""The setup script."""

from setuptools import setup, find_packages
from pkg_resources import parse_version

try: # pip version >= 10.0
try:
from pip._internal.req import parse_requirements
from pip._internal.download import PipSession
from pip import __version__ as __pip_version
pip_version = parse_version(__pip_version)
if (pip_version >= parse_version("20")):
from pip._internal.network.session import PipSession
elif (pip_version >= parse_version("10")):
from pip._internal.download import PipSession
except ImportError: # pip version < 10.0
from pip.req import parse_requirements
from pip.download import PipSession
Expand All @@ -15,7 +21,10 @@

# get the requirements from requirements.txt
install_reqs = parse_requirements('requirements.txt', session=PipSession())
reqs = [str(ir.req) for ir in install_reqs]
if pip_version >= parse_version("20"):
reqs = [str(ir.requirement) for ir in install_reqs]
else:
reqs = [str(ir.req) for ir in install_reqs]

setup(
name='neo-python',
Expand Down

0 comments on commit 26e510f

Please sign in to comment.