Browse Source

setup: show error on older python versions

Show an error message when the python_requires classifier of the
package gets ignored, so that users can't accidentally install
an incompatible version of Streamlink with their unsupported
Python version / environment.

Also bump the required version of pip to >=9 in dev-requirements.
pull/4085/head
bastimeyer 1 week ago
committed by Forrest
parent
commit
5b01621fd1
  1. 2
      dev-requirements.txt
  2. 24
      setup.py

2
dev-requirements.txt

@ -1,4 +1,4 @@
pip>=6
pip>=9
pytest
pytest-cov
coverage

24
setup.py

@ -1,5 +1,6 @@
#!/usr/bin/env python
import codecs
import sys
from os import environ, path
from sys import argv, path as sys_path
@ -8,6 +9,29 @@ from setuptools import find_packages, setup
import versioneer
CURRENT_PYTHON = sys.version_info[:2]
REQUIRED_PYTHON = (3, 6)
# This check and everything above must remain compatible with older Python versions
if CURRENT_PYTHON < REQUIRED_PYTHON:
# noinspection PyStringFormat
sys.exit(
"""
========================================================
Unsupported Python version
========================================================
This version of Streamlink requires at least Python {}.{},
but you're trying to install it on Python {}.{}.
This may be because you are using a version of pip that
doesn't understand the python_requires classifier.
Make sure you have pip >= 9.0 and setuptools >= 24.2
"""
.strip(" \n")
.format(*(REQUIRED_PYTHON + CURRENT_PYTHON))
)
data_files = []
deps = [
"requests>=2.26.0,<3.0",

Loading…
Cancel
Save