From ef1da6c96e8f614e88276e646c69256563cf6f69 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Wed, 8 May 2019 18:16:26 +0300 Subject: [PATCH 1/6] Travis script update to test demo.py against all Python versions --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7b1fc19..383a89e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,10 @@ os: - linux # Travis does not support Python on OSX or Windows. Should we migrate to a different CI service? python: - - 3.5 - - 3.6 - - 3.7-dev # TODO: Replace with plain "3.7" when supported by Travis -# - 3.8-dev # TODO: Compatibility issues with MyPy, see https://travis-ci.org/UAVCAN/pydsdl/jobs/519988157 + - '3.5' + - '3.6' + - '3.7-dev' # TODO: Replace with plain "3.7" when supported by Travis +# - '3.8-dev' # TODO: Compatibility issues with MyPy, see https://travis-ci.org/UAVCAN/pydsdl/jobs/519988157 before_script: - pip install -r requirements.txt @@ -18,4 +18,4 @@ script: - ./test.sh - coveralls # Publish the coverage stats online. - git clone https://github.com/UAVCAN/dsdl --branch=uavcan-v1.0 dsdl-test # TODO: Switch to master once v1.0 is merged - - ./demo.py dsdl-test/uavcan + - python ./demo.py dsdl-test/uavcan # Explicit "python" is needed to use the current Python version From 966f1e005da2852517307cc430a618d4d1f56b11 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Wed, 8 May 2019 18:19:48 +0300 Subject: [PATCH 2/6] Explicitly emitting the current Python version before testing --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 383a89e..08a5c99 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ before_script: - pip install coveralls # Intentionally removed from requirements.txt because it's only useful in the CI environment script: + - python --version - ./test.sh - coveralls # Publish the coverage stats online. - git clone https://github.com/UAVCAN/dsdl --branch=uavcan-v1.0 dsdl-test # TODO: Switch to master once v1.0 is merged From 7a2d36e9f0fde233edc7ad1ba9b87e0cfc06639f Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Wed, 8 May 2019 18:24:50 +0300 Subject: [PATCH 3/6] Explicitly testing against Py3.5.2 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 08a5c99..62ebeb3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ os: - linux # Travis does not support Python on OSX or Windows. Should we migrate to a different CI service? python: + - '3.5.2' # There have been compatibility issues with this patch version - '3.5' - '3.6' - '3.7-dev' # TODO: Replace with plain "3.7" when supported by Travis From f58290a1a92a0f50b48dbeade588680da57331cb Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Wed, 8 May 2019 18:30:45 +0300 Subject: [PATCH 4/6] Testing various versions of 3.5 --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 62ebeb3..6a925b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,9 @@ os: python: - '3.5.2' # There have been compatibility issues with this patch version + - '3.5.3' + - '3.5.4' + - '3.5.5' - '3.5' - '3.6' - '3.7-dev' # TODO: Replace with plain "3.7" when supported by Travis @@ -20,4 +23,4 @@ script: - ./test.sh - coveralls # Publish the coverage stats online. - git clone https://github.com/UAVCAN/dsdl --branch=uavcan-v1.0 dsdl-test # TODO: Switch to master once v1.0 is merged - - python ./demo.py dsdl-test/uavcan # Explicit "python" is needed to use the current Python version + - ./demo.py dsdl-test/uavcan From ac04d74612331b71eff05e95e0746a7f23f5af5b Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Wed, 8 May 2019 18:51:55 +0300 Subject: [PATCH 5/6] We no longer support Python 3.5.2 or older due to a problem with its Typing library, which is fixed in https://github.com/python/typing/pull/308. The fixed typing library ships with Python 3.5.3 and newer. --- .travis.yml | 5 +---- pydsdl/__init__.py | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6a925b1..cf35028 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,7 @@ os: - linux # Travis does not support Python on OSX or Windows. Should we migrate to a different CI service? python: - - '3.5.2' # There have been compatibility issues with this patch version - - '3.5.3' - - '3.5.4' - - '3.5.5' + - '3.5.3' # Oldest supported version - '3.5' - '3.6' - '3.7-dev' # TODO: Replace with plain "3.7" when supported by Travis diff --git a/pydsdl/__init__.py b/pydsdl/__init__.py index ac2ae30..ecf98d0 100644 --- a/pydsdl/__init__.py +++ b/pydsdl/__init__.py @@ -6,8 +6,30 @@ import os as _os import sys as _sys -if _sys.version_info[:2] < (3, 5): # pragma: no cover - print('A newer version of Python is required', file=_sys.stderr) +# The original intent was to support Python 3.5 and newer; however, we have discovered a bug in the static typing +# library in Python 3.5.2 which makes the library quite unusable: when importing, the typing module would throw +# "TypeError: This Callable type is already parameterized." from the expression module. The problem does not appear +# in Python 3.5.3 or any newer versions; it is fixed in the upstream here: https://github.com/python/typing/pull/308. +# This is how you can reproduce it in REPL; first, the correct behavior that can be observed in Python 3.5.3+: +# >>> import typing +# >>> T = typing.TypeVar('T') +# >>> G = typing.Callable[[], T] +# >>> G[int] +# typing.Callable[[], int] +# And this is what you get in Python 3.5.2-: +# >>> import typing +# >>> T = typing.TypeVar('T') +# >>> G = typing.Callable[[], T] +# >>> G[int] +# Traceback (most recent call last): +# File "", line 1, in +# File "/usr/lib/python3.5/typing.py", line 815, in __getitem__ +# raise TypeError("This Callable type is already parameterized.") +# TypeError: This Callable type is already parameterized. +_min_supported_python_version = 3, 5, 3 +if _sys.version_info[:3] < _min_supported_python_version: # pragma: no cover + print('This package requires a Python version', '.'.join(map(str, _min_supported_python_version)), 'or newer', + file=_sys.stderr) _sys.exit(1) __version__ = 0, 7, 3 From d8b6aba22ba79864d9590eec0f44154442b0d1dd Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Wed, 8 May 2019 18:52:28 +0300 Subject: [PATCH 6/6] Version bump to v0.8 --- pydsdl/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydsdl/__init__.py b/pydsdl/__init__.py index ecf98d0..9d7074c 100644 --- a/pydsdl/__init__.py +++ b/pydsdl/__init__.py @@ -32,7 +32,7 @@ file=_sys.stderr) _sys.exit(1) -__version__ = 0, 7, 3 +__version__ = 0, 8, 0 __license__ = 'MIT' # Our unorthodox approach to dependency management requires us to apply certain workarounds.