From f394f3082eabedda4cd6da18941d67b082837176 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 23 Aug 2024 13:40:26 -0400 Subject: [PATCH] tox.ini - remove custom list of depends for testing: just use extras test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit also removed unnecessary now dev installation of joblib # extras test vs tox.ini: Most recent debate on tox.ini vs extra_depends is at https://github.com/con/solidation/pull/43#discussion_r1725031914 Although I appreciate the convenience of "tox" as an entry point for testing, I increasingly find no support for it to be "the" location for testing depends listing. Moreover I keep running into cases of needing to fish out test dependencies somewhere else (tox.ini, nox etc) which then can differ across projects, and also require me to adopt some avoidable runtime etc overhead from running those extra test shims whenever pytest is just good enough. My arguments for generally adopting an approach of specifying test dependencies in setup.{cfg,py} or other "generic" locations as optional are: - pytest, and its extentions are used (imported) inside the tests. I, in 99% of cases, do consider "tests" to be the part of the source code. I would not consider them part of the source code whenever there is an outside test battery which is developed/maintained independently of the source code. As such, I think that dependencies for tests, as part of the source code, should be listed alongside with dependencies for the build/installation/run time dependencies. Some distributions even do "import test" across entire source code distribution and thus tend to decide or to request exclusion from source distributions (IMHO the wrong step in most of the cases). Ref: https://github.com/dandi/dandi-schema/pull/249 - It is unfortunate that there is no "standard" convention on how/where to specify such test requirements, so I think it is ok to adopt [test] as the general convention among our projects. - tox.ini looses NOTHING from using "extras". - tox.ini is the correct location to describe environments and dependncies for external to source code tools/modules, i.e those not imported explicitly anywhere in the source code. - with description of test dependencies alongside with the main dependencies would benefit downstream distribution (debian, conda, gentoo, etc) packagers since they do not need to fish around for what other dependencies to install/recommend/suggest for the package. - I do appreciate the fact that test dependencies alone are not sufficient to run the tests, but invocation of the pytest is standardized enough to just invoke it against the source code. (given dependencies are installed) That is e.g. how dh-python helper in Debian operates -- if pytest dependency announced, just run pytest automagically. # joblib: joblib dev listing was added in commit 6375816f279c899327155d424c7fc4d35b4f0dde Author: John T. Wodder II Date: Fri Mar 19 08:42:47 2021 -0400 likely to use ❯ git describe --contains 457d2c8a926105fd156b1dfccfaae3e500d22451 1.1.0~13 ❯ git show 457d2c8a926105fd156b1dfccfaae3e500d22451 commit 457d2c8a926105fd156b1dfccfaae3e500d22451 Author: John T. Wodder II Date: Thu Mar 18 06:07:06 2021 -0400 Use inspect.signature() instead of inspect.getfullargspec() (#1165) This fixes a bug with the ignore parameter when the cached function is decorated Co-authored-by: Loïc Estève and we have already joblib ~= 1.1 so should be all set. --- tox.ini | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index 07fd4c6..a625a9b 100644 --- a/tox.ini +++ b/tox.ini @@ -5,12 +5,8 @@ isolated_build = True minversion = 3.3.0 [testenv] -deps = - dev: joblib @ git+https://github.com/joblib/joblib.git - pytest - pytest-cov - pytest-mock - pytest-rerunfailures +extras = + test commands = pytest --pyargs {posargs} fscacher