Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sortedcontainers for Python 3.10 compatibility #1169

Merged
merged 1 commit into from
Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/rez/vendor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,12 @@ Also now required to support py2/3 interoperability.
<tr><td>
sortedcontainers
</td><td>
1.5.7 (Dec 22, 2016)
2.4.0 (May 17, 2021)
</td><td>
Apache 2.0
</td><td>
https://github.com/grantjenks/python-sortedcontainers<br>
Used in the resolver. Updating would possibly give us some speed improvements.
Used in the resolver.
</td></tr>

<!-- ######################################################### -->
Expand Down
70 changes: 46 additions & 24 deletions src/rez/vendor/sortedcontainers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""Sorted Container Types: SortedList, SortedDict, SortedSet
"""Sorted Containers -- Sorted List, Sorted Dict, Sorted Set

SortedContainers is an Apache2 licensed containers library, written in
Sorted Containers is an Apache2 licensed containers library, written in
pure-Python, and fast as C-extensions.


Python's standard library is great until you need a sorted collections
type. Many will attest that you can get really far without one, but the moment
you **really need** a sorted list, dict, or set, you're faced with a dozen
Expand All @@ -14,39 +13,62 @@

::

>>> from sortedcontainers import SortedList, SortedDict, SortedSet
>>> sl = SortedList(xrange(10000000))
>>> 1234567 in sl
True
>>> sl[7654321]
7654321
>>> sl.add(1234567)
>>> sl.count(1234567)
>>> from sortedcontainers import SortedList
>>> sl = SortedList(['e', 'a', 'c', 'd', 'b'])
>>> sl
SortedList(['a', 'b', 'c', 'd', 'e'])
>>> sl *= 1000000
>>> sl.count('c')
1000000
>>> sl[-3:]
['e', 'e', 'e']
>>> from sortedcontainers import SortedDict
>>> sd = SortedDict({'c': 3, 'a': 1, 'b': 2})
>>> sd
SortedDict({'a': 1, 'b': 2, 'c': 3})
>>> sd.popitem(index=-1)
('c', 3)
>>> from sortedcontainers import SortedSet
>>> ss = SortedSet('abracadabra')
>>> ss
SortedSet(['a', 'b', 'c', 'd', 'r'])
>>> ss.bisect_left('c')
2
>>> sl *= 3
>>> len(sl)
30000003

SortedContainers takes all of the work out of Python sorted types - making your
deployment and use of Python easy. There's no need to install a C compiler or
pre-build and distribute custom extensions. Performance is a feature and
Sorted Containers takes all of the work out of Python sorted types - making
your deployment and use of Python easy. There's no need to install a C compiler
or pre-build and distribute custom extensions. Performance is a feature and
testing has 100% coverage with unit tests and hours of stress.

:copyright: (c) 2016 by Grant Jenks.
:copyright: (c) 2014-2019 by Grant Jenks.
:license: Apache 2.0, see LICENSE for more details.

"""


from .sortedlist import SortedList, SortedListWithKey
from .sortedlist import SortedList, SortedKeyList, SortedListWithKey
from .sortedset import SortedSet
from .sorteddict import SortedDict
from .sorteddict import (
SortedDict,
SortedKeysView,
SortedItemsView,
SortedValuesView,
)

__all__ = ['SortedList', 'SortedSet', 'SortedDict', 'SortedListWithKey']
__all__ = [
'SortedList',
'SortedKeyList',
'SortedListWithKey',
'SortedDict',
'SortedKeysView',
'SortedItemsView',
'SortedValuesView',
'SortedSet',
]

__title__ = 'sortedcontainers'
__version__ = '1.5.7'
__build__ = 0x010507
__version__ = '2.4.0'
__build__ = 0x020400
__author__ = 'Grant Jenks'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2016 Grant Jenks'
__copyright__ = '2014-2019, Grant Jenks'
Loading