Skip to content

Commit 7c654ef

Browse files
authored
Merge pull request #2643 from quantopian/q-py36
Python 3.6 Support
2 parents b43b558 + fc9eb2f commit 7c654ef

File tree

8 files changed

+49
-66
lines changed

8 files changed

+49
-66
lines changed

.appveyor.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ environment:
3737
PANDAS_DATAREADER_VERSION: "0.4.0"
3838
DASK_VERSION: "0.17.1"
3939

40+
- PYTHON_VERSION: "3.6"
41+
PANDAS_VERSION: "0.22.0"
42+
NUMPY_VERSION: "1.14.1"
43+
SCIPY_VERSION: "1.0.0"
44+
PANDAS_DATAREADER_VERSION: "0.4.0"
45+
DASK_VERSION: "0.17.1"
46+
4047
# We always use a 64-bit machine, but can build x86 distributions
4148
# with the PYTHON_ARCH variable (which is used by CMD_IN_ENV).
4249
platform:

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ fast_finish: true
33
python:
44
- 2.7
55
- 3.5
6+
- 3.6
67
env:
78
global:
89
# 1. Generated a token for travis at https://anaconda.org/quantopian/settings/access with scope api:write.
@@ -23,6 +24,8 @@ matrix:
2324
exclude:
2425
- python: 2.7
2526
env: NEW_PANDAS=1
27+
- python: 3.6
28+
env: OLD_PANDAS=1
2629
# include:
2730
# # Workaround Travis OSX not natively supporting Python.
2831
# - os: osx

conda/0_sortedcontainers/meta.yaml

Lines changed: 23 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,48 @@
11
{% set name = "sortedcontainers" %}
2-
{% set version = "1.4.4" %}
3-
{% set file_ext = "tar.gz" %}
4-
{% set hash_type = "sha256" %}
5-
{% set hash_value = "192f59da6df6f91204f85a614a09b88e5ca680a4cc6a31fbc8689cad472da212" %}
2+
{% set version = "2.1.0" %}
3+
{% set sha256 = "974e9a32f56b17c1bac2aebd9dcf197f3eb9cd30553c5852a3187ad162e1a03a" %}
64

75
package:
8-
name: '{{ name|lower }}'
9-
version: '{{ version }}'
6+
name: {{ name }}
7+
version: {{ version }}
108

119
source:
12-
fn: '{{ name }}-{{ version }}.{{ file_ext }}'
13-
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.{{ file_ext }}
14-
'{{ hash_type }}': '{{ hash_value }}'
10+
fn: {{ name }}-{{ version }}.tar.gz
11+
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
12+
sha256: {{ sha256 }}
1513

1614
build:
1715
number: 0
1816
script: python setup.py install --single-version-externally-managed --record=record.txt
1917

2018
requirements:
21-
build:
19+
host:
2220
- python
2321
- setuptools
22+
2423
run:
2524
- python
2625

26+
2727
test:
2828
imports:
2929
- sortedcontainers
30-
requires:
31-
- tox
3230

