[fix] Pip imports for pip 10
This commit is contained in:
parent
1e0146a453
commit
4392657a71
10
setup.py
10
setup.py
|
@ -16,14 +16,20 @@ import datetime
|
||||||
|
|
||||||
from distutils import log
|
from distutils import log
|
||||||
from distutils.core import Command
|
from distutils.core import Command
|
||||||
from pip.download import PipSession
|
|
||||||
from pip.req import parse_requirements
|
|
||||||
from setuptools.command.develop import develop
|
from setuptools.command.develop import develop
|
||||||
from setuptools.command.install import install
|
from setuptools.command.install import install
|
||||||
from setuptools.command.sdist import sdist
|
from setuptools.command.sdist import sdist
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
from subprocess import check_output
|
from subprocess import check_output
|
||||||
|
|
||||||
|
import pip
|
||||||
|
if tuple(map(int, pip.__version__.split('.'))) >= (10, 0, 0):
|
||||||
|
from pip._internal.download import PipSession
|
||||||
|
from pip._internal.req import parse_requirements
|
||||||
|
else:
|
||||||
|
from pip.download import PipSession
|
||||||
|
from pip.req import parse_requirements
|
||||||
|
|
||||||
ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__)))
|
ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__)))
|
||||||
|
|
||||||
# When executing the setup.py, we need to be able to import ourselves, this
|
# When executing the setup.py, we need to be able to import ourselves, this
|
||||||
|
|
Loading…
Reference in New Issue