diff options
author | Eric Lin <anselor@gmail.com> | 2020-08-06 14:45:55 -0400 |
---|---|---|
committer | anselor <anselor@gmail.com> | 2020-08-10 23:00:09 -0400 |
commit | 9d314de00100642679abda2cd5e7e0302cde9679 (patch) | |
tree | 3ab8965c096f6953ced2a0c82b28e89862cdb686 | |
parent | faaf79b695a4ee91634d166dd050d2a28bb65632 (diff) | |
download | cmd2-git-9d314de00100642679abda2cd5e7e0302cde9679.tar.gz |
Adding explicit python 3.5.3 test to nox, travis.
Copied 3.5.4 definition of typing.Deque
-rw-r--r-- | .travis.yml | 3 | ||||
-rw-r--r-- | CHANGELOG.md | 8 | ||||
-rw-r--r-- | cmd2/table_creator.py | 11 | ||||
-rw-r--r-- | noxfile.py | 2 |
4 files changed, 22 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml index 521c383c..aff51bcb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,9 @@ language: python matrix: include: - os: linux + python: 3.5.3 + env: NOXSESSION=tests-3.5.3 + - os: linux python: 3.5 env: NOXSESSION=tests-3.5 - os: linux diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ba8c53c..284c52d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 1.3.3 (TBD) +* Bug Fixes + * Added explicit testing against python 3.5.3 for Debian 9 support. + * Added fallback definition of typing.Deque (taken from 3.5.4) +* Other + * Added missing doc-string for new cmd2.Cmd __init__ parameters + introduced by CommandSet enhancement + ## 1.3.2 (August 10, 2020) * Bug Fixes * Fixed `prog` value of subcommands added with `as_subcommand_to()` decorator. diff --git a/cmd2/table_creator.py b/cmd2/table_creator.py index 8b9524a1..7a5c826c 100644 --- a/cmd2/table_creator.py +++ b/cmd2/table_creator.py @@ -22,8 +22,17 @@ try: except ImportError: # pragma: no cover import typing + # The following copied from the implementation of Deque in Python 3.5.4 # noinspection PyProtectedMember, PyUnresolvedReferences - Deque = typing._alias(deque, typing.T) + class Deque(deque, typing.MutableSequence[typing.T]): + __slots__ = () + __extra__ = deque + + def __new__(cls, *args, **kwds): + if typing._geqv(cls, Deque): + raise TypeError('Type Deque cannot be instantiated; use deque() instead') + return typing._generic_new(deque, cls, *args, **kwds) + # Constants EMPTY = '' @@ -14,7 +14,7 @@ def docs(session): '-d', '{}/doctrees'.format(tmpdir), '.', '{}/html'.format(tmpdir)) -@nox.session(python=['3.5', '3.6', '3.7', '3.8', '3.9']) +@nox.session(python=['3.5.3', '3.5', '3.6', '3.7', '3.8', '3.9']) @nox.parametrize('plugin', [None, 'ext_test', 'template', |