3331
about:
3432
home: http://www.grantjenks.com/docs/sortedcontainers/
35-
license: Apache Software License
36-
license_family: APACHE
37-
license_file: ''
33+
license: Apache 2.0
34+
license_file: LICENSE
3835
summary: 'Python Sorted Container Types: SortedList, SortedDict, and SortedSet'
39-
description: "Python SortedContainers\n=======================\n\n.. image:: https://api.travis-ci.org/grantjenks/sorted_containers.svg\n :target: http://www.grantjenks.com/docs/sortedcontainers/\n\
40-
\n`SortedContainers`_ is an Apache2 licensed `sorted collections library`_,\nwritten in pure-Python, and fast as C-extensions.\n\nPython's standard library is great until you need a sorted collections\n\
41-
type. Many will attest that you can get really far without one, but the moment\nyou **really need** a sorted list, dict, or set, you're faced with a dozen\ndifferent implementations, most using C-extensions\
42-
\ without great documentation\nand benchmarking.\n\nIn Python, we can do better. And we can do it in pure-Python!\n\n.. code-block:: python\n\n >>> sl = sortedcontainers.SortedList(xrange(10000000))\n\
43-
\ >>> 1234567 in sl\n True\n >>> sl[7654321]\n 7654321\n >>> sl.add(1234567)\n >>> sl.count(1234567)\n 2\n >>> sl *= 3\n >>> len(sl)\n 30000003\n\n**Note:** don't try this\
44-
\ without at least a half gigabyte of memory. In Python\nan integer requires about 24 bytes. SortedList will add about 8 bytes per\nobject stored in the container. That's pretty hard to beat as it's\
45-
\ the cost of\na pointer to each object. It's also 66% less overhead than a typical binary\ntree implementation (e.g. red-black tree, avl tree, aa tree, splay tree, treap,\netc.) for which every node\
46-
\ must also store two pointers to children nodes.\n\n`SortedContainers`_ takes all of the work out of Python sorted collections -\nmaking your deployment and use of Python easy. There's no need to install\
47-
\ a C\ncompiler or pre-build and distribute custom extensions. Performance is a\nfeature and testing has 100% coverage with unit tests and hours of stress.\n\n.. _`SortedContainers`: http://www.grantjenks.com/docs/sortedcontainers/\n\
48-
.. _`sorted collections library`: http://www.grantjenks.com/docs/sortedcontainers/\n\nTestimonials\n------------\n\n**Alex Martelli**, `Wikipedia`_\n\nGood stuff! ... I like the `simple, effective implementation`_\
49-
\ idea of splitting\nthe sorted containers into smaller \"fragments\" to avoid the O(N) insertion costs.\n\n.. _`Wikipedia`: http://en.wikipedia.org/wiki/Alex_Martelli\n.. _`simple, effective implementation`:\
50-
\ http://www.grantjenks.com/docs/sortedcontainers/implementation.html\n\n**Jeff Knupp**, `Review of SortedContainers`_\n\nThat last part, \"fast as C-extensions,\" was difficult to believe. I would\
51-
\ need\nsome sort of `Performance Comparison`_ to be convinced this is true. The author\nincludes this in the docs. It is.\n\n.. _`Review of SortedContainers`: http://reviews.jeffknupp.com/reviews/sortedcontainers/3/\n\
52-
\n**Kevin Samuel**, `Formations Python`_\n\nI'm quite amazed, not just by the code quality (it's incredibly\nreadable and has more comment than code, wow), but the actual\namount of work you put at\
53-
\ stuff that is *not* code:\ndocumentation, benchmarking, implementation explanations. Even\nthe git log is clean and the unit tests run out of the box on\nPython 2 and 3.\n\n.. _`Formations Python`:\
54-
\ http://formationspython.com/\n\n**Mark Summerfield**, a short plea for `Python Sorted Collections`_\n\nPython's \"batteries included\" standard library seems to have a battery\nmissing. And the argument\
55-
\ that \"we never had it before\" has worn thin. It is\ntime that Python offered a full range of collection classes out of the box,\nincluding sorted ones.\n\n.. _`Python Sorted Collections`: http://www.qtrac.eu/pysorted.html\n\
56-
\nFeatures\n--------\n\n- Pure-Python\n- Fully documented\n- Benchmark comparison (alternatives, runtimes, load-factors)\n- 100% test coverage\n- Hours of stress testing\n- Performance matters (often\
57-
\ faster than C implementations)\n- Compatible API (nearly identical to popular blist and rbtree modules)\n- Feature-rich (e.g. get the five largest keys in a sorted dict: d.iloc[-5:])\n- Pragmatic\
58-
\ design (e.g. SortedSet is a Python set with a SortedList index)\n- Developed on Python 2.7\n- Tested on CPython 2.6, 2.7, 3.2, 3.3, 3.4, 3.5 and PyPy 5.1+, PyPy3 2.4+\n\nQuickstart\n----------\n\n\
59-
Installing `SortedContainers`_ is simple with\n`pip <http://www.pip-installer.org/>`_::\n\n $ pip install sortedcontainers\n\nYou can access documentation in the interpreter with Python's built-in\
60-
\ help\nfunction:\n\n.. code-block:: python\n\n >>> from sortedcontainers import SortedList, SortedSet, SortedDict\n >>> help(SortedList)\n\nDocumentation\n-------------\n\nComplete documentation\
61-
\ including performance comparisons is available at\nhttp://www.grantjenks.com/docs/sortedcontainers/ .\n\nUser Guide\n..........\n\nFor those wanting more details, this part of the documentation describes\n\
62-
introduction, implementation, performance, and development.\n\n- `Introduction`_\n- `Performance Comparison`_\n- `Load Factor Performance Comparison`_\n- `Runtime Performance Comparison`_\n- `Simulated\
63-
\ Workload Performance Comparison`_\n- `Implementation Details`_\n- `Performance at Scale`_\n- `Developing and Contributing`_\n- `Release History`_\n\n.. _`Introduction`: http://www.grantjenks.com/docs/sortedcontainers/introduction.html\n\
64-
.. _`Performance Comparison`: http://www.grantjenks.com/docs/sortedcontainers/performance.html\n.. _`Load Factor Performance Comparison`: http://www.grantjenks.com/docs/sortedcontainers/performance-load.html\n\
65-
.. _`Runtime Performance Comparison`: http://www.grantjenks.com/docs/sortedcontainers/performance-runtime.html\n.. _`Simulated Workload Performance Comparison`: http://www.grantjenks.com/docs/sortedcontainers/performance-workload.html\n\
66-
.. _`Implementation Details`: http://www.grantjenks.com/docs/sortedcontainers/implementation.html\n.. _`Performance at Scale`: http://www.grantjenks.com/docs/sortedcontainers/performance-scale.html\n\
67-
.. _`Developing and Contributing`: http://www.grantjenks.com/docs/sortedcontainers/development.html\n.. _`Release History`: http://www.grantjenks.com/docs/sortedcontainers/history.html\n\nAPI Documentation\n\
68-
.................\n\nIf you are looking for information on a specific function, class or method, this\npart of the documentation is for you.\n\n- `SortedList`_\n- `SortedListWithKey`_\n- `SortedDict`_\n\
69-
- `SortedSet`_\n\n.. _`SortedList`: http://www.grantjenks.com/docs/sortedcontainers/sortedlist.html\n.. _`SortedListWithKey`: http://www.grantjenks.com/docs/sortedcontainers/sortedlistwithkey.html\n\
70-
.. _`SortedDict`: http://www.grantjenks.com/docs/sortedcontainers/sorteddict.html\n.. _`SortedSet`: http://www.grantjenks.com/docs/sortedcontainers/sortedset.html\n\nTalks\n-----\n\n- `Python Sorted\
71-
\ Collections | PyCon 2016 Talk`_\n- `SF Python Holiday Party 2015 Lightning Talk`_\n- `DjangoCon 2015 Lightning Talk`_\n\n.. _`Python Sorted Collections | PyCon 2016 Talk`: http://www.grantjenks.com/docs/sortedcontainers/pycon-2016-talk.html\n\
72-
.. _`SF Python Holiday Party 2015 Lightning Talk`: http://www.grantjenks.com/docs/sortedcontainers/sf-python-2015-lightning-talk.html\n.. _`DjangoCon 2015 Lightning Talk`: http://www.grantjenks.com/docs/sortedcontainers/djangocon-2015-lightning-talk.html\n\
73-
\nContribute\n----------\n\nCollaborators are welcome!\n\n#. Check for open issues or open a fresh issue to start a discussion around a\n bug. There is a Contributor Friendly tag for issues that\
74-
\ should be used by\n people who are not very familiar with the codebase yet.\n#. Fork the `SortedContainers repository\n <https://github.com/grantjenks/sorted_containers>`_ on GitHub and start\n\
75-
\ making your changes to a new branch.\n#. Write a test which shows that the bug was fixed.\n#. Send a pull request and bug the maintainer until it gets merged and\n published.\n\nUseful Links\n\
76-
------------\n\n- `SortedContainers Documentation`_\n- `SortedContainers at PyPI`_\n- `SortedContainers at Github`_\n- `SortedContainers Issue Tracker`_\n\n.. _`SortedContainers Documentation`: http://www.grantjenks.com/docs/sortedcontainers/\n\
77-
.. _`SortedContainers at PyPI`: https://pypi.python.org/pypi/sortedcontainers\n.. _`SortedContainers at Github`: https://github.com/grantjenks/sorted_containers\n.. _`SortedContainers Issue Tracker`:\
78-
\ https://github.com/grantjenks/sorted_containers/issues\n\nSortedContainers License\n------------------------\n\nCopyright 2014-2016 Grant Jenks\n\nLicensed under the Apache License, Version 2.0 (the\
79-
\ \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable\
80-
\ law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License\
81-
\ for the specific language governing permissions and\nlimitations under the License."
82-
doc_url: ''
83-
dev_url: ''
36+
description: |
37+
SortedContainers is a sorted collections library, written in pure-Python
38+
and fast as C-extensions.
39+
doc_url: http://www.grantjenks.com/docs/sortedcontainers/
40+
dev_url: https://github.com/grantjenks/python-sortedcontainers
41+
doc_source_url: https://github.com/grantjenks/python-sortedcontainers/blob/master/docs/index.rst
8442

8543
extra:
86-
recipe-maintainers: ''
44+
recipe-maintainers:
45+
- grantjenks
46+
- msarahan
47+
- richafrank
48+
- nehaljwani

etc/conda_build_matrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import click
66

7-
py_versions = ('2.7', '3.4', '3.5')
7+
py_versions = ('2.7', '3.4', '3.5', '3.6')
88
npy_versions = ('1.9', '1.10')
99
zipline_path = os.path.join(
1010
os.path.dirname(__file__),

etc/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ sqlalchemy==1.1.18
7575
# For asset db management
7676
alembic==0.7.7
7777

78-
sortedcontainers==1.4.4
78+
sortedcontainers==2.1.0
7979
# for intervaltree
8080
intervaltree==2.1.0
8181

etc/requirements_blaze.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ flask-cors==2.1.3
1515
Jinja2==2.10.1
1616
MarkupSafe==0.23
1717
Werkzeug==0.12.2
18-
psutil==4.3.0
18+
psutil==5.6.7
1919

2020
-e git://github.com/quantopian/blaze.git@f26375a6708eab85b7acc7869d6c518df2f974eb#egg=blaze

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ def setup_requirements(requirements_path, module_names, strict_bounds,
314314
'Programming Language :: Python',
315315
'Programming Language :: Python :: 2.7',
316316
'Programming Language :: Python :: 3.5',
317+
'Programming Language :: Python :: 3.6',
317318
'Operating System :: OS Independent',
318319
'Intended Audience :: Science/Research',
319320
'Topic :: Office/Business :: Financial',

tests/test_examples.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
from functools import partial
16+
from operator import itemgetter
1617
import tarfile
1718

1819
import matplotlib
@@ -76,11 +77,20 @@ def test_example(self, example_name):
7677
},
7778
)
7879
expected_perf = self.expected_perf[example_name]
80+
# Exclude positions column as the positions do not always have the
81+
# same order
82+
columns = [column for column in examples._cols_to_check
83+
if column != 'positions']
7984
assert_equal(
80-
actual_perf[examples._cols_to_check],
81-
expected_perf[examples._cols_to_check],
85+
actual_perf[columns],
86+
expected_perf[columns],
8287
# There is a difference in the datetime columns in pandas
8388
# 0.16 and 0.17 because in 16 they are object and in 17 they are
8489
# datetime[ns, UTC]. We will just ignore the dtypes for now.
8590
check_dtype=False,
8691
)
92+
# Sort positions by SID before comparing
93+
assert_equal(
94+
expected_perf['positions'].apply(sorted, key=itemgetter('sid')),
95+
actual_perf['positions'].apply(sorted, key=itemgetter('sid')),
96+
)

0 commit comments

Comments
 (0)