Drop support for legacy Python 2

This commit is contained in:
Hugo 2018-08-14 16:26:15 +03:00 committed by hugovk
parent 5fded8398b
commit 07fac0628c
10 changed files with 90 additions and 80 deletions

View file

@ -1,21 +1,50 @@
#!/usr/bin/env python
from setuptools import find_packages, setup
from __future__ import print_function
import sys
with open("README.md") as f:
long_description = f.read()
from setuptools import find_packages, setup
version_dict = {}
with open("pylast/version.py") as f:
exec(f.read(), version_dict)
version = version_dict["__version__"]
if sys.version_info < (3, 4):
error = """pylast 3.0 and above are no longer compatible with Python 2.
This is pylast {} and you are using Python {}.
Make sure you have pip >= 9.0 and setuptools >= 24.2 and retry:
$ pip install --upgrade pip setuptools
Other choices:
- Upgrade to Python 3.
- Install an older version of pylast:
$ pip install 'pylast<3.0'
For more information:
https://github.com/pylast/pylast/issues/265
""".format(
version, ".".join([str(v) for v in sys.version_info[:3]])
)
print(error, file=sys.stderr)
sys.exit(1)
with open("README.md") as f:
long_description = f.read()
setup(
name="pylast",
long_description=long_description,
long_description_content_type="text/markdown",
version=version,
author="Amr Hassan <amr.hassan@gmail.com> and Contributors",
install_requires=["six"],
tests_require=[
"coverage",
"flaky",
@ -34,17 +63,16 @@ setup(
"Topic :: Internet",
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 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 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
python_requires=">=2.7.10, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
python_requires=">=3.4",
keywords=["Last.fm", "music", "scrobble", "scrobbling"],
packages=find_packages(exclude=("tests*",)),
license="Apache2",