Skip to content

Commit 086d14a

Browse files
committed
setup: disable test command
1 parent 765f969 commit 086d14a

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

setup.py

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,42 @@
33
import sys
44
from os import environ, path
55
from sys import argv, path as sys_path
6+
from textwrap import dedent
67

78
from setuptools import find_packages, setup
89

910
import versioneer
1011

1112

13+
def format_msg(text, *args, **kwargs):
14+
return dedent(text).strip(" \n").format(*args, **kwargs)
15+
16+
1217
CURRENT_PYTHON = sys.version_info[:2]
1318
REQUIRED_PYTHON = (3, 6)
1419

1520
# This check and everything above must remain compatible with older Python versions
1621
if CURRENT_PYTHON < REQUIRED_PYTHON:
1722
# noinspection PyStringFormat
18-
sys.exit(
19-
"""
20-
========================================================
21-
Unsupported Python version
22-
========================================================
23-
This version of Streamlink requires at least Python {}.{},
24-
but you're trying to install it on Python {}.{}.
25-
26-
This may be because you are using a version of pip that
27-
doesn't understand the python_requires classifier.
28-
Make sure you have pip >= 9.0 and setuptools >= 24.2
29-
"""
30-
.strip(" \n")
31-
.format(*(REQUIRED_PYTHON + CURRENT_PYTHON))
32-
)
23+
sys.exit(format_msg("""
24+
========================================================
25+
Unsupported Python version
26+
========================================================
27+
This version of Streamlink requires at least Python {}.{},
28+
but you're trying to install it on Python {}.{}.
29+
30+
This may be because you are using a version of pip that
31+
doesn't understand the python_requires classifier.
32+
Make sure you have pip >= 9.0 and setuptools >= 24.2
33+
""", *(REQUIRED_PYTHON + CURRENT_PYTHON)))
34+
35+
# Explicitly disable running tests via setuptools
36+
if "test" in sys.argv:
37+
sys.exit(format_msg("""
38+
Running `python setup.py test` has been deprecated since setuptools 41.5.0.
39+
Streamlink requires pytest for collecting and running tests, via one of these commands:
40+
`pytest` or `python -m pytest` (see the pytest docs for more infos about this)
41+
"""))
3342

3443

3544
data_files = []

0 commit comments

Comments
 (0)