Skip to content

setup: disable test command #4107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 24 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,41 @@
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 {}.{}.

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))
)
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
""", *(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 = []
Expand Down