On 2025/03/18 07:36, Aaron Bieber wrote:
> 
> 
> On 3/17/25 11:55, Stuart Henderson wrote:
> > On 2025/03/17 16:51, open...@systemfailure.net wrote:
> > > On Monday, March 17th, 2025 at 11:56 AM, Stuart Henderson 
> > > <s...@spacehopper.org> wrote:
> > > 
> > > > On 2025/03/16 21:23, open...@systemfailure.net wrote:
> > > > 
> > > > > On 2025/03/14 14:13, Aaron Bieber aa...@bolddaemon.com wrote:
> > > > > 
> > > > > > Hi,
> > > > > > 
> > > > > > Here are updates to the Reticulum stack. Nomadnet runs fine for me.
> > > > > > 
> > > > > > I'll probably commit this today or tomorrow if I no one objects.
> > > > > > 
> > > > > > Cheers,
> > > > > > Aaron
> > > > > Hi, thanks for updating these ports.
> > > > > 
> > > > > py-rns-0.9.3 works fine, as far as I tested, but 'make test' fails: 
> > > > > see the attached log file.
> > > > > 
> > > > > Moreover, it would be very useful to include a README for people 
> > > > > wanting to use rnodeconf, since its usage on OpenBSD is not 
> > > > > documented anywhere. Patch attached.
> > > > > 
> > > > > Best regards.
> > > > 
> > > > Here's a tiny tweak to your Makefile diff (tabs not spaces), and fix
> > > > tests if cython is present when they're run.
> > > Thank you Stuart, 'make test' can now be run with your fix.
> > > 
> > > However, to make tests pass (at least most of them), I had to reintroduce 
> > > another fix you submitted previously (the "pre-test" trick), that was 
> > > forgotten by Aaron.
> > Ah yes, seems I had a /usr/local/bin/python lying around, probably
> > from last time I looked at this :)
> > 
> > > With the attached patch, all tests are passing except one - the one that 
> > > was already failing. The port is running fine anyway.
> > +pre-test:
> > +                       ln -s ${MODPY_BIN} ${WRKDIR}/bin/python
> > 
> > btw, usually just the one tab for instructions after targets like that.
> > (no need to send a new diff for that).
> > 
> > I took a look at adafruit-nrfutil, seems it is not really compatible
> > with Python 3.12, and it would be better to provide a port rather than
> > ask people to use pip. (Would probably make sense to have it as a
> > run dependency of py-rns so users don't have to mess about).
> > 
> > I've attached a first attempt at a port, there are patches to fix
> > problems I saw with 'adafruit-nrfutil keys'. I don't have hardware to
> > test any of the dfu bits.
> > 
> Tried flashing a T-Echo with rnodeconf - it errors with:
> 
> Traceback (most recent call last):
>   File "/usr/local/bin/rnodeconf", line 8, in <module>
>     sys.exit(main())
>              ^^^^^^
>   File "/usr/local/lib/python3.12/site-packages/RNS/Utilities/rnodeconf.py",
> line 1650, in main
>     if selected_port == None:
>        ^^^^^^^^^^^^^^^^^^^^^
>   File
> "/usr/local/lib/python3.12/site-packages/serial/tools/list_ports_common.py",
> line 74, in __eq__
>     return self.device == other.device
>                           ^^^^^^^^^^^^
> AttributeError: 'NoneType' object has no attribute 'device'
> 
> Seems our serial package is lacking something as the pip installed version
> works.
> 

Here's a diff for ease of testing - have sent separately to the maintainer.


Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/py-serial/Makefile,v
diff -u -p -r1.22 Makefile
--- Makefile    21 Dec 2024 11:40:10 -0000      1.22
+++ Makefile    18 Mar 2025 13:59:28 -0000
@@ -1,9 +1,8 @@
 COMMENT =              serial interface class for Python

-MODPY_DISTV =  3.4
+MODPY_DISTV =          3.5
 DISTNAME =             pyserial-${MODPY_DISTV}
 PKGNAME =              ${DISTNAME:S/py/py-/}
-REVISION =             8

 CATEGORIES =           devel

@@ -17,16 +16,15 @@ PERMIT_PACKAGE =    Yes
 MODULES =              lang/python
 MODPY_PI =             Yes
 MODPY_PYBUILD =                setuptools
+MODPY_PYTEST_ARGS =    -k 'not test_pty_serial_write and not 
test_pty_serial_read'

 DOCSDIR =              ${PREFIX}/share/doc/${MODPY_PY_PREFIX}serial
 EXAMPLESDIR =          ${PREFIX}/share/examples/${MODPY_PY_PREFIX}serial

 post-install:
-       cd ${PREFIX}/bin/ && mv miniterm.py miniterm-${MODPY_VERSION}.py
-       ${INSTALL_DATA_DIR} ${DOCSDIR}
-       ${INSTALL_DATA} ${WRKSRC}/README.rst ${WRKSRC}/LICENSE.txt ${DOCSDIR}
-       ${INSTALL_DATA} ${WRKSRC}/documentation/*.rst ${DOCSDIR}
-       ${INSTALL_DATA_DIR} ${EXAMPLESDIR}
+       ${INSTALL_DATA_DIR} ${DOCSDIR} ${EXAMPLESDIR}
+       cd ${WRKSRC}; ${INSTALL_DATA} README.rst LICENSE.txt \
+               documentation/*.rst ${DOCSDIR}
        ${INSTALL_DATA} ${WRKSRC}/examples/*.py ${EXAMPLESDIR}

 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/devel/py-serial/distinfo,v
diff -u -p -r1.4 distinfo
--- distinfo    11 May 2019 21:58:00 -0000      1.4
+++ distinfo    18 Mar 2025 13:59:28 -0000
@@ -1,2 +1,2 @@
-SHA256 (pyserial-3.4.tar.gz) = bi1AH97g6rmWz3NOZ3c6AUO5MncsqLQkUUQM/tlCxic=
-SIZE (pyserial-3.4.tar.gz) = 151657
+SHA256 (pyserial-3.5.tar.gz) = PHfgFBcN//vYFub/wgXphC77EL6fWOwW0+hnW0klzds=
+SIZE (pyserial-3.5.tar.gz) = 159125
Index: patches/patch-serial_tools_miniterm_py
===================================================================
RCS file: patches/patch-serial_tools_miniterm_py
diff -N patches/patch-serial_tools_miniterm_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-serial_tools_miniterm_py      18 Mar 2025 13:59:28 -0000
@@ -0,0 +1,23 @@
+change menu char; ^T is typically bound to send SIGINFO on OpenBSD
+
+Index: serial/tools/miniterm.py
+--- serial/tools/miniterm.py.orig
++++ serial/tools/miniterm.py
+@@ -402,7 +402,7 @@ class Miniterm(object):
+         self.filters = filters
+         self.update_transformations()
+         self.exit_character = unichr(0x1d)  # GS/CTRL+]
+-        self.menu_character = unichr(0x14)  # Menu: CTRL+T
++        self.menu_character = unichr(0x19)  # Menu: CTRL+Y
+         self.alive = None
+         self._reader_alive = None
+         self.receiver_thread = None
+@@ -926,7 +926,7 @@ def main(default_port=None, default_baudrate=9600, def
+         type=int,
+         metavar='NUM',
+         help='Unicode code of special character that is used to control 
miniterm (menu), default: %(default)s',
+-        default=0x14)  # Menu: CTRL+T
++        default=0x19)  # Menu: CTRL+T
+
+     group = parser.add_argument_group('diagnostics')
+
Index: patches/patch-test_test_pty_py
===================================================================
RCS file: patches/patch-test_test_pty_py
diff -N patches/patch-test_test_pty_py
--- patches/patch-test_test_pty_py      11 Mar 2022 18:52:55 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,41 +0,0 @@
-Some pty tests hang
-
-Index: test/test_pty.py
---- test/test_pty.py.orig
-+++ test/test_pty.py
-@@ -32,21 +32,21 @@ class Test_Pty_Serial_Open(unittest.TestCase):
-         with serial.Serial(os.ttyname(self.slave), timeout=1) as slave:
-             pass  # OK
-
--    def test_pty_serial_write(self):
--        with serial.Serial(os.ttyname(self.slave), timeout=1) as slave:
--            with os.fdopen(self.master, "wb") as fd:
--                fd.write(DATA)
--                fd.flush()
--                out = slave.read(len(DATA))
--                self.assertEqual(DATA, out)
-+    # ~def test_pty_serial_write(self):
-+        # ~with serial.Serial(os.ttyname(self.slave), timeout=1) as slave:
-+            # ~with os.fdopen(self.master, "wb") as fd:
-+                # ~fd.write(DATA)
-+                # ~fd.flush()
-+                # ~out = slave.read(len(DATA))
-+                # ~self.assertEqual(DATA, out)
-
--    def test_pty_serial_read(self):
--        with serial.Serial(os.ttyname(self.slave), timeout=1) as slave:
--            with os.fdopen(self.master, "rb") as fd:
--                slave.write(DATA)
--                slave.flush()
--                out = fd.read(len(DATA))
--                self.assertEqual(DATA, out)
-+    # ~def test_pty_serial_read(self):
-+        # ~with serial.Serial(os.ttyname(self.slave), timeout=1) as slave:
-+            # ~with os.fdopen(self.master, "rb") as fd:
-+                # ~slave.write(DATA)
-+                # ~slave.flush()
-+                # ~out = fd.read(len(DATA))
-+                # ~self.assertEqual(DATA, out)
-
-     #~ def test_pty_serial_master_read(self):
-         #~ with serial.Serial(os.ttyname(self.master), timeout=1) as master:
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/py-serial/pkg/PLIST,v
diff -u -p -r1.7 PLIST
--- pkg/PLIST   21 Dec 2024 11:40:10 -0000      1.7
+++ pkg/PLIST   18 Mar 2025 13:59:28 -0000
@@ -1,17 +1,21 @@
 @pkgpath devel/py-serial,python3
-@conflict py-serial-*
-bin/miniterm-${MODPY_VERSION}.py
+bin/pyserial-miniterm
+bin/pyserial-ports
 lib/python${MODPY_VERSION}/site-packages/pyserial-${MODPY_DISTV}.dist-info/
 
lib/python${MODPY_VERSION}/site-packages/pyserial-${MODPY_DISTV}.dist-info/LICENSE.txt
 
lib/python${MODPY_VERSION}/site-packages/pyserial-${MODPY_DISTV}.dist-info/METADATA
 
lib/python${MODPY_VERSION}/site-packages/pyserial-${MODPY_DISTV}.dist-info/RECORD
 
lib/python${MODPY_VERSION}/site-packages/pyserial-${MODPY_DISTV}.dist-info/WHEEL
+lib/python${MODPY_VERSION}/site-packages/pyserial-${MODPY_DISTV}.dist-info/entry_points.txt
 
lib/python${MODPY_VERSION}/site-packages/pyserial-${MODPY_DISTV}.dist-info/top_level.txt
 lib/python${MODPY_VERSION}/site-packages/serial/
 lib/python${MODPY_VERSION}/site-packages/serial/__init__.py
+lib/python${MODPY_VERSION}/site-packages/serial/__main__.py
 
${MODPY_COMMENT}lib/python${MODPY_VERSION}/site-packages/serial/${MODPY_PYCACHE}/
 
lib/python${MODPY_VERSION}/site-packages/serial/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
 
lib/python${MODPY_VERSION}/site-packages/serial/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/serial/${MODPY_PYCACHE}__main__.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
+lib/python${MODPY_VERSION}/site-packages/serial/${MODPY_PYCACHE}__main__.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/serial/${MODPY_PYCACHE}rfc2217.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
 
lib/python${MODPY_VERSION}/site-packages/serial/${MODPY_PYCACHE}rfc2217.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/serial/${MODPY_PYCACHE}rs485.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
@@ -76,23 +80,23 @@ lib/python${MODPY_VERSION}/site-packages
 
lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}protocol_alt.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
 
lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}protocol_alt.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}protocol_cp2110.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
+lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}protocol_cp2110.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}protocol_hwgrep.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
 
lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}protocol_hwgrep.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}protocol_loop.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
 
lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}protocol_loop.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}protocol_rfc2217.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
 
lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}protocol_rfc2217.${MODPY_PYC_MAGIC_TAG}pyc
-lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}protocol_serve-rfc2217.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
-lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}protocol_serve-rfc2217.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}protocol_socket.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
 
lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}protocol_socket.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}protocol_spy.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION}
 
lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/${MODPY_PYCACHE}protocol_spy.${MODPY_PYC_MAGIC_TAG}pyc
 lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/protocol_alt.py
+lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/protocol_cp2110.py
 lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/protocol_hwgrep.py
 lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/protocol_loop.py
 lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/protocol_rfc2217.py
-lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/protocol_serve-rfc2217.py
 lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/protocol_socket.py
 lib/python${MODPY_VERSION}/site-packages/serial/urlhandler/protocol_spy.py
 lib/python${MODPY_VERSION}/site-packages/serial/win32.py

Reply via email to