-
-
Notifications
You must be signed in to change notification settings - Fork 409
sopel: drop support for Python < 3.6 #2062
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b426314
sopel: refactor imports to remove py2 imports
Exirel 27d8c76
test: remove test config for py2.7
Exirel f3ec439
sopel: remove obsolete 'unicode = str' shim
Exirel 3c64a7e
quality: replace and enforce future import rules for Py3.6+
Exirel 43e58f9
setup: adapt setup.[cfg|py] for Py3.6+
Exirel b000f92
cli: update run script rules for Py3.6+
Exirel 29dab11
checkstyle.sh: remove obsolete checks
Exirel d7dd197
sopel: remove obsolete usage of sys.version_info
Exirel 15eeb2d
test: remove obsolete usage of sys.version_info
Exirel 3456d4c
sopel: replace obsolete tools.iteritems
Exirel e3315bb
test_tools: import configparser
Exirel 4d0dad8
sopel: minor cleanup after Py2.7 removal
Exirel d9fd411
all: remove coding header
Exirel f70f795
pip: update requirements and dev requirements for Python>=3.6
Exirel bd431b0
README: Python 3.6+ now!
Exirel f9fe98f
quality: upgrade flake8
Exirel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,13 @@ | ||
| coveralls<2.0; python_version < '3.5' | ||
| coveralls>=2.0; python_version >= '3.5' | ||
| flake8<3.6.0; python_version == '3.3' | ||
| flake8>=3.7.0,<3.8.0; python_version != '3.3' | ||
| coveralls>=2.0 | ||
| flake8 | ||
| flake8-coding | ||
| flake8-future-import<0.4.6 | ||
| flake8-import-order; python_version > '3.3' | ||
| flake8-import-order<=1.18.1; python_version <= '3.3' | ||
| # transitive dependency of Sphinx | ||
| # added f-strings in 2.x, but it's not worth doing a whole suite of version markers | ||
| MarkupSafe<2.0 | ||
| pytest<3.3; python_version == '3.3' | ||
| pytest>=4.6,<4.7; python_version != '3.3' | ||
| pytest-vcr==1.0.2; python_version != '3.3' | ||
| pytest-vcr==0.3.0; python_version == '3.3' | ||
| PyYAML<5.1; python_version == '3.3' | ||
| PyYAML<5.3; python_version == '3.4' | ||
| flake8-future-import | ||
| flake8-import-order | ||
| pytest>=4.6,<4.7 | ||
| pytest-vcr==1.0.2 | ||
| requests-mock==1.9.1 | ||
| setuptools<40.0; python_version == '3.3' | ||
| # use Sphinx 3.x until dev begins on Sopel 8 and we drop the dead snakes | ||
| sphinx<4.0 | ||
| # autoprogram extension added type annotations in 0.1.6 | ||
| # such annotations require Python 3.5 | ||
| sphinxcontrib-autoprogram<0.1.6; python_version < '3.5' | ||
| sphinx | ||
| # further constrain autoprogram version because the new (in 2021) maintainer | ||
| # already demonstrated a willingness to make major changes in patch versions | ||
| sphinxcontrib-autoprogram<=0.1.7; python_version >= '3.5' | ||
| vcrpy==2.1.1; python_version == '2.7' | ||
| vcrpy<1.12.0; python_version == '3.3' | ||
| vcrpy<2.1.0; python_version == '3.4' | ||
| vcrpy<3.0.0; python_version >= '3.5' | ||
| sphinxcontrib-autoprogram<=0.1.7 | ||
| vcrpy<3.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,7 @@ | ||
| xmltodict<0.12.0; python_version == '3.3' | ||
| xmltodict==0.12; python_version != '3.3' | ||
| xmltodict==0.12 | ||
| pytz | ||
| praw>=4.0.0,<6.0.0 | ||
| # transitive dependency of praw; v0.18 introduced f-string syntax | ||
| update-checker<0.18; python_version < '3.6' | ||
| 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' | ||
| geoip2>=4.0,<5.0 | ||
| requests>=2.0.0,<3.0.0 | ||
| # transitive dependency of requests | ||
| # 2.0 will drop EOL Python 2.7 & 3.5, just like Sopel 8 plans to | ||
| urllib3<1.27; python_version != '3.3' and python_version != '3.4' | ||
| urllib3<1.23; python_version == '3.3' | ||
| urllib3<1.25; python_version == '3.4' | ||
| dnspython<2.0; python_version == '2.7' | ||
| dnspython<1.16.0; python_version == '3.3' | ||
| dnspython<3.0; python_version >= '3.4' | ||
| sqlalchemy<1.3; python_version == '3.3' | ||
| sqlalchemy<1.4; python_version != '3.3' | ||
| dnspython<3.0 | ||
| sqlalchemy<1.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,18 @@ | ||
| # coding=utf-8 | ||
| # Copyright 2008, Sean B. Palmer, inamidst.com | ||
| # Copyright © 2012, Elad Alfassa <[email protected]> | ||
| # Copyright 2012-2015, Elsie Powell, http://embolalia.com | ||
| # Copyright 2019, Florian Strzelecki <[email protected]> | ||
| # | ||
| # Licensed under the Eiffel Forum License 2. | ||
|
|
||
| from __future__ import absolute_import, division, print_function, unicode_literals | ||
| from __future__ import generator_stop | ||
|
|
||
| from ast import literal_eval | ||
| from datetime import datetime | ||
| import itertools | ||
| import logging | ||
| import re | ||
| import signal | ||
| import sys | ||
| import threading | ||
| import time | ||
|
|
||
|
|
@@ -44,14 +42,6 @@ | |
| SIGNALS = QUIT_SIGNALS + RESTART_SIGNALS | ||
|
|
||
|
|
||
| if sys.version_info.major >= 3: | ||
| unicode = str | ||
| basestring = str | ||
| py3 = True | ||
| else: | ||
| py3 = False | ||
|
|
||
|
|
||
| class Sopel(irc.AbstractBot): | ||
| def __init__(self, config, daemon=False): | ||
| super(Sopel, self).__init__(config) | ||
|
|
@@ -358,7 +348,7 @@ def __setup_plugins_check_manual_url_callbacks(self, name): | |
| # nothing to check | ||
| return | ||
|
|
||
| for key, callback in tools.iteritems(self.memory['url_callbacks']): | ||
| for key, callback in self.memory['url_callbacks'].items(): | ||
| is_checked = getattr( | ||
| callback, '_sopel_url_callbacks_checked', False) | ||
| if is_checked: | ||
|
|
@@ -1129,7 +1119,7 @@ def register_url_callback(self, pattern, callback): | |
| if 'url_callbacks' not in self.memory: | ||
| self.memory['url_callbacks'] = tools.SopelMemory() | ||
|
|
||
| if isinstance(pattern, basestring): | ||
| if isinstance(pattern, str): | ||
| pattern = re.compile(pattern) | ||
|
|
||
| # Mark the callback as checked: using this method is safe. | ||
|
|
@@ -1180,7 +1170,7 @@ def unregister_url_callback(self, pattern, callback): | |
| # nothing to unregister | ||
| return | ||
|
|
||
| if isinstance(pattern, basestring): | ||
| if isinstance(pattern, str): | ||
| pattern = re.compile(pattern) | ||
|
|
||
| try: | ||
|
|
@@ -1216,7 +1206,7 @@ def search_url_callbacks(self, url): | |
| # nothing to search | ||
| return | ||
|
|
||
| for regex, function in tools.iteritems(self.memory['url_callbacks']): | ||
| for regex, function in self.memory['url_callbacks'].items(): | ||
| match = regex.search(url) | ||
| if match: | ||
| yield function, match | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.