Given that my library with foobar.py
is setup as such:
\foobar.py
\foobar
\__init__.py
\setup.py
Hierarchy of CLI in the console script:
foobar.py
\cli
\foo
\kungfu
\kungpow
\bar
\blacksheep
\haveyouanywool
[code]:
import click
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@click.group()
@click.version_option()
def cli():
pass
@cli.group(context_settings=CONTEXT_SETTINGS)
def foo():
pass
@cli.group(context_settings=CONTEXT_SETTINGS)
def bar():
pass
@foo.command('kungfu')
def kungfu():
print('bruise lee')
@foo.command('kungpow')
def kungpow():
print('chosen one')
@bar.command('blacksheep')
def blacksheep():
print('bah bah blacksheep')
@bar.command('haveyouanywool')
def haveyouanywool():
print('have you any wool?')
How should I set my entry in setup.py
?
There are many examples but they only show a single command for a single entry point, e.g. Entry Points in setup.py
But is it even possible to setup the console script with how the my foobar.py
click script is structured?
If not, how should I restructure the commands in foobar.py
?
For context, I have this script for the sacremoses
library: https://github.com/alvations/sacremoses/blob/cli/sacremoses.py
But I couldn't figure how to configure the setup.py
to install the sacremoses.py script properly: https://github.com/alvations/sacremoses/blob/cli/setup.py