comic / evalutils

evalutils helps users create extensions for grand-challenge.org
https://grand-challenge.org
MIT License
23 stars 9 forks source link

click.IntRange interface has changed and must be adjusted for correct behavior #312

Closed silvandeleemput closed 3 years ago

silvandeleemput commented 3 years ago

Description

I tried to push the changes for #311, but the CI tests keep failing on an IntRange validation error:

----------------------------- Captured stderr call -----------------------------
Usage: evalutils init algorithm [OPTIONS] ALGORITHM_NAME
Try 'evalutils init algorithm -h' for help.

Error: Invalid value for '--req-cpus': 1 is not in the range 1<x<=64.

Upon inspection it seems that the IntRange has an updated interface in the latest click version and now we need to update the creation signatures of the IntRange objects in the cli.py.

It is currently created using:

click.IntRange(1, 64, True)

which in the new version maps to:

click.IntRange(min=1, max=64, min_open=True)

Leading to the observed error.

It should be fixed by using:

click.IntRange(min=1, max=64, clamp=True)

See: https://click.palletsprojects.com/en/8.0.x/api/#click.IntRange