Install some dependencies only in certain scenarios https://github.com/GiganticDev/gigantic.parser $pip install -e .[development] # from setuptools.py setup( extras_require = dict( development = [ 'pytest-runner', 'coverage', 'pytest', 'pytest-cov', 'pytest-spec', 'pytest-flakes', ], )) Only install pytest when running tests # make pytest-runner a conditional requirement, # per: https://github.com/pytest-dev/pytest-runner#considerations needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv) pytest_runner = ['pytest-runner'] if needs_pytest else []