pip install --editable .
Trying values-from-environment-variables
$ export GREETER_USERNAME=john
$ greet greet
Hello None!
pip install --editable .
Trying values-from-environment-variables
$ export GREETER_USERNAME=john
$ greet greet
Hello None!
import click | |
CONTEXT_SETTINGS = dict( | |
help_option_names=['-h', '--help'], | |
auto_envvar_prefix='GREETER' | |
) | |
@click.group(context_settings=CONTEXT_SETTINGS) | |
def cli(): | |
pass | |
@cli.command() | |
@click.option('--username') | |
def greet(username): | |
click.echo('Hello %s!' % username) | |
from setuptools import setup | |
setup( | |
name='greet', | |
version='0.1', | |
py_modules=['greet'], | |
install_requires=[ | |
'Click', | |
], | |
entry_points=''' | |
[console_scripts] | |
greet=greet:cli | |
''', | |
) | |