Tuesday, March 31, 2020

update: py-irclib + move to py3

Move py-irclib to a fork that supports python3 and switch to python3
only. The only consumer is py-twitter for which I will send a
separate diff shortly.

Joint work with bket@, tested on amd64.

Cheers,
Daniel

Index: Makefile
===================================================================
RCS file: /cvs/ports/net/py-irclib/Makefile,v
retrieving revision 1.14
diff -u -p -u -p -r1.14 Makefile
--- Makefile 12 Jul 2019 20:48:45 -0000 1.14
+++ Makefile 31 Mar 2020 13:15:24 -0000
@@ -2,19 +2,21 @@

COMMENT= Internet Relay Chat (IRC) protocol client library for Python

-DISTNAME= python-irclib-0.4.6
-PKGNAME= ${DISTNAME:S/python/py/g}
-REVISION = 4
-CATEGORIES= net
+GH_ACCOUNT= sixohsix
+GH_PROJECT= python-irclib
+GH_COMMIT= acd5aa66f431550bd142e90590b64ff6840e6648
+DISTNAME= py-irclib-0.4.8.20110306

-HOMEPAGE= http://python-irclib.sourceforge.net/
+CATEGORIES= net

-# LGPL
+# LGPLv2.1
PERMIT_PACKAGE= Yes

-MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=python-irclib/}
+MODULES= lang/python
+MODPY_SETUPTOOLS= Yes

-MODULES= lang/python
+FLAVORS= python3
+FLAVOR= python3

NO_TEST= Yes

Index: distinfo
===================================================================
RCS file: /cvs/ports/net/py-irclib/distinfo,v
retrieving revision 1.6
diff -u -p -u -p -r1.6 distinfo
--- distinfo 18 Jan 2015 03:14:51 -0000 1.6
+++ distinfo 31 Mar 2020 13:15:24 -0000
@@ -1,2 +1,2 @@
-SHA256 (python-irclib-0.4.6.tar.gz) = 8fRyppiWawNQhXsg/H9t2G5KH4OHDt++MOs2VStEloA=
-SIZE (python-irclib-0.4.6.tar.gz) = 33922
+SHA256 (py-irclib-0.4.8.20110306-acd5aa66.tar.gz) = kXO31zUdYjx3Uxw9d/x1cN3CpgwQqMUGYTYBulBwrbo=
+SIZE (py-irclib-0.4.8.20110306-acd5aa66.tar.gz) = 34462
Index: patches/patch-ircbot_py
===================================================================
RCS file: patches/patch-ircbot_py
diff -N patches/patch-ircbot_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-ircbot_py 31 Mar 2020 13:15:24 -0000
@@ -0,0 +1,52 @@
+$OpenBSD$
+
+Remove unneeded imports that don't work in python3, avoid an infinite
+recursion in __contains__, remove unneeded method using a deprecated
+function, fix variable error
+
+Index: ircbot.py
+--- ircbot.py.orig
++++ ircbot.py
+@@ -25,10 +25,9 @@ write simpler bots.
+ """
+
+ import sys
+-from UserDict import UserDict
+
+ from irclib import SimpleIRCClient
+-from irclib import nm_to_n, irc_lower, all_events
++from irclib import nm_to_n, irc_lower
+ from irclib import parse_channel_modes, is_channel
+ from irclib import ServerConnectionError
+
+@@ -263,11 +262,6 @@ class IRCDict:
+ self.update(dict)
+ def __repr__(self):
+ return repr(self.data)
+- def __cmp__(self, dict):
+- if isinstance(dict, IRCDict):
+- return cmp(self.data, dict.data)
+- else:
+- return cmp(self.data, dict)
+ def __len__(self):
+ return len(self.data)
+ def __getitem__(self, key):
+@@ -284,7 +278,8 @@ class IRCDict:
+ def __iter__(self):
+ return iter(self.data)
+ def __contains__(self, key):
+- return key in self
++ return True if key in self.keys() else False
++
+ def clear(self):
+ self.data.clear()
+ self.canon_keys.clear()
+@@ -424,7 +419,7 @@ class Channel:
+
+ def limit(self):
+ if self.has_limit():
+- return self.modes[l]
++ return self.modes["l"]
+ else:
+ return None
+
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/net/py-irclib/pkg/PLIST,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 PLIST
--- pkg/PLIST 20 Sep 2006 12:41:46 -0000 1.4
+++ pkg/PLIST 31 Mar 2020 13:15:24 -0000
@@ -1,8 +1,15 @@
@comment $OpenBSD: PLIST,v 1.4 2006/09/20 12:41:46 xsa Exp $
+@conflict py-irclib-*
+@pkgpath net/py-irclib
+lib/python${MODPY_VERSION}/site-packages/${MODPY_PYCACHE}ircbot.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/${MODPY_PYCACHE}irclib.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/ircbot.py
-lib/python${MODPY_VERSION}/site-packages/ircbot.pyc
lib/python${MODPY_VERSION}/site-packages/irclib.py
-lib/python${MODPY_VERSION}/site-packages/irclib.pyc
+lib/python${MODPY_VERSION}/site-packages/python_irclib-0.4.8-py${MODPY_VERSION}.egg-info/
+lib/python${MODPY_VERSION}/site-packages/python_irclib-0.4.8-py${MODPY_VERSION}.egg-info/PKG-INFO
+lib/python${MODPY_VERSION}/site-packages/python_irclib-0.4.8-py${MODPY_VERSION}.egg-info/SOURCES.txt
+lib/python${MODPY_VERSION}/site-packages/python_irclib-0.4.8-py${MODPY_VERSION}.egg-info/dependency_links.txt
+lib/python${MODPY_VERSION}/site-packages/python_irclib-0.4.8-py${MODPY_VERSION}.egg-info/top_level.txt
share/examples/py-irclib/
share/examples/py-irclib/dccreceive
share/examples/py-irclib/dccsend

No comments:

Post a Comment