From 2d234cced541501780fe2c79ea0a8077e317640e Mon Sep 17 00:00:00 2001 From: Andrew Israel Date: Wed, 22 Feb 2023 13:26:51 -0800 Subject: [PATCH] Make pytest-runner conditional See more details here: https://pytest-runner.readthedocs.io/en/latest/#conditional-requirement and here: https://github.com/pytest-dev/pytest/issues/3814 --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8f17927..f2c287d 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,10 @@ HERE = pathlib.Path(__file__).parent README = (HERE / "README.md").read_text() +# See https://pytest-runner.readthedocs.io/en/latest/#conditional-requirement +needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv) +pytest_runner = ['pytest-runner'] if needs_pytest else [] + setup( name="propelauth-flask", version="2.0.1", @@ -16,7 +20,7 @@ author_email="support@propelauth.com", license="MIT", install_requires=["flask>=0.9", "propelauth-py", "requests"], - setup_requires=["pytest-runner"], + setup_requires=pytest_runner, tests_require=["pytest==4.4.1"], test_suite="tests", )