From 5ca6235ba0a2556579b6ab1ff108e8c8629d5bb1 Mon Sep 17 00:00:00 2001 From: Grant Jenks Date: Fri, 27 Jul 2018 14:00:09 -0700 Subject: [PATCH] Changes for Python 3.7 --- .travis.yml | 6 +++++- README.rst | 4 ++-- appveyor.yml | 2 ++ docs/development.rst | 1 + docs/performance-load.rst | 2 +- docs/performance-runtime.rst | 8 ++++---- setup.py | 2 ++ tests/benchmark.sh | 30 +++++++++++++++--------------- tox.ini | 2 +- 9 files changed, 33 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0cd415de..eb8d7c54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,13 @@ matrix: env: TOXENV=py35 - python: 3.6 env: TOXENV=py36 + - python: 3.7 + dist: xenial + env: TOXENV=py37 - python: pypy env: TOXENV=pypy - python: pypy3 env: TOXENV=pypy3 - - python: 3.6 + - python: 3.7 + dist: xenial env: TOXENV=lint diff --git a/README.rst b/README.rst index 80581d81..9632b142 100644 --- a/README.rst +++ b/README.rst @@ -111,8 +111,8 @@ Features - Compatible API (nearly identical to older blist and bintrees modules) - Feature-rich (e.g. get the five largest keys in a sorted dict: d.keys()[-5:]) - Pragmatic design (e.g. SortedSet is a Python set with a SortedList index) -- Developed on Python 3.6 -- Tested on CPython 2.7, 3.2, 3.3, 3.4, 3.5, 3.6 and PyPy, PyPy3 +- Developed on Python 3.7 +- Tested on CPython 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 and PyPy, PyPy3 .. image:: https://api.travis-ci.org/grantjenks/python-sortedcontainers.svg?branch=master :target: http://www.grantjenks.com/docs/sortedcontainers/ diff --git a/appveyor.yml b/appveyor.yml index 2098117f..dc376f19 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,10 +6,12 @@ environment: - PYTHON: "C:\\Python34" - PYTHON: "C:\\Python35" - PYTHON: "C:\\Python36" + - PYTHON: "C:\\Python37" - PYTHON: "C:\\Python27-x64" - PYTHON: "C:\\Python34-x64" - PYTHON: "C:\\Python35-x64" - PYTHON: "C:\\Python36-x64" + - PYTHON: "C:\\Python37-x64" install: diff --git a/docs/development.rst b/docs/development.rst index f713a22d..9bc0e782 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -220,6 +220,7 @@ of Python: * CPython 3.4 * CPython 3.5 * CPython 3.6 +* CPython 3.7 * PyPy * PyPy3 diff --git a/docs/performance-load.rst b/docs/performance-load.rst index 849512ac..e38d1dd0 100644 --- a/docs/performance-load.rst +++ b/docs/performance-load.rst @@ -17,7 +17,7 @@ in-depth analysis of the load factor read :doc:`Performance at Scale`. Performance of competing implementations are benchmarked against the CPython -3.6 runtime. An :doc:`implementation performance comparison` is +3.7 runtime. An :doc:`implementation performance comparison` is also included with data from popular sorted collections packages. Because :doc:`Sorted Containers` is pure-Python, its performance also diff --git a/docs/performance-runtime.rst b/docs/performance-runtime.rst index 4337e14f..91145429 100644 --- a/docs/performance-runtime.rst +++ b/docs/performance-runtime.rst @@ -4,17 +4,17 @@ Runtime Performance Comparison Because :doc:`Sorted Containers` is implemented in pure-Python, its performance depends directly on the Python runtime. :doc:`Sorted Containers` is primarily developed, tested and benchmarked on CPython -3.6. +3.7. Not all runtimes are created equal. The graphs below compare :doc:`Sorted -Containers` running on the CPython 3.6, CPython 2.7, and PyPy -runtimes. As of Python 3.6 the CPython 3.6 runtime is now faster than the +Containers` running on the CPython 3.7, CPython 2.7, and PyPy +runtimes. As of Python 3.7 the CPython 3.7 runtime is now faster than the CPython 2.7 runtime. The PyPy runtime displays much more variability due to its JIT-ed nature. Once the just-in-time compiler optimizes the code, performance is often two to ten times faster. Performance of competing implementations are benchmarked against the CPython -3.6 runtime. An :doc:`implementation performance comparison` is +3.7 runtime. An :doc:`implementation performance comparison` is also included with data from popular sorted container packages. :doc:`Sorted Containers` uses a segmented-list data structure similar to diff --git a/setup.py b/setup.py index f0de60e9..a76ccc58 100644 --- a/setup.py +++ b/setup.py @@ -44,6 +44,8 @@ def run_tests(self): 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', ), diff --git a/tests/benchmark.sh b/tests/benchmark.sh index 1d12dbb4..2930ef48 100755 --- a/tests/benchmark.sh +++ b/tests/benchmark.sh @@ -4,31 +4,31 @@ set -x # Compare Implementations -echo ". env36/bin/activate && python -m tests.benchmark_sortedlist --bare > tests/results_sortedlist.txt" | bash +echo ". env37/bin/activate && python -m tests.benchmark_sortedlist --bare > tests/results_sortedlist.txt" | bash python -m tests.benchmark_plot tests/results_sortedlist.txt SortedList --save -echo ". env36/bin/activate && python -m tests.benchmark_sorteddict --bare > tests/results_sorteddict.txt" | bash +echo ". env37/bin/activate && python -m tests.benchmark_sorteddict --bare > tests/results_sorteddict.txt" | bash python -m tests.benchmark_plot tests/results_sorteddict.txt SortedDict --save -echo ". env36/bin/activate && python -m tests.benchmark_sortedset --bare > tests/results_sortedset.txt" | bash +echo ". env37/bin/activate && python -m tests.benchmark_sortedset --bare > tests/results_sortedset.txt" | bash python -m tests.benchmark_plot tests/results_sortedset.txt SortedSet --save # Compare Python Versions rm tests/results_runtime_sortedlist.txt -echo ". env36/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _Py36 >> tests/results_runtime_sortedlist.txt" | bash +echo ". env37/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _Py37 >> tests/results_runtime_sortedlist.txt" | bash echo ". env27/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _Py27 >> tests/results_runtime_sortedlist.txt" | bash echo ". env27/bin/activate && pypy -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _PyPy >> tests/results_runtime_sortedlist.txt" | bash python -m tests.benchmark_plot tests/results_runtime_sortedlist.txt SortedList --suffix _runtime --save rm tests/results_runtime_sorteddict.txt -echo ". env36/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _Py36 >> tests/results_runtime_sorteddict.txt" | bash +echo ". env37/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _Py37 >> tests/results_runtime_sorteddict.txt" | bash echo ". env27/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _Py27 >> tests/results_runtime_sorteddict.txt" | bash echo ". env27/bin/activate && pypy -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _PyPy >> tests/results_runtime_sorteddict.txt" | bash python -m tests.benchmark_plot tests/results_runtime_sorteddict.txt SortedDict --suffix _runtime --save rm tests/results_runtime_sortedset.txt -echo ". env36/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _Py36 >> tests/results_runtime_sortedset.txt" | bash +echo ". env37/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _Py37 >> tests/results_runtime_sortedset.txt" | bash echo ". env27/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _Py27 >> tests/results_runtime_sortedset.txt" | bash echo ". env27/bin/activate && pypy -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _PyPy >> tests/results_runtime_sortedset.txt" | bash python -m tests.benchmark_plot tests/results_runtime_sortedset.txt SortedSet --suffix _runtime --save @@ -36,19 +36,19 @@ python -m tests.benchmark_plot tests/results_runtime_sortedset.txt SortedSet --s # Compare Loads rm tests/results_load_sortedlist.txt -echo ". env36/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _100 --load 100 --no-limit >> tests/results_load_sortedlist.txt" | bash -echo ". env36/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _1000 --load 1000 --no-limit >> tests/results_load_sortedlist.txt" | bash -echo ". env36/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _10000 --load 10000 --no-limit >> tests/results_load_sortedlist.txt" | bash +echo ". env37/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _100 --load 100 --no-limit >> tests/results_load_sortedlist.txt" | bash +echo ". env37/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _1000 --load 1000 --no-limit >> tests/results_load_sortedlist.txt" | bash +echo ". env37/bin/activate && python -m tests.benchmark_sortedlist --bare --kind SortedList --suffix _10000 --load 10000 --no-limit >> tests/results_load_sortedlist.txt" | bash python -m tests.benchmark_plot tests/results_load_sortedlist.txt SortedList --suffix _load --save rm tests/results_load_sorteddict.txt -echo ". env36/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _100 --load 100 --no-limit >> tests/results_load_sorteddict.txt" | bash -echo ". env36/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _1000 --load 1000 --no-limit >> tests/results_load_sorteddict.txt" | bash -echo ". env36/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _10000 --load 10000 --no-limit >> tests/results_load_sorteddict.txt" | bash +echo ". env37/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _100 --load 100 --no-limit >> tests/results_load_sorteddict.txt" | bash +echo ". env37/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _1000 --load 1000 --no-limit >> tests/results_load_sorteddict.txt" | bash +echo ". env37/bin/activate && python -m tests.benchmark_sorteddict --bare --kind SortedDict --suffix _10000 --load 10000 --no-limit >> tests/results_load_sorteddict.txt" | bash python -m tests.benchmark_plot tests/results_load_sorteddict.txt SortedDict --suffix _load --save rm tests/results_load_sortedset.txt -echo ". env36/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _100 --load 100 --no-limit >> tests/results_load_sortedset.txt" | bash -echo ". env36/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _1000 --load 1000 --no-limit >> tests/results_load_sortedset.txt" | bash -echo ". env36/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _10000 --load 10000 --no-limit >> tests/results_load_sortedset.txt" | bash +echo ". env37/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _100 --load 100 --no-limit >> tests/results_load_sortedset.txt" | bash +echo ". env37/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _1000 --load 1000 --no-limit >> tests/results_load_sortedset.txt" | bash +echo ". env37/bin/activate && python -m tests.benchmark_sortedset --bare --kind SortedSet --suffix _10000 --load 10000 --no-limit >> tests/results_load_sortedset.txt" | bash python -m tests.benchmark_plot tests/results_load_sortedset.txt SortedSet --suffix _load --save diff --git a/tox.ini b/tox.ini index a2aef13b..dc46e84d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=py27,py34,py35,py36,pypy,pypy3,lint +envlist=py27,py34,py35,py36,py37,pypy,pypy3,lint skip_missing_interpreters=True [testenv]