setup: disable test command

This commit is contained in:
bastimeyer 2021-10-19 22:11:44 +02:00 committed by Forrest
parent 765f969dfd
commit 06eba3bdbf
1 changed files with 23 additions and 15 deletions

View File

@ -3,33 +3,41 @@ import codecs
import sys
from os import environ, path
from sys import argv, path as sys_path
from textwrap import dedent
from setuptools import find_packages, setup
import versioneer
def format_msg(text, *args, **kwargs):
return dedent(text).strip(" \n").format(*args, **kwargs)
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 {}.{}.
sys.exit(format_msg("""
========================================================
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))
)
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
""", *(REQUIRED_PYTHON + CURRENT_PYTHON)))
# Explicitly disable running tests via setuptools
if "test" in sys.argv:
sys.exit(format_msg("""
Running `python setup.py test` has been deprecated since setuptools 41.5.0.
Streamlink requires pytest for collecting and running tests, via one of these commands:
`pytest` or `python -m pytest` (see the pytest docs for more infos about this)
"""))
data_files = []