Skip to content

Commit

Permalink
tox.ini - remove custom list of depends for testing: just use extras …
Browse files Browse the repository at this point in the history
…test

also removed unnecessary now dev installation of joblib

# extras test vs tox.ini:

Most recent debate on tox.ini vs extra_depends is at
con/solidation#43 (comment)

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: dandi/dandi-schema#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 6375816
    Author: John T. Wodder II <[email protected]>
    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 <[email protected]>
    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 <[email protected]>

and we have already joblib ~= 1.1 so should be all set.
  • Loading branch information
yarikoptic committed Aug 23, 2024
1 parent 6fa61f7 commit f394f30
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f394f30

Please sign in to comment.