What pip command(s) will install the dependencies defined in setup.py's setup_requires and tests_require?

Viewed 1398

I know that pip install . will install the dependencies defined in install_requires, but what pip command(s) will install the dependencies defined in setuptools.setup's setup_requires and tests_require?

Simple setup.py:

import setuptools

setuptools.setup(
    name="my_app",
    version="0.1.0",
    url="http://me.com",
    install_requires=['openpyxl'],
    setup_requires=['pytest-runner'],
    tests_require=['lxml'],
    classifiers=[
        # complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers
        'Development Status :: 2 - Pre-Alpha',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.6',
    ],
)

I created a new temp virtualenv, using virtualenvwrapper's mktmpenv, and then executed the following:

$ pip list --format=columns
Package    Version
---------- -------
pip        9.0.1
setuptools 36.2.7
wheel      0.29.0

$ pip install .
Processing ...
Collecting openpyxl (from my-app==0.1.0)
Collecting jdcal (from openpyxl->my-app==0.1.0)
Collecting et-xmlfile (from openpyxl->my-app==0.1.0)
Building wheels for collected packages: my-app
  Running setup.py bdist_wheel for my-app: started
  Running setup.py bdist_wheel for my-app: finished with status 'done'
  Stored in directory: C:\Users\nahawk\AppData\Local\pip\Cache\wheels\49\e2\8d\340d2b19ba48f1a84011f0e649fe957c19efaf34500f0edada
Successfully built my-app
Installing collected packages: jdcal, et-xmlfile, openpyxl, my-app
Successfully installed et-xmlfile-1.0.1 jdcal-1.3 my-app-0.1.0 openpyxl-2.4.8

$ pip list --format=columns
Package    Version
---------- -------
et-xmlfile 1.0.1
jdcal      1.3
my-app     0.1.0
openpyxl   2.4.8
pip        9.0.1
setuptools 36.2.7
wheel      0.29.0
(tmp-60bebb2a3e1151e0) /c/Users/nahawk/code/coke/nsr/nsr-automated-deployment master

Note that lxml defined in tests_require and pytest-runner defined in setup_requires were not installed. So, how do I install them using pip? (Obviously, I'm not looking for pip install lxml pytest-runner)

0 Answers
Related