I'm adding functionality to an existing pip-installable project, and the project owner feels that my adding of pandas
to the setup.py installation requirements is 'too heavy', as the project should remain slim. The functionality I'm adding does not require pandas
(because the functionality is operations on top of a pandas.DataFrame
object), but the unit tests I wrote for it require invoking pandas
to setUp
a test DataFrame to mutate with.
Is there some way to require pandas
only for the unit tests? Or do I just not add it to the requirements, and raise an error to manually install pandas
when that unit test is run?
For setuptools you can use
tests_require
in a similar fashion toinstall_requires
to list packages that are only required for testing.Cf. https://setuptools.readthedocs.io/en/latest/setuptools.html?highlight=tests_require
Yes, it's simple in
setuptools
:Now when you develop on the app, use: