diff --git a/.travis.yml b/.travis.yml index 1e77ced..40523ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ matrix: - name: linux-py35 language: python python: 3.5 - dist: xenial sudo: required services: - docker @@ -15,7 +14,6 @@ matrix: name: linux-py35 language: python python: 3.5 - dist: xenial sudo: required services: - docker @@ -23,10 +21,10 @@ matrix: - TOXENV=py35 - PIP=pip3 - CIBW_BUILD=cp35-* + - name: linux-py36 language: python python: 3.6 - dist: xenial sudo: required services: - docker @@ -38,7 +36,6 @@ matrix: name: linux-py36 language: python python: 3.6 - dist: xenial sudo: required services: - docker @@ -46,10 +43,10 @@ matrix: - TOXENV=py36 - PIP=pip3 - CIBW_BUILD=cp36-* + - name: linux-py37 language: python python: 3.7 - dist: xenial sudo: required services: - docker @@ -61,7 +58,6 @@ matrix: name: linux-py37 language: python python: 3.7 - dist: xenial sudo: required services: - docker @@ -69,12 +65,35 @@ matrix: - TOXENV=py37 - PIP=pip3 - CIBW_BUILD=cp37-* + + - name: linux-py38 + language: python + python: 3.8 + sudo: required + services: + - docker + env: + - TOXENV=py38 + - PIP=pip3 + - CIBW_BUILD=cp3!-* + - arch: arm64 + name: linux-py38 + language: python + python: 3.8 + sudo: required + services: + - docker + env: + - TOXENV=py38 + - PIP=pip3 + - CIBW_BUILD=cp38-* + - name: osx-py35 os: osx language: generic env: - TOXENV=py35 - - PIP=pip2 + - PIP=pip3 - CIBW_BUILD=cp35-* - CIBW_TEST_COMMAND="pushd {project}; tox ; popd" - CIBW_BEFORE_BUILD="${PIP} install -U pip; ${PIP} install -r requirements.txt" @@ -82,12 +101,13 @@ matrix: - ${PIP} install cibuildwheel==0.10.2 script: - cibuildwheel --output-dir dist + - name: osx-py36 os: osx language: generic env: - TOXENV=py36 - - PIP=pip2 + - PIP=pip3 - CIBW_BUILD=cp36-* - CIBW_TEST_COMMAND="pushd {project}; tox ; popd" - CIBW_BEFORE_BUILD="${PIP} install -U pip; ${PIP} install -r requirements.txt" @@ -95,12 +115,13 @@ matrix: - ${PIP} install cibuildwheel==0.10.2 script: - cibuildwheel --output-dir dist + - name: osx-py37 os: osx language: generic env: - TOXENV=py37 - - PIP=pip2 + - PIP=pip3 - CIBW_BUILD=cp37-* - CIBW_TEST_COMMAND="pushd {project}; tox ; popd" - CIBW_BEFORE_BUILD="${PIP} install -U pip; ${PIP} install -r requirements.txt" @@ -108,6 +129,21 @@ matrix: - ${PIP} install cibuildwheel==0.10.2 script: - cibuildwheel --output-dir dist + + - name: osx-py38 + os: osx + language: generic + env: + - TOXENV=py38 + - PIP=pip3 + - CIBW_BUILD=cp38-* + - CIBW_TEST_COMMAND="pushd {project}; tox ; popd" + - CIBW_BEFORE_BUILD="${PIP} install -U pip; ${PIP} install -r requirements.txt" + install: + - ${PIP} install cibuildwheel==0.10.2 + script: + - cibuildwheel --output-dir dist + - name: pypy3.5 language: python python: pypy3.5 @@ -121,13 +157,13 @@ matrix: - ${PIP} install -r requirements.txt script: - tox - - name: doctest36 + + - name: doctest38 language: python - python: 3.6 - dist: trusty + python: 3.8 sudo: false env: - - TOXENV=doctest36 + - TOXENV=doctest38 - PIP=pip install: - ${PIP} install -U pip @@ -135,26 +171,25 @@ matrix: script: - tox - arch: arm64 - name: doctest36 + name: doctest38 language: python - python: 3.6 - dist: xenial + python: 3.8 sudo: false env: - - TOXENV=doctest36 + - TOXENV=doctest38 - PIP=pip install: - ${PIP} install -U pip - ${PIP} install -r requirements.txt script: - tox - - name: memorytest36 + + - name: memorytest38 language: python - python: 3.6 - dist: trusty + python: 3.8 sudo: false env: - - TOXENV=memorytest36 + - TOXENV=memorytest38 - PIP=pip install: - ${PIP} install -U pip @@ -162,19 +197,19 @@ matrix: script: - tox - arch: arm64 - name: memorytest36 + name: memorytest38 language: python - python: 3.6 - dist: xenial + python: 3.8 sudo: false env: - - TOXENV=memorytest36 + - TOXENV=memorytest38 - PIP=pip install: - ${PIP} install -U pip - ${PIP} install -r requirements.txt script: - tox + install: - ${PIP} install -U pip - ${PIP} install cibuildwheel==0.10.2 diff --git a/CHANGES.txt b/CHANGES.txt index 603b3f2..aefde58 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,8 @@ Revision history ---------------- +0.17.0, 2020-09-08 + * Remove Python 2 support. + 0.16.0, 2020-03-24 * No major updates but Python 2 support no longer guaranteed. * Fix #192, 'ignore_extra' for 'pvector_field'. Thanks @ss18 for this! diff --git a/README.rst b/README.rst index d06cda4..59c121a 100644 --- a/README.rst +++ b/README.rst @@ -12,7 +12,7 @@ Pyrsistent .. _Pyrthon: https://www.github.com/tobgu/pyrthon/ -Pyrsistent is a number of persistent collections (by some referred to as functional data structures). Persistent in +Pyrsistent is a number of persistent collections (by some referred to as functional data structures). Persistent in the sense that they are immutable. All methods on a data structure that would normally mutate it instead return a new copy of the structure containing the @@ -222,7 +222,7 @@ by providing an iterable of types. Custom types (classes) that are iterable should be wrapped in a tuple to prevent their -members being added to the set of valid types. Although Enums in particular are now +members being added to the set of valid types. Although Enums in particular are now supported without wrapping, see #83 for more information. Mandatory fields @@ -329,7 +329,7 @@ It is also possible to have fields with ``pyrsistent`` collections. ... map_int_to_str = pmap_field(int, str) ... vector_of_strs = pvector_field(str) ... - + Serialization ************* PRecords support serialization back to dicts. Default serialization will take keys and values @@ -567,15 +567,15 @@ Pyrsistent is developed and tested on Python 3.5, 3.6, 3.7, 3.8 and PyPy3. Performance ----------- -Pyrsistent is developed with performance in mind. Still, while some operations are nearly on par with their built in, +Pyrsistent is developed with performance in mind. Still, while some operations are nearly on par with their built in, mutable, counterparts in terms of speed, other operations are slower. In the cases where attempts at optimizations have been done, speed has generally been valued over space. -Pyrsistent comes with two API compatible flavors of PVector (on which PMap and PSet are based), one pure Python +Pyrsistent comes with two API compatible flavors of PVector (on which PMap and PSet are based), one pure Python implementation and one implemented as a C extension. The latter generally being 2 - 20 times faster than the former. The C extension will be used automatically when possible. -The pure python implementation is fully PyPy compatible. Running it under PyPy speeds operations up considerably if +The pure python implementation is fully PyPy compatible. Running it under PyPy speeds operations up considerably if the structures are used heavily (if JITed), for some cases the performance is almost on par with the built in counterparts. Type hints @@ -686,7 +686,7 @@ Tests can be executed using tox_. Install tox: ``pip install tox`` -Run test for Python 3.7: ``tox -epy37`` +Run test for Python 3.8: ``tox -e py38`` Release ~~~~~~~ diff --git a/_pyrsistent_version.py b/_pyrsistent_version.py index 8911e95..435d64b 100644 --- a/_pyrsistent_version.py +++ b/_pyrsistent_version.py @@ -1 +1 @@ -__version__ = '0.16.0' +__version__ = '0.17.0' diff --git a/requirements.txt b/requirements.txt index 29a20a3..f344a4c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ -hypothesis<5 +hypothesis memory-profiler==0.57.0 psutil==5.7.0 pyperform -pytest<5 +pytest setuptools Sphinx sphinx-rtd-theme==0.1.5 diff --git a/setup.py b/setup.py index eaa0541..91ee24a 100644 --- a/setup.py +++ b/setup.py @@ -67,6 +67,7 @@ def build_extension(self, ext): 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: Implementation :: PyPy', ], test_suite='tests', diff --git a/tox.ini b/tox.ini index 95cb8ba..9e2036f 100644 --- a/tox.ini +++ b/tox.ini @@ -4,42 +4,43 @@ # and then run "tox" from this directory. [tox] -envlist = py35,py36,py37,memorytest36,doctest36,pypy3,coverage-py36 +envlist = py35,py36,py37,py38,memorytest38,doctest38,pypy3,coverage-py38 [testenv] commands = python {toxinidir}/setup.py test # Specifying the following tests like this is very non-DRY but I have no better solution right now. -[testenv:coverage-py36] +[testenv:coverage-py38] # Skip using C-extension to get coverage metrics on Python code. -basepython = python3.6 +basepython = python3.8 passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH setenv = PYRSISTENT_NO_C_EXTENSION = 1 -# Pin pytest version until https://github.com/pytest-dev/pytest-cov/pull/253 has been released -deps = pytest==4.0.2 - hypothesis<5 - pytest-cov - coveralls +deps = + pytest + hypothesis + pytest-cov + coveralls changedir = tests commands = py.test --cov=pyrsistent coveralls -[testenv:memorytest36] -basepython = python3.6 -deps = pytest - memory_profiler - psutil +[testenv:memorytest38] +basepython = python3.8 +deps = + pytest + memory_profiler + psutil changedir = . commands = python tests/memory_profiling.py -[testenv:doctest36] +[testenv:doctest38] # Need to disable the random hashing or all docs printing a map with more than # one item in it will be flaky. setenv = PYTHONHASHSEED=0 -basepython = python3.6 -deps = pytest < 5 +basepython = python3.8 +deps = pytest changedir = . commands = py.test --doctest-modules pyrsistent