When I run python setup.py test
the dependencies listed in tests_require
in setup.py are downloaded to the current directory. When I run python setup.py install
, the dependencies listed in requires
are instead installed to site-packages
.
How can I have those tests_require
dependencies instead installed in site-packages
?
Follow the below steps to install the Setuptools package on Linux using the setup.py file: Step 1: Download the latest source package of Setuptools for Python3 from the website. Step 3: Go to the setuptools-60.5. 0 folder and enter the following command to install the package.
you generally don't need to worry about setuptools - either it isn't really needed, or the high-level installers will make sure you have a recent enough version installed; in this last case, as long as the operations they have to do are simple enough generally they won't fail.
Even in a vanilla version of Python 3.7. 6 (installed via pyenv ), the packages installed by default are both pip and setuptools .
You cannot specify where the test requirements are installed. The whole point of the tests_require parameter is to specify dependencies that are not required for the installation of the package but only for running the tests (as you can imagine many consumers might want to install the package but not run the tests). If you want the test requirements to be included during installation, I would include them in the install_requires parameter. For example:
test_requirements = ['pytest>=2.1', 'dingus'] setup( # ... tests_require = test_requirements, install_requires = [ # ... (your usual install requirements) ] + test_requirements, )
As far as I know, there's no parameter you can pass to force this behavior without changing the setup script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With