Skip to content

Commit

Permalink
Removed internal dependency on pip.utils, which makes the library… (
Browse files Browse the repository at this point in the history
#71)

* Removed internal dependency on ``pip.utils``, which makes the library compatible with pip 10. Fixes #70

* Fix lint

* Update inline coverage settings for cached_property

* Fix
  • Loading branch information
Stranger6667 committed Apr 16, 2018
1 parent 66e6c5c commit 36dbc48
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
9 changes: 8 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Changelog
`Unreleased`_
-------------

Fixed
~~~~~

- Removed internal dependency on ``pip.utils``, which makes the library compatible with pip 10. `#70`_ (`butorov`_, `Stranger6667`_)

`0.6.4`_ - 2018-03-28
---------------------

Expand Down Expand Up @@ -264,6 +269,7 @@ Fixed
.. _0.1.2: https://github.com/Stranger6667/pyoffers/compare/0.1.1...0.1.2
.. _0.1.1: https://github.com/Stranger6667/pyoffers/compare/0.1.0...0.1.1

.. _#70: https://github.com/Stranger6667/pyoffers/issues/70
.. _#52: https://github.com/Stranger6667/pyoffers/issues/52
.. _#51: https://github.com/Stranger6667/pyoffers/issues/51
.. _#48: https://github.com/Stranger6667/pyoffers/issues/48
Expand Down Expand Up @@ -306,5 +312,6 @@ Fixed
.. _#5: https://github.com/Stranger6667/pyoffers/issues/5
.. _#3: https://github.com/Stranger6667/pyoffers/issues/3

.. _Stranger6667: https://github.com/Stranger6667
.. _iamanikeev: https://github.com/iamanikeev
.. _butorov: https://github.com/butorov
.. _Stranger6667: https://github.com/Stranger6667
3 changes: 1 addition & 2 deletions pyoffers/models/raw_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from io import BytesIO, StringIO
from zipfile import ZipFile

from pip.utils import cached_property

from ..utils import cached_property
from .core import Model, ModelManager


Expand Down
12 changes: 12 additions & 0 deletions pyoffers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
from functools import singledispatch


class cached_property(object):

def __init__(self, func):
self.func = func

def __get__(self, obj, cls):
if obj is None: # pragma: no cover
return self
value = obj.__dict__[self.func.__name__] = self.func(obj)
return value


def prepare_query_params(**kwargs):
"""
Prepares given parameters to be used in querystring.
Expand Down

0 comments on commit 36dbc48

Please sign in to comment.