Skip to content

Commit

Permalink
Refactor options around params= argument. Closes #173.
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeldycke committed Jul 26, 2022
1 parent d9bd7e8 commit 9031b7c
Show file tree
Hide file tree
Showing 17 changed files with 1,021 additions and 637 deletions.
13 changes: 13 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
This version is not released yet and is under active development.
```

- Make default extra features optional, so `click_extra` can act as a drop-in replacement for `click` and `cloup` (closes {issue}`173`):
- Rename `click_extra.group` to `click_extra.extra_group`.
- Rename `click_extra.command` to `click_extra.extra_command`.
- Alias `click_extra.group` to `cloup.group`.
- Alias `click_extra.command` to `cloup.group`.
- Use declarative `params=` argument to set defaults options on `extra_command` and `extra_group`.
- Rewrite all options as classes instead of decorators only.
- Duplicate `click.version_option` code to allow for more flexibility,
- Make all custom options inherits from `ExtraOption` class.
- New `extra_option_at_end` to `extra_command` to move all extra options to the end by default.
- Add a tutorial in documentation.
- Add support for `.. click:example::` and `.. click:run::` directives in documentation.
- Add `pallets_sphinx_themes` dependency.
- Pre-compute test matrix to allow for a subset of jobs to fail because they're unstable.
- Run tests on `ubuntu-22.04` and `macos-12`.
- Remove tests on `macos-10.15`, its been deprecated by GitHub.
Expand Down
25 changes: 20 additions & 5 deletions click_extra/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,30 @@
Option,
Style,
argument,
command,
group,
option,
option_group,
)

from .parameters import ExtraOption # isort:skip

# Replace some of click defaults with click-extra variant.
from .colorize import color_option, version_option
from .config import config_option
from .logging import verbosity_option
from .tabulate import table_format_option
from .colorize import ( # isort:skip
ColorOption,
HelpOption,
VersionOption,
color_option,
help_option,
version_option,
)
from .config import ConfigOption, config_option # isort:skip
from .logging import VerbosityOption, verbosity_option # isort:skip
from .tabulate import table_format_option # isort:skip

# Import last to avoid circular dependencies.
from .commands import command, group, timer_option # isort:skip
from .commands import ( # isort:skip
extra_command,
extra_group,
timer_option,
)
Loading

0 comments on commit 9031b7c

Please sign in to comment.