tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

py-dulwich: python3 compatibility fix



Hi all,

I had trouble using wip/py-hg-git, updating py-dulwich did not work, so
I patched it.

I am new to the python ecosystem, so I would appreciate if someone
reviewed the one liner patch added at the very bottom of the patch.

Thanks.
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/py-dulwich/Makefile,v
retrieving revision 1.36
diff -u -r1.36 Makefile
--- Makefile	27 Apr 2020 10:18:53 -0000	1.36
+++ Makefile	26 Dec 2020 11:03:56 -0000
@@ -1,6 +1,6 @@
 # $NetBSD: Makefile,v 1.36 2020/04/27 10:18:53 adam Exp $
 
-DISTNAME=	dulwich-0.19.16
+DISTNAME=	dulwich-0.20.15
 PKGNAME=	${PYPKGPREFIX}-${DISTNAME}
 CATEGORIES=	devel python
 MASTER_SITES=	${MASTER_SITE_PYPI:=d/dulwich/}
Index: PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/devel/py-dulwich/PLIST,v
retrieving revision 1.17
diff -u -r1.17 PLIST
--- PLIST	27 Apr 2020 10:18:53 -0000	1.17
+++ PLIST	26 Dec 2020 11:03:56 -0000
@@ -1,12 +1,7 @@
-@comment $NetBSD: PLIST,v 1.17 2020/04/27 10:18:53 adam Exp $
+@comment $NetBSD$
 bin/dul-receive-pack-${PYVERSSUFFIX}
 bin/dul-upload-pack-${PYVERSSUFFIX}
 bin/dulwich-${PYVERSSUFFIX}
