[PATCH 1 of 3 PoC] cli: initial introduction of 'kallithea' command
Thomas De Schampheleire
patrickdepinguin at gmail.com
Wed Sep 26 19:03:38 UTC 2018
El mié., 26 sept. 2018 a las 13:00, Mads Kiilerich
(<mads at kiilerich.com>) escribió:
>
> 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.
Yes, I have had the same consideration. I had a look at 'Flask', a
micro web framework (which is also using click), and they are also
using 'flask' for the command-line tool although it is not 'Flask',
the project.
We could use 'kallithea-cli' as name, or kallithea-setup, whatever you prefer.
>
> (But I guess, 'serve' could perhaps also be built in ...)
You mean wrapping 'gearbox serve' within the new CLI command?
One reason against it would be that 'gearbox serve' is just one way of
starting the serving. It does not apply when using Apache, uwsgi, or
other approaches.
>
>
> > 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.
To be clear: for me it's also the first time.
>
>
> > 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.
You're right. I added Alessandro Molina to this mail thread.
Alessandro: background is this series:
https://lists.sfconservancy.org/pipermail/kallithea-general/2018q3/002753.html
which introduces a CLI tool to implement our custom Kallithea CLI
commands, using the Click python library.
This CLI tool would cover the commands that we are currently running
via gearbox, i.e. things in 'kallithea/lib/paster_commands/*.py'
>From my current point of view, there is no practical benefit on using
gearbox for these custom commands, rather than something else. As it
happens, Click has as main purpose providing a CLI, and feels more
intuitive to me.
Perhaps I'm missing something, so your feedback is very welcome!
Best regards,
Thomas
More information about the kallithea-general
mailing list