Add workaround for using pip 10.0 "internal" API in upgrades view
This commit is contained in:
parent
93b3a5dab6
commit
8387129eda
|
@ -31,10 +31,18 @@ import re
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import six
|
import six
|
||||||
from pip.download import PipSession
|
|
||||||
from pip.req import parse_requirements
|
|
||||||
from sqlalchemy import orm
|
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 10.0.1
|
||||||
|
from pip._internal.download import PipSession
|
||||||
|
from pip._internal.req import parse_requirements
|
||||||
|
except ImportError:
|
||||||
|
# this should work with pip < 10.0
|
||||||
|
from pip.download import PipSession
|
||||||
|
from pip.req import parse_requirements
|
||||||
|
|
||||||
from rattail.db import model, Session as RattailSession
|
from rattail.db import model, Session as RattailSession
|
||||||
from rattail.time import make_utc
|
from rattail.time import make_utc
|
||||||
from rattail.threads import Thread
|
from rattail.threads import Thread
|
||||||
|
|
Loading…
Reference in a new issue