Changeset 8387129 in tailbone


Ignore:
Timestamp:
06/14/18 19:57:15 (2 years ago)
Author:
Lance Edgar <lance@…>
Branches:
master
Children:
ea8e523
Parents:
93b3a5d
Message:

Add workaround for using pip 10.0 "internal" API in upgrades view

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tailbone/views/upgrades.py

    r93b3a5d r8387129  
    3232
    3333import six
    34 from pip.download import PipSession
    35 from pip.req import parse_requirements
    3634from sqlalchemy import orm
     35
     36# TODO: pip has declared these to be "not public API" so we should find another way..
     37try:
     38    # this works for now, with pip 10.0.1
     39    from pip._internal.download import PipSession
     40    from pip._internal.req import parse_requirements
     41except ImportError:
     42    # this should work with pip < 10.0
     43    from pip.download import PipSession
     44    from pip.req import parse_requirements
    3745
    3846from rattail.db import model, Session as RattailSession
Note: See TracChangeset for help on using the changeset viewer.