Skip to main content

Option groups and subcommand help sections for pallets/click

Project description

Overview

Master branch

Tests status Coverage Status Documentation Status (master branch)

Latest release

Latest release on PyPI Supported versions Documentation Status (latest release)

Cloup (= Click + groups) contains a set of Click extensions that enable you to:

  • define option groups with a clean API;

  • define constraints, including conditional constraints, on any group of parameters (e.g. mutually_exclusive, RequireAtLeast(1) etc.);

  • (optionally) show an auto-generated description of defined constraints in the command help;

  • organize the subcommands of a MultiCommand in multiple help sections.

These features are implemented in three “mixins” following the same pattern of click-contrib extensions (cooperative multiple inheritance). For ease of use, Cloup also provides:

  • its own versions of Click commands classes, obtained by mixing Click classes with the above mentioned mixins;

  • its own versions of Click command decorators, for creating such commands.

Documentation

Read more in the documentation:

Change Log

v0.6.1 (2021-03-01)

This patch release fixes some problems in the management and releasing of the package.

  • Add a py.typed file to ship the package with type hints (PEP 561).

  • Use setuptools-scm to automatically manage the version of the package and the content of the source distribution based on the git repository:

    • the source distribution now matches the git repository, with the only exception of _version.py, which is not tracked by git; it’s generated by setuptools-scm and included in the package;

    • tox.ini and Makefile were updated to account for the fact that _version.py doesn’t exist in the repository before installing the package.

  • The new attribute cloup.__version_tuple__ stores the version as a tuple (of at least 3 elements).

v0.6.0 (2021-02-28)

Incompatible changes

  • Removed the deprecated GroupSection as previously announced. Use the new name instead: Section.

  • In Group.group() and Group.command, the argument section was moved after the cls argument so that the signatures are now fully compatible with those of the parent class (the Liskov substitution principle is now satisfied). If you (wisely) passed section and cls as keyword arguments in your code, you don’t need to change anything.

Compatible changes

  • Slightly improved return type (hint) of command decorators.

  • Minor refactoring of ConstraintMixin.

  • Improved the documentation.

v0.5.0 (2021-02-10)

Requirements

  • Drop support to Python 3.5.

Deprecated

  • GroupSection was renamed as Section.

Compatible changes and features

  • Added a subpackage for defining constraints on parameters groups (including OptionGroup’s).

  • The code for adding support to option groups was extracted to OptionGroupMixin.

  • Most of the code for adding support to subcommand sections was extracted to SectionMixin.

Project changes

  • Migrated from TravisCI to GitHub Actions.

v0.4.0 (2021-01-10)

Requirements

  • This is the last release officially supporting Python 3.5.

Compatible changes and features

  • Changed the internal (non-public) structure of the package.

  • Minor code improvements.

Repository-wise:

  • New documentation (hosted by ReadTheDocs)

  • Tox, TravisCI, Makefile completely rewritten.

v0.3.0 (2020-03-26)

Backward incompatible API changes

  • option_groups decorator now takes options as positional arguments *options;

  • Group.section decorator now takes sections as positional arguments *sections;

  • align_sections_help was renamed to align_sections;

  • GroupSection.__init__() sorted_ argument was renamed to sorted.

Other changes

  • Additional signature for option_group: you can pass the help argument as 2nd positional argument.

  • Aligned option groups (option align_option_groups with default True).

  • More refactoring and testing.

v0.2.0 (2020-03-11)

  • [Feature] Add possibility of organizing subcommands of a cloup.Group in multiple help sections.

  • Various code improvements.

  • Backward incompatible change:
    • rename CloupCommand and CloupGroup resp. to just Command and Group.

v0.1.0 (2020-02-25)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloup-0.6.1.tar.gz (57.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloup-0.6.1-py2.py3-none-any.whl (23.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file cloup-0.6.1.tar.gz.

File metadata

  • Download URL: cloup-0.6.1.tar.gz
  • Upload date:
  • Size: 57.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.2

File hashes

Hashes for cloup-0.6.1.tar.gz
Algorithm Hash digest
SHA256 9ca3478be1e30e37e24fc7d0d1bff8e58a373279377498cc13ea8635fb859436
MD5 fabda1e63d2534a837ebd08e36963b0b
BLAKE2b-256 edab37b265dc772a547412002d4e3e754d69009d4dcca8f69161981e814896bb

See more details on using hashes here.

File details

Details for the file cloup-0.6.1-py2.py3-none-any.whl.

File metadata

  • Download URL: cloup-0.6.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 23.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.2

File hashes

Hashes for cloup-0.6.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e02f9924d4925281b36277dc812e3409fa2aa8f57ba10d6a2b7e3178a167891d
MD5 c2bcd0a07bdd05e4aec41581a2f82461
BLAKE2b-256 ebfb290a83344da9e6c9a440ce02c9700c1cda2e2f64abbdd716287b29445e5b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page