From 092cf237ddde244e11fef49a909fe8c7d0e97391 Mon Sep 17 00:00:00 2001 From: Hashem Nasarat Date: Tue, 13 Sep 2022 14:24:03 -0400 Subject: [PATCH 1/2] Move windows-curses dependency to an optional extra Python 3.11 wheels for windows-curses are [not yet available][1], and this meant that python-can could not be installed on windows with Python 3.11. Since windows-curses is only used in viewer.py, change the dependnecy to an optional extra. [1]: https://github.com/zephyrproject-rtos/windows-curses/issues/31 --- doc/installation.rst | 10 ++++++++++ setup.py | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/installation.rst b/doc/installation.rst index fe7204ba6..956f0286a 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -103,6 +103,16 @@ If ``python-can`` is already installed, the CANtact backend can be installed sep Additional CANtact documentation is available at `cantact.io `__. +CanViewer +~~~~~~~~~ + +``python-can`` has support for showing a simple CAN viewer terminal application +by running ``python -m can.viewer``. On Windows, this depends on the +`windows-curses library `__ which can +be installed with: + +``python3 -m pip install "python-can[viewer]"`` + Installing python-can in development mode ----------------------------------------- diff --git a/setup.py b/setup.py index c9defecab..adbd61f91 100644 --- a/setup.py +++ b/setup.py @@ -33,6 +33,9 @@ "gs_usb": ["gs_usb>=0.2.1"], "nixnet": ["nixnet>=0.3.1"], "pcan": ["uptime~=3.0.1"], + "viewer": [ + 'windows-curses;platform_system=="Windows" and platform_python_implementation=="CPython"' + ], } setup( @@ -86,7 +89,6 @@ install_requires=[ "setuptools", "wrapt~=1.10", - 'windows-curses;platform_system=="Windows" and platform_python_implementation=="CPython"', "typing_extensions>=3.10.0.0", 'pywin32;platform_system=="Windows" and platform_python_implementation=="CPython"', 'msgpack~=1.0.0;platform_system!="Windows"', From 9ca68548621e26b20fe0a9d6ac529f28d7b0930b Mon Sep 17 00:00:00 2001 From: zariiii9003 <52598363+zariiii9003@users.noreply.github.com> Date: Mon, 3 Oct 2022 15:42:22 +0200 Subject: [PATCH 2/2] change python3 to python for Windows --- doc/installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/installation.rst b/doc/installation.rst index 956f0286a..bfce72180 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -111,7 +111,7 @@ by running ``python -m can.viewer``. On Windows, this depends on the `windows-curses library `__ which can be installed with: -``python3 -m pip install "python-can[viewer]"`` +``python -m pip install "python-can[viewer]"`` Installing python-can in development mode -----------------------------------------