python setup.py test does not install packages in tests_require #212
Comments
python setup.py test
does not install packages in tests_require
To add a little more background, setuptools comes with its own test command, which knows, to a limited extent, how to locate and run tests that use the standard library It's only setuptools' built-in |
👍 to making use of this in some way in the |
I would also like to see this functionality implemented. I would like to see the astropy_helpers module have the same behavior for install_requires and tests_require as setuptools. I use the astropy package-template, and have spent several hours searching for issues with the tests_require on the setuptools side. I hadn't realized that astropy_helpers was overriding that command. So for me, there was significantly more confusion because the package was not explicitly downloading packages rather than @eteq 's concern. This also makes travis testing more straightforward using the current version of the package template. The default commands in the travis.yml file are to run test and egg-info. If setup.py test ignores the tests_require (and install_requires for that matter), the build will fail. This at least needs better documentation. |
I just implemented pull request astropy/astropy#5092 that would implement this feature. Please let me know what you think @eteq and @embray. |
This has since been implemented in astropy core, so closing! |
What could be the reason that setuptools still do not install stuff from |
@tashrifbillah I don't know why you're asking this here--this is not a general Python helpdesk. In case it helps, |
I found this issue in CCDproc, but I report it here because it seems to be an issue of astropy-helpers.
ccdproc requires the module pytest-capturelog and specifies that in its
tests_require
in setup.py.( https://github.com/astropy/ccdproc/blob/master/setup.py#L98 )
I don't have pytest-capturelog installed on my machine and the corresponding tests fail with
Theses failures go away after manually installing pytest-capturelog.
Thus, it seems that either
python setup.py test
does not install the required dependencies or it installs them in a location where they are not found.(My understanding is that
tests_require
dependencies are installed in a temporary directory only, but I might be wrong.)There are two obvious workarounds: Installs test dependencies by hand or put them into
install_requires
even though they are only needed for testing.(Note that this does not show up as an issue in the travis, because this dependency is installed by hand here https://github.com/astropy/ccdproc/blob/master/.travis.yml#L101 )
cc: @mwcraig
The text was updated successfully, but these errors were encountered: