Gandi / gandi.cli

⚠ ARCHIVED - Command line interface to Gandi.net products using the public API
http://cli.gandi.net/
GNU General Public License v3.0
347 stars 62 forks source link

Error with python-click > 6.7 #268

Closed aegiap closed 5 years ago

aegiap commented 6 years ago

On Debian buster, with a release 1.2 installed and python-click in a version 6.7+git20180829-1 (pre 6.8), the GANDI CLI throw error on bg parameter for some command.

$ gandi vm stop beasdie2
Traceback (most recent call last):
  File "/usr/bin/gandi", line 11, in <module>
    load_entry_point('gandi.cli==1.2', 'console_scripts', 'gandi')()
  File "/usr/lib/python2.7/dist-packages/gandi/cli/__main__.py", line 8, in main
    cli(obj={})
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 758, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 713, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/dist-packages/gandi/cli/core/cli.py", line 162, in invoke
    click.Group.invoke(self, ctx)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 1131, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 1131, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 950, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 551, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 551, in invoke
    return callback(*args, **kwargs)
TypeError: stop() got an unexpected keyword argument 'bg'

The same command is working fine with the same release of gandi.cli (1.2) and python-click 6.7 in a virtualenv.

Could be related to https://github.com/pallets/click/issues/793 which change default in handling the long and short parameters in python-click.

grigouze commented 6 years ago

@aegiap maybe we can patch with https://github.com/Gandi/gandi.cli/pull/271 ?

aegiap commented 6 years ago

@grigouze we need to plan an update of the code to support the change of default handling in the parameters.

jvoisin commented 6 years ago

It would be nice to have the quickfix merged in the master, and a new issue opened for the migration to python-click > 6.7 ♥

grigouze commented 6 years ago

@jvoisin It's merged :smiley_cat:

tombugs commented 5 years ago

Hi all. Is there any update on the migration to python-click > 6.7? We're up to python-click 7.0 now, and there is still this requirement for < 6.7.

grigouze commented 5 years ago

@tombugs yes there is a new PR #276

grigouze commented 5 years ago

Fixed with new release 1.4