Sync from SUSE:SLFO:Main python-pyserial revision 0b490081e56a3fe4990cb297bd1ee12b

This commit is contained in:
Adrian Schröter 2024-05-03 22:17:21 +02:00
commit 85edbeea54
4 changed files with 552 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

BIN
pyserial-3.5.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

412
python-pyserial.changes Normal file
View File

@ -0,0 +1,412 @@
-------------------------------------------------------------------
Sun Apr 23 23:19:35 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Switch documentation to be within the main package.
-------------------------------------------------------------------
Fri Apr 21 12:31:20 UTC 2023 - Dirk Müller <dmueller@suse.com>
- add sle15_python_module_pythons (jsc#PED-68)
-------------------------------------------------------------------
Thu Apr 13 22:43:56 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Make calling of %{sle15modernpython} optional.
-------------------------------------------------------------------
Wed Jan 20 08:06:12 UTC 2021 - Adrian Schröter <adrian@suse.de>
- update to version 3.5:
New Features:
[#411] Add a backend for Silicon Labs CP2110/4 HID-to-UART bridge. (depends on hid module)
Improvements:
[#315] Use absolute import everywhere
[#354] Make ListPortInfo hashable
[#372] threaded: "write" returns byte count
[#400] Add bytesize and stopbits argument parser to tcp_serial_redirect
[#408] loop: add out_waiting
[#495] list_ports_linux: Correct "interface" property on Linux hosts
[#500] Remove Python 3.2 and 3.3 from test
[#261, #285, #296, #320, #333, #342, #356, #358, #389, #397, #510] doc updates
miniterm: add CTRL+T Q as alternative to exit
miniterm: suspend function key changed to CTRL-T Z
add command line tool entries pyserial-miniterm (replaces miniterm.py) and pyserial-ports (runs serial.tools.list_ports).
python -m serial opens miniterm (use w/o args and it will print port list too) [experimental]
Bugfixes:
[#371] Don't open port if self.port is not set while entering context manager
[#437, #502] refactor: raise new instances for PortNotOpenError and SerialTimeoutException
[#261, #263] list_ports: set default name attribute
[#286] fix: compare only of the same type in list_ports_common.ListPortInfo
rfc2217/close(): fix race-condition
[#305] return b'' when connection closes on rfc2217 connection
[#386] rfc2217/close(): fix race condition
Fixed flush_input_buffer() for situations where the remote end has closed the socket.
[#441] reset_input_buffer() can hang on sockets
examples: port_publisher python 3 fixes
[#324] miniterm: Fix miniterm constructor exit_character and menu_character
[#326] miniterm: use exclusive access for native serial ports by default
[#497] miniterm: fix double use of CTRL-T + s use z for suspend instead
[#443, #444] examples: refactor wx example, use Bind to avoid deprecated warnings, IsChecked, unichr
[#265] posix: fix PosixPollSerial with timeout=None and add cancel support
[#290] option for low latency mode on linux
[#335] Add support to xr-usb-serial ports
[#494] posix: Don't catch the SerialException we just raised
[#519] posix: Fix custom baud rate to not temporarily set 38400 baud rates on linux
[#509 #518] list_ports: use hardcoded path to library on osx
[#542] list_ports_osx: kIOMasterPortDefault no longer exported on Big Sur
[#545, #545] list_ports_osx: getting USB info on BigSur/AppleSilicon
-------------------------------------------------------------------
Mon Apr 15 06:44:21 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Remove unnecessary Windows and OSX modules from runtime package
- Remove Mono and Java CLI modules from runtime package
- Activate test suite
- Fix fdupes, hashbangs and executable bits
- Remove non-break-space in python-pyserial.changes with normal space
-------------------------------------------------------------------
Tue Dec 4 12:52:50 UTC 2018 - Matej Cepl <mcepl@suse.com>
- Remove superfluous devel dependency for noarch package
-------------------------------------------------------------------
Mon Aug 7 16:32:29 UTC 2017 - toddrme2178@gmail.com
- Further fix shebangs
-------------------------------------------------------------------
Sun Aug 6 18:07:57 UTC 2017 - toddrme2178@gmail.com
- Update to version 3.4
+ Improvements:
* miniterm: suspend function (temporarily release port, :kbd:`Ctrl-T s`)
* [#240] context manager automatically opens port on ``__enter__``
* [#141] list_ports: add interface number to location string
* [#225] protocol_socket: Retry if ``BlockingIOError`` occurs in
``reset_input_buffer``.
+ Bugfixes:
* [#153] list_ports: option to include symlinked devices
* [#237] list_ports: workaround for special characters in port names
+ Bugfixes (posix):
* allow calling cancel functions w/o error if port is closed
* [#220] protocol_socket: sync error handling with posix version
* [#227] posix: ignore more blocking errors and EINTR, timeout only
applies to blocking I/O
* [#228] fix: port_publisher typo
- Fix shebangs
-------------------------------------------------------------------
Wed Jun 21 13:47:02 UTC 2017 - bwiedemann@suse.com
- Do not include unneccessary undeterministic environment.pickle in package to fix build-compare
-------------------------------------------------------------------
Thu Apr 6 18:13:45 UTC 2017 - toddrme2178@gmail.com
- Update to Version 3.3 2017-03-08
+ Improvements:
* [#206] Exclusive access on POSIX. ``exclusive`` flag added.
* [#172] list_ports_windows: list_ports with 'manufacturer' info property
* [#174] miniterm: change cancel impl. for console
* [#182] serialutil: add overall timeout for read_until
* socket: use non-blocking socket and new Timeout class
* socket: implement a functional a reset_input_buffer
* rfc2217: improve read timeout implementation
* win32: include error message from system in ClearCommError exception
* and a few minor changes, docs
+ Bugfixes:
* [#183] rfc2217: Fix broken calls to to_bytes on Python3.
* [#188] rfc2217: fix auto-open use case when port is given as parameter
+ Bugfixes (posix):
* [#178] in read, count length of converted data
* [#189] fix return value of write
+ Bugfixes (win32):
* [#194] spurious write fails with ERROR_SUCCESS
- Update to Version 3.2.1
+ Improvements:
* remove ``serial.aio`` in favor of separate package, ``pyserial-asyncio``
* add client mode to example ``tcp_serial_redirect.py``
* use of monotonic clock for timeouts, when available (Python 3.3 and up)
* [#169] arbitrary baud rate support for BSD family
* improve tests, improve ``loop://``
+ Bugfixes:
* [#137] Exception while cancel in miniterm (python3)
* [#143] Class Serial in protocol_loop.py references variable before assigning
to it
* [#149] Python 3 fix for threaded.FramedPacket
+ Bugfixes (posix):
* [#133] _update_dtr_state throws Inappropriate ioctl for virtual serial
port created by socat on OS X
* [#157] Broken handling of CMSPAR in serialposix.py
+ Bugfixes (win32):
* [#144] Use Unicode API for list_ports
* [#145] list_ports_windows: support devices with only VID
* [#162] Write in non-blocking mode returns incorrect value on windows
- Update to Version 3.2.0
+ See 3.2.1, this one missed a merge request related to removing aio.
- Update to Version 3.1.1
+ Improvements:
* deprecate ``nonblocking()`` method on posix, the port is already in this
mode.
* style: use .format() in various places instead of "%" formatting
+ Bugfixes:
* [#122] fix bug in FramedPacket
* [#127] The Serial class in the .NET/Mono (IronPython) backend does not
implement the _reconfigure_port method
* [#123, #128] Avoid Python 3 syntax in aio module
+ Bugfixes (posix):
* [#126] PATCH: Check delay_before_tx/rx for None in serialposix.py
* posix: retry if interrupted in Serial.read
+ Bugfixes (win32):
* win32: handle errors of GetOverlappedResult in read(), fixes #121
- Update to Version 3.1.0
+ Improvements:
* improve error handling in ``alt://`` handler
* ``socket://`` internally used select, improves timeout behavior
* initial state of RTS/DTR: ignore error when setting on open posix
(support connecting to pty's)
* code style updates
* posix: remove "number_to_device" which is not called anymore
* add cancel_read and cancel_write to win32 and posix implementations
+ Bugfixes:
* [#68] aio: catch errors and close connection
* [#87] hexlify: update codec for Python 2
* [#100] setPort not implemented
* [#101] bug in serial.threaded.Packetizer with easy fix
* [#104] rfc2217 and socket: set timeout in create_connection
* [#107] miniterm.py fails to exit on failed serial port
+ Bugfixes (posix):
* [#59] fixes for RTS/DTR handling on open
* [#77] list_ports_osx: add missing import
* [#85] serialposix.py _set_rs485_mode() tries to read non-existing
rs485_settings.delay_rts_before_send
* [#96] patch: native RS485 is never enabled
+ Bugfixes (win32):
* fix bad super call and duplicate old-style __init__ call
* [#80] list_ports: Compatibility issue between Windows/Linux
- Implement single-spec version.
-------------------------------------------------------------------
Mon Aug 15 14:51:56 UTC 2016 - toddrme2178@gmail.com
- Fix update-alternatives implementation.
- Split documentation into subpackage.
-------------------------------------------------------------------
Fri May 20 17:05:24 UTC 2016 - toddrme2178@gmail.com
- update to version 3.0.1:
* special case for FDTIBUS in list_ports on win32
* "Serial" keyword arguments, more on backward compatibility, fix
#55
* list_ports: return name if product is None, fix for #54
* port_publisher: restore some sorting of ports
- update to version 3.0:
* minor fixes to setup.py (file list), inter_byte_timeout (not
stored when passed to __init__), rfc2217 (behavior of close when
open failed), list_ports (__str__), loop://, renamed ReaderThread
* hwgrep:// added options to pick n'th port, skip busy ports
* miniterm: --ask option added
* Bugfixes (posix):
+ [#26/#30] always call tcsettattr on open
+ [#42] fix disregard read timeout if there is more data
+ [#45] check for write timeout, even if EAGAIN was rised
* Bugfixes (win32):
+ [#27] fix race condition in "read()", fix minimal timeout issue
+ race condition in nonblocking case
+ [#49] change exception type in case SetCommState fails
+ [#50] fixed issue with 0 timeout on windows 10
- changes from version 3.0b1:
* list_ports: add "vid", "pid", "serial_number", "product",
"manufacturer" and "location" attribute for USB devices.
* list_ports: update OSX implementation.
* list_ports: Raspberry Pi: internal port is found.
* serial_for_url: fix import (multiple packages in list)
* threaded: added new module implementing a reader thread
* tweak examples/wx*
* posix: add experimental implementation "VTIMESerial"
* new URL handler "alt://" to select alternative implementations
- changes from version 3.0a0:
* Starting from this release, only Python 2.7 and 3.2 (or newer) are
supported. The source code is compatible to the 2.x and 3.x series
without any changes. The support for earlier Python versions than
2.7 is removed, please refer to the pyserial-legacy (V2.x) series
if older Python versions are a requirement).
* Development moved to github, update links in docs.
* API changes: properties for "rts", "dtr", "cts", "dsr", "cd",
"ri", "in_waiting" (instead of get/set functions)
* remove file "FileLike" class, add "read_until" and "iread_until"
to "SerialBase"
* RS485 support changed ("rts_toggle" removed, added "serial.rs485"
module and "rs485_mode" property)
* "socket://" and "rfc2217://" handlers use the IPv6 compatible
"socket.create_connection"
* New URL handler: "spy:://".
* URL handlers now require the proper format ("?" and "&") for
arguments instead of "/"
(e.g. "rfc2217://localhost:7000?ign_set_control&timeout=5.5")
* Remove obsolete examples.
* Finish update to BSD license.
* Use setuptools if available, fall back to distutils if
unavailable.
* miniterm: changed command line options
* miniterm: support encodings on serial port
* miniterm: new transformations, by default escape/convert all
control characters
* list_ports: improved, added USB location (Linux, Win32)
* refactored code
* [FTR pyserial:37] Support fileno() function in the socket protocol
* Posix: [Patch pyserial:31] Mark/space parity on Linux
* Linux: [Patch pyserial:32] Module list_ports for linux should
include the product information as description.
* Java: fix 2 bugs (stop bits if/else and non-integer timeouts)
(Torsten Roemer)
* Update wxSerialConfigDialog.py to use serial.tools.list_ports.
* [Patch pyserial:34] Improvements to port_publisher.py example
* [Feature pyserial:39] Support BlueTooth serial port discovery on
Linux
* Bugfixes:
+ [Bug pyserial:157] Implement inWaiting in protocol_socket
+ [Bug pyserial:166] RFC2217 connections always fail
+ [Bug pyserial:172] applySettingsDict() throws an error if the
settings dictionary is not complete
+ [Bug pyserial:185] SocketSerial.read() never returns data when
timeout==0
* Bugfixes (posix):
+ [Bug pyserial:156] PosixSerial.open raises OSError rather than
SerialException when port open fails
+ [Bug pyserial:163] serial.tools.list_ports.grep() fails if it
encounters None type
+ fix setXON
+ [Patch pyserial:36 / 38] Make USB information work in python 3.4
and 2.7
+ clear OCRNL/ONLCR flags (CR/LF translation settings)
+ [Feature pyserial:38] RS485 Support
+ [Bug pyserial:170] list_ports_posix not working properly for
Cygwin
+ [Bug pyserial:187] improve support for FreeBSD
(list_ports_posix)
* Bugfixes (win32):
+ [Bug pyserial:169] missing "import time" in serialwin32.py
* Bugfixes (cli):
+ [Bug pyserial:159] write() in serialcli.py not working with
IronPython 2.7.4
- specfile:
* update copyright year
* updated url (moved to github)
* use setuptools
* CHANGES.txt -> CHANGES.rst
* README.txt -> README.rst
* Implement update-alternatives
-------------------------------------------------------------------
Sun Nov 24 21:04:55 UTC 2013 - p.drouand@gmail.com
- Update to version 2.7
+ Win32: setRTS and setDTR can be called before the port is opened and it will
set the initial state on port open.
+ Posix: add platform specific method: outWaiting (already present for Win32)
+ Posix: rename flowControl to setXON to match name on Win32, add
flowControlOut function
+ rfc2217: zero polls value (baudrate, data size, stop bits, parity)
+ Posix: [Patch pyserial:28] Accept any speed on Linux [update]
+ Posix: [Patch pyserial:29] PosixSerial.read() should "ignore" errno.EINTR
+ OSX: [Patch pyserial:27] Scan by VendorID/Product ID for USB Serial devices
+ Ensure working with bytes in write() calls
+ [Bug 3540332] SerialException not returned
+ [Bug pyserial:145] Error in socket_connection.py
+ [Bug pyserial:135] reading from socket with timeout=None causes TypeError
+ [Bug pyserial:130] setup.py should not append py3k to package name
+ [Bug pyserial:117] no error on lost conn w/socket://
+ [Patch 3462364] Fix: NameError: global name 'base' is not defined
+ list_ports and device() for BSD updated (Anders Langworthy)
+ [Bug 3518380] python3.2 +m serial.tools.list_ports error
+ [Bug pyserial:137] Patch to add non +standard baudrates to Cygwin
+ [Bug pyserial:141] open: Pass errno from IOError to SerialException
+ [Bug pyserial:125] Undefined 'base' on list_ports_posix.py, function usb_lsusb
+ [Bug pyserial:151] Serial.write() without a timeout uses 100% CPU on POSIX
+ [Patch pyserial:30] [PATCH 1/1] serial.Serial() should not raise IOError
+ [Bug 3444941] ctypes.WinError() unicode error
+ [Bug 3550043] on Windows in tools global name 'GetLastError' is not defined
+ [Bug pyserial:146] flush() does nothing in windows (despite docs)
+ [Bug pyserial:144] com0com ports ignored due to missing "friendly name"
+ [Bug pyserial:152] Cannot configure port, some setting was wrong. Can leave
port handle open but port not accessible
-------------------------------------------------------------------
Wed Apr 24 04:16:24 UTC 2013 - highwaystar.ru@gmail.com
- update to 2.6 version
* Moved some of the examples to serial.tools so that they can be
used with ``python -m``
* serial port enumeration now included as ``serial.tools.list_ports``
* URL handers for ``serial_for_url`` are now imported dynamically.
This allows to add protocols w/o editing files. The list
``serial.protocol_handler_packages`` can be used to add or remove
user packages with protocol handlers (see docs for details).
* new URL type: hwgrep://<regexp> uses list_ports module to search
for ports by their description
* serveral internal changes to improve Python 3.x compatibility
(setup.py, use of absolute imports and more)
* [Bug 3093882] calling open() on an already open port now
raises an exception
* [Bug 3245627] connection-lost let rfc2217 hangs in closed loop
* [Patch 3147043] readlines() to support multi-character eol
* [Patch 3316943] Avoid unneeded termios.tcsetattr calls in serialposix.py
* [Patch 2912349] Serial Scan as a Module with Mac Support
-------------------------------------------------------------------
Tue Sep 6 15:23:26 UTC 2011 - saschpe@suse.de
- Renamed to python-pyserial (from python-serial)
- Fixed mon-executable scripts and wrong EOL encoding rpmlint issues
-------------------------------------------------------------------
Mon Oct 11 10:18:45 UTC 2010 - coolo@novell.com
- update to 2.5
* python 3 compatibility
* many bugfixes and features, see CHANGES.txt
-------------------------------------------------------------------
Wed Aug 12 20:04:41 CEST 2009 - matejcik@suse.cz
- build as noarch on newer distros
-------------------------------------------------------------------
Fri Sep 12 14:28:26 CEST 2008 - matejcik@suse.cz
- update to 2.4
* iterator interface
* inter-character timeout
* support for Jython and IronPython
* bugfixes
-------------------------------------------------------------------
Tue Feb 28 16:46:03 CET 2006 - jmatejek@suse.cz
- updated to reflect python changes due to #149809
-------------------------------------------------------------------
Wed Jan 25 21:40:51 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Thu Oct 6 16:22:18 CEST 2005 - matejcik@suse.cz
- update to 2.2
-------------------------------------------------------------------
Tue Nov 30 11:56:48 CET 2004 - mcihar@suse.cz
- spec file cleanup
-------------------------------------------------------------------
Wed Aug 25 22:36:00 CEST 2004 - garloff@suse.de
- Initial creation of package python-serial (pyserial).

114
python-pyserial.spec Normal file
View File

@ -0,0 +1,114 @@
#
# spec file for package python-pyserial
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
Name: python-pyserial
Version: 3.5
Release: 0
Summary: Python Serial Port Extension
License: Python-2.0
Group: Development/Languages/Python
URL: https://github.com/pyserial/pyserial
Source: https://files.pythonhosted.org/packages/source/p/pyserial/pyserial-%{version}.tar.gz
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python3-Sphinx
Requires(post): update-alternatives
Requires(preun):update-alternatives
Provides: python-serial = %{version}
Obsoletes: python-serial < %{version}
BuildArch: noarch
%python_subpackages
%description
Python Serial Port Extension for Win32, Linux, BSD, Jython, IronPython
%if 0%{?suse_version} > 1500
%package -n %{name}-doc
Summary: Documentation for %{name}
Group: Documentation/Other
Provides: python2-pyserial-doc = %{version}
Provides: python3-pyserial-doc = %{version}
%description -n %{name}-doc
Documentation, examples, and help files for %{name}.
%endif
%prep
%setup -q -n pyserial-%{version}
# Unnecessary
rm serial/tools/list_ports_windows.py \
serial/tools/list_ports_osx.py \
serial/win32.py \
serial/serialwin32.py
# Requires .Net/IronPython, and especially System.IO.Ports which is troublesome
rm serial/serialcli.py
# Requires Jython with JavaComm
rm serial/serialjava.py
find serial -type f -not -name 'miniterm.py' -exec sed -i '1{/#!/d}' {} +
find serial -type f -not -name 'miniterm.py' -exec chmod a-x {} +
touch test/__init__.py
%build
%python_build
make %{?_smp_mflags} -C documentation html && rm documentation/_build/html/.buildinfo # Build HTML documentation
sed -i -e "1{s|^#![[:space:]]*\/.*bin.*$|#!%{_bindir}/python3|}" examples/*.py
%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/pyserial-miniterm
%python_clone -a %{buildroot}%{_bindir}/pyserial-ports
rm documentation/_build/doctrees/environment.pickle
%{python_expand sed -i '1{/#!/d}' %{buildroot}%{$python_sitelib}/serial/tools/miniterm.py
%fdupes %{buildroot}%{$python_sitelib}
}
%check
%python_exec test/run_all_tests.py
%post
%python_install_alternative pyserial-miniterm
%python_install_alternative pyserial-ports
%preun
%python_uninstall_alternative pyserial-miniterm
%python_uninstall_alternative pyserial-ports
%files %{python_files}
%license LICENSE.txt
%doc CHANGES.rst README.rst
%python_alternative pyserial-miniterm
%python_alternative pyserial-ports
%{python_sitelib}/serial/
%{python_sitelib}/pyserial-%{version}-py*.egg-info
%if 0%{?suse_version} > 1500
%files -n %{name}-doc
%endif
%doc examples/
%doc documentation/_build/*
%changelog