Skip to content

Instantly share code, notes, and snippets.

@lbillingham
Created April 28, 2016 10:10
Show Gist options
  • Save lbillingham/bf2bc8334b5fc7e2ce0668d7a51bc705 to your computer and use it in GitHub Desktop.
Save lbillingham/bf2bc8334b5fc7e2ce0668d7a51bc705 to your computer and use it in GitHub Desktop.
is this legit in setup.py?
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if 'develop' in sys.argv:
requirements = [i.strip() for i in open("requirements_dev.txt").readlines()]
else:
requirements = [i.strip() for i in open("requirements.txt").readlines()]
setup(
# ...
install_requires=requirements,
)
@d0ugal
Copy link

d0ugal commented Apr 28, 2016

extras_require = {
    'develop':  [i.strip() for i in open("requirements_dev.txt").readlines()],
}

Then pip install package[develop] should install it with the additional requirements.
(where package is the name of your package)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment