From c21f4acaabcc69f979a88dcd1c4ade86c12a0f28 Mon Sep 17 00:00:00 2001 From: dgw Date: Sat, 25 Jul 2020 00:40:30 -0500 Subject: [PATCH 1/3] build: fix/upgrade `geoip2` requirements where possible Split `geoip2` requirement into ranges based on Python release. Capped `maxminddb` version on old Pythons now that v2.0 dropped them. --- requirements.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1b2b004642..920fdd1b30 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,11 @@ xmltodict<0.12.0; python_version == '3.3' xmltodict==0.12; python_version != '3.3' pytz praw>=4.0.0,<6.0.0 -geoip2<3.0.0 +geoip2<3.0; python_version <= '3.5' and python_version != '2.7' +geoip2>=3.0,<4.0; python_version == '2.7' +geoip2>=4.0,<5.0; python_version >= '3.6' +# transitive dependency of geoip2; v2 dropped py2.7 & py3 < 3.6 +maxminddb<2.0; python_version < '3.6' ipaddress<2.0; python_version < '3.3' requests>=2.0.0,<3.0.0 urllib3<1.23; python_version == '3.3' From f4a7c5b0ce56f85aa85073c45f5819f8c05d4cca Mon Sep 17 00:00:00 2001 From: dgw Date: Tue, 14 Jul 2020 19:17:09 -0500 Subject: [PATCH 2/3] ip: make example/test regex even more generic The fields available in the GeoIP database are liable to change at any time, without warning. As long as the hostname looks fine and it belongs to the right AS, we don't really care about the extras, though. --- sopel/modules/ip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sopel/modules/ip.py b/sopel/modules/ip.py index cc49d9aac9..d2c2786008 100644 --- a/sopel/modules/ip.py +++ b/sopel/modules/ip.py @@ -115,7 +115,7 @@ def _find_geoip_db(bot): @commands('iplookup', 'ip') @example('.ip 8.8.8.8', - r'\[IP\/Host Lookup\] Hostname: \S*dns\S*\.google\S* \| Location: United States \| ISP: AS15169 \S+', + r'\[IP\/Host Lookup\] Hostname: \S*dns\S*\.google\S*( \| .+?: .+?)+ \| ISP: AS15169 \S+', re=True, ignore='Downloading GeoIP database, please wait...', online=True) From 76adfa7762f7954887942bf7651ad42754296922 Mon Sep 17 00:00:00 2001 From: dgw Date: Sat, 25 Jul 2020 12:24:06 -0500 Subject: [PATCH 3/3] search: genericize `sopel.chat irc bot` DDG example test We are not backporting the use of VCR to 7.0.x, so this example still needs to work without it. --- sopel/modules/search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sopel/modules/search.py b/sopel/modules/search.py index 79295da92c..83216f268b 100644 --- a/sopel/modules/search.py +++ b/sopel/modules/search.py @@ -99,7 +99,7 @@ def duck_api(query): # the last example (in source line order) is what .help displays @example( '.duck sopel.chat irc bot', - r'https?:\/\/(sopel\.chat\/?|github\.com\/sopel-irc\/sopel)', + r'https?:\/\/.*sopel.*', re=True, online=True) def duck(bot, trigger):