[PATCH 1 of 3 PoC] cli: initial introduction of 'kallithea' command
Mads Kiilerich
mads at kiilerich.com
Wed Sep 26 11:00:02 UTC 2018
On 9/24/18 10:45 PM, Thomas De Schampheleire wrote:
> # HG changeset patch
> # User Thomas De Schampheleire <thomas.de_schampheleire at nokia.com>
> # Date 1537819512 -7200
> # Mon Sep 24 22:05:12 2018 +0200
> # Node ID dd4da443ed94fd93ca09d5f5fd9cf1b2c72b3cc4
> # Parent a73e2822dd99eb5bdc551174d9d4f9c76f8f1667
> cli: initial introduction of 'kallithea' command
>
> This commit adds a command 'kallithea' that intends to replace the existing
> set of 'gearbox' commands that relate to setting up kallithea. Gearbox
> would still be used for 'gearbox serve', but other commands like
> 'make-config', 'setup-db', etc. would be converted to 'kallithea' commands.
I like this. I like to try to get this thing right, so our releases
don't change the same thing over and over, but once it has been changed,
we get it right and stick to it.
One concern could be that this command "isn't Kallithea". Kallithea
"itself" must be run from gearbox or another web/wsgi server. That can
be confusing. The command is more about Kallithea
management/install/setup/control/something.
(But I guess, 'serve' could perhaps also be built in ...)
> The python package 'Click' is used to generate the CLI. Using decorators,
> this package makes it very easy to generate a CLI out of simple methods.
> See: http://click.pocoo.org/6/
I haven't used that package before, but it seems solid.
> Using Gearbox for custom commands is possible, but documentation on this
> topic is limited. As the added value of Gearbox for that use case is not
> clear, we can well switch to something else if it seems better/easier.
Gearbox is closely related to TurboGears ... and TurboGeards upstream
have been quite helpful. Should we reach out with our concerns before
switching? I don't know how that could help, but it seems like the right
thing to do.
> diff --git a/setup.py b/setup.py
> --- a/setup.py
> +++ b/setup.py
> @@ -60,6 +60,7 @@ requirements = [
> "mercurial >= 4.1.1, < 4.8",
> "decorator >= 3.3.2, < 4.4",
> "Paste >= 2.0.3, < 3",
> + "Click >= 6.7, < 7",
> ]
>
> if sys.version_info < (2, 7):
> @@ -151,6 +152,7 @@ setuptools.setup(
> kallithea-api = kallithea.bin.kallithea_api:main
> kallithea-gist = kallithea.bin.kallithea_gist:main
> kallithea-config = kallithea.bin.kallithea_config:main
> + kallithea = kallithea.bin.kallithea_cli:cli
I forgot about these other commands we have ... I guess I should review
these too ...
/Mads
More information about the kallithea-general
mailing list