packaging.python.org
packaging.python.org copied to clipboard
Provide some guidance on specifying test dependencies
The packaging guide could use a brief blurb providing guidance on how to specify test dependencies for your project.
Some background:
- There is this question on Stack Overflow on how to use the
tests_requireoption ofsetuptools.setup(). The question has 25K views. - The setuptools docs for
tests_requireexplain that the option is used for thetestcommand, but also that thetestcommand was deprecated in version 41.5.0.
Would it make sense to add something to the setuptools guide on specifying test dependencies, and specifically on whether or not to use tests_require?
What would the guidance be?
I agree that this should be covered.
AFAIK the current "recommended way" of doing this in setuptools is to add an optional dependency ("extra") for it, named something like tests or test.
Hi @smheidrich I think testing is also common, it is used in setuptools itself and I also think in virtualenv.
testing might have became popular because it is one of the examples in the tox docs.