Tweak how we import pip internal things, for upgrade view

ugh, just kicking the can down the road here
This commit is contained in:
Lance Edgar 2020-01-27 12:57:40 -06:00
parent e9533727db
commit 35875b7826

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2019 Lance Edgar
# Copyright © 2010-2020 Lance Edgar
#
# This file is part of Rattail.
#
@ -35,10 +35,15 @@ from sqlalchemy import orm
# TODO: pip has declared these to be "not public API" so we should find another way..
try:
# this works for now, with pip 20.0
from pip._internal.network.session import PipSession
from pip._internal.req import parse_requirements
except ImportError:
try:
# this works for now, with pip 10.0.1
from pip._internal.download import PipSession
from pip._internal.req import parse_requirements
except ImportError:
except ImportError:
# this should work with pip < 10.0
from pip.download import PipSession
from pip.req import parse_requirements