-${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
-${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
-${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
-${PYSITELIB}/${EGG_INFODIR}/requires.txt
-${PYSITELIB}/${EGG_INFODIR}/top_level.txt
 ${PYSITELIB}/docs/tutorial/conclusion.txt
 ${PYSITELIB}/docs/tutorial/encoding.txt
 ${PYSITELIB}/docs/tutorial/file-format.txt
@@ -17,6 +12,12 @@
 ${PYSITELIB}/docs/tutorial/remote.txt
 ${PYSITELIB}/docs/tutorial/repo.txt
 ${PYSITELIB}/docs/tutorial/tag.txt
+${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
+${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
+${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
+${PYSITELIB}/${EGG_INFODIR}/entry_points.txt
+${PYSITELIB}/${EGG_INFODIR}/requires.txt
+${PYSITELIB}/${EGG_INFODIR}/top_level.txt
 ${PYSITELIB}/dulwich/__init__.py
 ${PYSITELIB}/dulwich/__init__.pyc
 ${PYSITELIB}/dulwich/__init__.pyo
@@ -29,6 +30,12 @@
 ${PYSITELIB}/dulwich/archive.py
 ${PYSITELIB}/dulwich/archive.pyc
 ${PYSITELIB}/dulwich/archive.pyo
+${PYSITELIB}/dulwich/bundle.py
+${PYSITELIB}/dulwich/bundle.pyc
+${PYSITELIB}/dulwich/bundle.pyo
+${PYSITELIB}/dulwich/cli.py
+${PYSITELIB}/dulwich/cli.pyc
+${PYSITELIB}/dulwich/cli.pyo
 ${PYSITELIB}/dulwich/client.py
 ${PYSITELIB}/dulwich/client.pyc
 ${PYSITELIB}/dulwich/client.pyo
@@ -72,6 +79,9 @@
 ${PYSITELIB}/dulwich/file.py
 ${PYSITELIB}/dulwich/file.pyc
 ${PYSITELIB}/dulwich/file.pyo
+${PYSITELIB}/dulwich/graph.py
+${PYSITELIB}/dulwich/graph.pyc
+${PYSITELIB}/dulwich/graph.pyo
 ${PYSITELIB}/dulwich/greenthreads.py
 ${PYSITELIB}/dulwich/greenthreads.pyc
 ${PYSITELIB}/dulwich/greenthreads.pyo
@@ -120,6 +130,7 @@
 ${PYSITELIB}/dulwich/protocol.py
 ${PYSITELIB}/dulwich/protocol.pyc
 ${PYSITELIB}/dulwich/protocol.pyo
+${PYSITELIB}/dulwich/py.typed
 ${PYSITELIB}/dulwich/reflog.py
 ${PYSITELIB}/dulwich/reflog.pyc
 ${PYSITELIB}/dulwich/reflog.pyo
@@ -254,6 +265,9 @@
 ${PYSITELIB}/dulwich/tests/test_blackbox.py
 ${PYSITELIB}/dulwich/tests/test_blackbox.pyc
 ${PYSITELIB}/dulwich/tests/test_blackbox.pyo
+${PYSITELIB}/dulwich/tests/test_bundle.py
+${PYSITELIB}/dulwich/tests/test_bundle.pyc
+${PYSITELIB}/dulwich/tests/test_bundle.pyo
 ${PYSITELIB}/dulwich/tests/test_client.py
 ${PYSITELIB}/dulwich/tests/test_client.pyc
 ${PYSITELIB}/dulwich/tests/test_client.pyo
@@ -272,6 +286,9 @@
 ${PYSITELIB}/dulwich/tests/test_grafts.py
 ${PYSITELIB}/dulwich/tests/test_grafts.pyc
 ${PYSITELIB}/dulwich/tests/test_grafts.pyo
+${PYSITELIB}/dulwich/tests/test_graph.py
+${PYSITELIB}/dulwich/tests/test_graph.pyc
+${PYSITELIB}/dulwich/tests/test_graph.pyo
 ${PYSITELIB}/dulwich/tests/test_greenthreads.py
 ${PYSITELIB}/dulwich/tests/test_greenthreads.pyc
 ${PYSITELIB}/dulwich/tests/test_greenthreads.pyo
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/devel/py-dulwich/distinfo,v
retrieving revision 1.33
diff -u -r1.33 distinfo
--- distinfo	27 Apr 2020 10:18:53 -0000	1.33
+++ distinfo	26 Dec 2020 11:03:56 -0000
@@ -1,6 +1,7 @@
 $NetBSD: distinfo,v 1.33 2020/04/27 10:18:53 adam Exp $
 
-SHA1 (dulwich-0.19.16.tar.gz) = 9387f567e10f540c1abfa7ae9d97a0dd290e61a5
-RMD160 (dulwich-0.19.16.tar.gz) = 3aa193d26c22c45e9ac3d07258f9a97e303cc503
-SHA512 (dulwich-0.19.16.tar.gz) = eb550691520733c0f4198abef62418c5e0cf42691ffbf031f8ec7953e26bd020ab8b195a64e75ca03a22f0e8c4b16fbaf36648da08d410474ec0cc653084dc24
-Size (dulwich-0.19.16.tar.gz) = 375483 bytes
+SHA1 (dulwich-0.20.15.tar.gz) = 66591f7e9b340385fd2eb1eeee0582e388808f03
+RMD160 (dulwich-0.20.15.tar.gz) = e6ab15e49bdfe342bda1533297ad02a109ad54ae
+SHA512 (dulwich-0.20.15.tar.gz) = a4e746099a90ea2d7eb5f0309508a4f625d41732bdda78997fab07b38ea2ecbd2c2aed08c8ef05b1b73fe3e2ba9b8c8cbf02270f8edbc6235d66cdee0317365c
+Size (dulwich-0.20.15.tar.gz) = 391841 bytes
+SHA1 (patch-dulwich_client.py) = 330bbd5311652520e3bd5ff8f6e3b3c4f9ac6c04
Index: patches/patch-dulwich_client.py
===================================================================
RCS file: patches/patch-dulwich_client.py
diff -N patches/patch-dulwich_client.py
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-dulwich_client.py	26 Dec 2020 11:03:56 -0000
@@ -0,0 +1,20 @@
+$NetBSD$
+
+python3 compatibility. seen when running py38-hg-git:
+    hg clone git://some-git-server/repo repo
+
+  File "/usr/pkg/lib/python3.8/site-packages/dulwich/client.py", line 1049, in _connect
+    b'git-' + cmd, path, b'host=' + self._host.encode('ascii'))
+AttributeError: 'bytes' object has no attribute 'encode'
+
+--- dulwich/client.py.orig	2020-12-14 23:57:10.000000000 +0000
++++ dulwich/client.py
+@@ -1046,7 +1046,7 @@ class TCPGitClient(TraditionalGitClient)
+             path = path[1:]
+         # TODO(jelmer): Alternative to ascii?
+         proto.send_cmd(
+-            b'git-' + cmd, path, b'host=' + self._host.encode('ascii'))
++            b'git-' + cmd, path, b'host=' + self._host.decode().encode('ascii'))
+         return proto, lambda: _fileno_can_read(s), None
+ 
+ 


Home | Main Index | Thread Index | Old Index