I'm working on creating a Python package that is somewhat modular in nature and I was wondering what's the best way to go about handling multiple installation configurations?
Take the following setup.py
for the package of a simple document parser:
setup(
name = 'my_document_parser',
...
entry_points = {
'my_document_parser.parsers': [
'markdown = my_document_parser.parsers.misaka:Parser [misaka]',
'textile = my_document_parser.parsers.textile:Parser [textile]'
]
},
install_requires = [
'some_required_package'
],
extras_require = {
'misaka' = ['misaka'],
'textile' = ['textile']
},
...
)
I'd like to make something like the following available:
- A default install
python setup.py install
orpip install my_document_parser
- installs
my_document_parser
,some_required_package
,misaka
- A bare install
- something like
python setup.py install --bare
- installs
my_document_parser
,some_required_package
- something like
- A way to enable other dependencies
- something like
python setup.py install --bare --with-textile
- installs
my_document_parser
,some_required_package
,textile
- something like
This is my first time messing around with Python packages from a developer standpoint, so I'm open to anything anyone has to offer if I'm going about things the wrong way or such.
Thanks.