Skip to content

Commit

Permalink
setup: adapt setup.[cfg|py] for Py3.6+
Browse files Browse the repository at this point in the history
Co-authored-by: dgw <[email protected]>
  • Loading branch information
Exirel and dgw committed Jun 27, 2021
1 parent 3c64a7e commit 43e58f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
7 changes: 2 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ classifiers =
License :: Eiffel Forum License (EFL)
License :: OSI Approved :: Eiffel Forum License
Operating System :: POSIX :: Linux
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Topic :: Communications :: Chat :: Internet Relay Chat

[options]
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4
python_requires = >=3.6, <4
packages = find:
zip_safe = false

Expand Down
19 changes: 9 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@

# We check Python's version ourselves in case someone installed Sopel on an
# old version of pip (<9.0.0), which doesn't know about `python_requires`.
if sys.version_info < (2, 7) or (
sys.version_info.major >= 3 and sys.version_info < (3, 3)
):
if sys.version_info < (3, 6):
# Maybe not the best way to do this, but this question is tiring.
raise ImportError('Sopel requires Python 2.7+ or 3.3+.')
# Py2 EOL: https://www.python.org/dev/peps/pep-0373/#maintenance-releases
if sys.version_info.major == 2:
raise ImportError('Sopel requires Python 3.6+.')

# Py3.6 EOL: https://www.python.org/dev/peps/pep-0494/#lifespan
if sys.version_info < (3, 7):
# TODO check this warning before releasing Sopel 8.0
print(
'Warning: Python 2.x has reached end of life and will receive '
'no further updates. Sopel 8.0 will drop support for it.',
'Warning: Python 3.6 will reach end of life by the end of 2021 '
'and will receive no further updates. '
'Sopel 9.0 will drop support for it.',
file=sys.stderr,
)

Expand All @@ -54,8 +55,6 @@ def read_reqs(path):


requires = read_reqs('requirements.txt')
if sys.version_info[0] < 3:
requires.append('backports.ssl_match_hostname')
dev_requires = requires + read_reqs('dev-requirements.txt')

setup(
Expand Down

0 comments on commit 43e58f9

Please sign in to comment.