From 18e20957cb03195d3fc759c03de0e1938f8501af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20=C5=A0imko?= Date: Wed, 21 Aug 2024 18:19:19 +0200 Subject: [PATCH] installation: deprecate `tests_require` Amends installation setup with respect to deprecated `tests_require`. Amends `tox` testing setup to produce correct coverage findings. --- run-tests.sh | 4 ++-- setup.py | 30 ++++++++++++++---------------- tox.ini | 24 ++++++++++++++++++------ 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/run-tests.sh b/run-tests.sh index 26a4e98..4cd1bc9 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -2,7 +2,7 @@ # # This file is part of cernopendata-client. # -# Copyright (C) 2019, 2020, 2021, 2023 CERN. +# Copyright (C) 2019, 2020, 2021, 2023, 2024 CERN. # # cernopendata-client is free software; you can redistribute it and/or modify # it under the terms of the GPLv3 license; see LICENSE file for more details. @@ -51,7 +51,7 @@ check_sphinx () { } check_pytest () { - python setup.py test + pytest } if [ $# -eq 0 ]; then diff --git a/setup.py b/setup.py index cf0cbf5..5d06a15 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ # # This file is part of cernopendata-client. # -# Copyright (C) 2019, 2020, 2021, 2022, 2023 CERN. +# Copyright (C) 2019, 2020, 2021, 2022, 2023, 2024 CERN. # # cernopendata-client is free software; you can redistribute it and/or modify # it under the terms of the GPLv3 license; see LICENSE file for more details. @@ -16,19 +16,6 @@ readme = open("README.rst").read() history = open("CHANGES.rst").read() -tests_require = [ - 'black>=19.10b0 ; python_version>="3"', - "check-manifest>=0.25", - "coverage>=4.0", - "mock>=3.0", - "pydocstyle>=1.0.0", - "pytest-cache>=1.0", - "pytest-cov>=1.8.0", - "pytest>=2.8.0", - 'platformdirs<2.1 ; python_version=="3.6"', - 'pytest-mock>=2.0,<3.0 ; python_version=="2.7"', - 'pytest-mock>=3.0 ; python_version>="3"', -] extras_require = { "docs": [ @@ -38,7 +25,19 @@ "sphinx-click>=2.5.0", ], "pycurl": ["pycurl>=7"], - "tests": tests_require, + "tests": [ + 'black>=19.10b0 ; python_version>="3"', + "check-manifest>=0.25", + "coverage>=4.0", + "mock>=3.0", + "pydocstyle>=1.0.0", + "pytest-cache>=1.0", + "pytest-cov>=1.8.0", + "pytest>=2.8.0", + 'platformdirs<2.1 ; python_version=="3.6"', + 'pytest-mock>=2.0,<3.0 ; python_version=="2.7"', + 'pytest-mock>=3.0 ; python_version>="3"', + ], "xrootd": [ "xrootd>=4.12.2", ], @@ -75,7 +74,6 @@ extras_require=extras_require, install_requires=install_requires, setup_requires=setup_requires, - tests_require=tests_require, entry_points={ "console_scripts": [ "cernopendata-client = cernopendata_client.cli:cernopendata_client" diff --git a/tox.ini b/tox.ini index 63b4a26..1b368d3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,15 +1,27 @@ # This file is part of cernopendata-client. # -# Copyright (C) 2020, 2022, 2023 CERN. +# Copyright (C) 2020, 2022, 2023, 2024 CERN. # # cernopendata-client is free software; you can redistribute it and/or modify # it under the terms of the GPLv3 license; see LICENSE file for more details. [tox] -envlist = py36, py37, py38, py39, py310, py311, py312 +envlist = + py36 + py37 + py38 + py39 + py310 + py311 + py312 [testenv] -deps = pytest - pytest-cov - setuptools -commands = {envpython} setup.py test +deps = + pytest + pytest-cov + pytest-mock + setuptools +commands = + pytest {posargs} +package = + editable