Skip to content

Commit

Permalink
release: v0.3.0 (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
eonu authored Jan 3, 2024
2 parents e196e2a + e2c9cc8 commit 6ad53e6
Show file tree
Hide file tree
Showing 27 changed files with 944 additions and 472 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

All notable changes to this project will be documented in this file.

## [v0.3.0](https://github.com/eonu/feud/releases/tag/v0.3.0) - 2024-01-03

### Bug Fixes

- check `__main__` first for module discovery ([#131](https://github.com/eonu/feud/issues/131))
- fix `click` & `pydantic` min. versions + fix `feud.typing` versions ([#133](https://github.com/eonu/feud/issues/133))
- define `__all__` for `feud.typing` module ([#134](https://github.com/eonu/feud/issues/134))

### Documentation

- remove click admonition from `README.md` ([#129](https://github.com/eonu/feud/issues/129))
- remove headings from projects table ([#137](https://github.com/eonu/feud/issues/137))

### Features

- define `feud.click.is_rich` for checking `rich-click` install ([#132](https://github.com/eonu/feud/issues/132))
- add command and option sections ([#136](https://github.com/eonu/feud/issues/136))

## [v0.2.0](https://github.com/eonu/feud/releases/tag/v0.2.0) - 2023-12-27

### Features
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ but still organized in a sensible way.

import feud
from datetime import date
from typing import Literal

class Blog(feud.Group):
"""Manage and serve a blog."""
Expand Down Expand Up @@ -408,8 +409,10 @@ $ python blog.py --help
╭─ Options ──────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────╮
╭─ Command groups ───────────────────────────────────────────────────╮
│ post Manage blog posts. │
╰────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────╮
│ serve Start a local HTTP server. │
╰────────────────────────────────────────────────────────────────────╯
```
Expand Down Expand Up @@ -656,9 +659,6 @@ on the important part – implementing your commands._

### Highly configurable and extensible

> [!IMPORTANT]
> _Feud is **not** the new Click_ - it is an extension of Click and directly depends it.
While designed to be simpler than Click, this comes with the trade-off that
Feud is also more opinionated than Click and only directly implements a subset
of its functionality.
Expand Down Expand Up @@ -855,7 +855,7 @@ maintainers and the work they have done that Feud has built upon.
<tr>
<td>
##### [Click](https://github.com/pallets/click)
[**Click**](https://github.com/pallets/click)
<sup>
Expand All @@ -875,7 +875,7 @@ generated CLI.
<tr>
<td>
##### [Rich Click](https://github.com/ewels/rich-click)
[**Rich Click**](https://github.com/ewels/rich-click)
<sup>
Expand All @@ -894,7 +894,7 @@ A shim around Click that renders help output nicely using
<tr>
<td>
##### [Pydantic](https://github.com/pydantic/pydantic)
[**Pydantic**](https://github.com/pydantic/pydantic)
<sup>
Expand All @@ -916,7 +916,7 @@ types which can also be used as type hints in Feud commands for input validation
<tr>
<td>
##### [Typer](https://github.com/tiangolo/typer)
[**Typer**](https://github.com/tiangolo/typer)
<sup>
Expand All @@ -939,7 +939,7 @@ lacks support for more complex types such as those offered by Pydantic.
<tr>
<td>
##### [Thor](https://github.com/rails/thor)
[**Thor**](https://github.com/rails/thor)
<sup>
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
project = "feud"
copyright = "2023-2025, Feud Developers" # noqa: A001
author = "Edwin Onuonga (eonu)"
release = "0.2.0"
release = "0.3.0"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Contents
sections/core/index
sections/typing/index
sections/decorators/index
sections/config/index
sections/config
sections/exceptions

Indices and tables
Expand Down
File renamed without changes.
12 changes: 0 additions & 12 deletions docs/source/sections/core/command.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ Understanding function signatures
To understand how Feud converts a function into a :py:class:`click.Command`,
consider the following function.

.. tip::

When called with :py:func:`.run`, a function does not need to be manually decorated with :py:func:`.command`.

.. code:: python
# func.py
Expand Down Expand Up @@ -78,14 +74,6 @@ Similarly, when building a :py:class:`click.Command`, Feud treats:
$ python func.py 1 hello --opt1 2.0 --opt2 3
Note that ``--opt1`` is a required option as it has no default specified, whereas ``--opt2`` is not required.

.. tip::

Feud does **not** support command-line *arguments* with default values.

In such a scenario, it is recommended to configure the parameter as a command-line *option*
(by specifying it as a keyword-only parameter instead of a positional parameter),
since an argument with a default value is optional after all.

API reference
-------------
Expand Down
5 changes: 4 additions & 1 deletion docs/source/sections/core/group.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ API reference

.. autoclass:: feud.core.group.Group
:members:
:special-members: __sections__
:exclude-members: from_dict, from_iter, from_module


.. autopydantic_model:: feud.Section
:model-show-json: False
:model-show-config-summary: False
1 change: 1 addition & 0 deletions docs/source/sections/decorators/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ This module consists of decorators that modify :doc:`../core/command` and their
alias.rst
env.rst
rename.rst
section.rst
26 changes: 26 additions & 0 deletions docs/source/sections/decorators/section.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Grouping command options
========================

.. contents:: Table of Contents
:class: this-will-duplicate-information-and-it-is-still-useful-here
:local:
:backlinks: none
:depth: 3

In cases when a command has many options, it can be useful to divide these
options into different sections which are displayed on the command help page.
For instance, basic and advanced options.

The :py:func:`.section` decorator can be used to define these sections for a command.

.. seealso::

:py:obj:`.Group.__sections__()` can be used to similarly partition commands
and subgroups displayed on a :py:class:`.Group` help page.

----

API reference
-------------

.. autofunction:: feud.decorators.section
129 changes: 68 additions & 61 deletions docs/source/sections/typing/pydantic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,72 +37,76 @@ The following commonly used Pydantic types can be used as type hints for Feud co
----

The version number indicates the minimum ``pydantic`` version required to use the type.

If this version requirement is not met, the type is not imported by Feud.

String types
------------

- :py:obj:`pydantic.types.ImportString`
- :py:obj:`pydantic.types.SecretStr`
- :py:obj:`pydantic.types.StrictStr`
- :py:obj:`pydantic.types.constr`
- :py:obj:`pydantic.types.ImportString` (``>= 2.0.3``)
- :py:obj:`pydantic.types.SecretStr` (``>= 2.0.3``)
- :py:obj:`pydantic.types.StrictStr` (``>= 2.0.3``)
- :py:obj:`pydantic.types.constr` (``>= 2.0.3``)

Integer types
-------------

- :py:obj:`pydantic.types.NegativeInt`
- :py:obj:`pydantic.types.NonNegativeInt`
- :py:obj:`pydantic.types.NonPositiveInt`
- :py:obj:`pydantic.types.PositiveInt`
- :py:obj:`pydantic.types.StrictInt`
- :py:obj:`pydantic.types.conint`
- :py:obj:`pydantic.types.NegativeInt` (``>= 2.0.3``)
- :py:obj:`pydantic.types.NonNegativeInt` (``>= 2.0.3``)
- :py:obj:`pydantic.types.NonPositiveInt` (``>= 2.0.3``)
- :py:obj:`pydantic.types.PositiveInt` (``>= 2.0.3``)
- :py:obj:`pydantic.types.StrictInt` (``>= 2.0.3``)
- :py:obj:`pydantic.types.conint` (``>= 2.0.3``)

Float types
-----------

- :py:obj:`pydantic.types.FiniteFloat`
- :py:obj:`pydantic.types.NegativeFloat`
- :py:obj:`pydantic.types.NonNegativeFloat`
- :py:obj:`pydantic.types.NonPositiveFloat`
- :py:obj:`pydantic.types.PositiveFloat`
- :py:obj:`pydantic.types.StrictFloat`
- :py:obj:`pydantic.types.confloat`
- :py:obj:`pydantic.types.FiniteFloat` (``>= 2.0.3``)
- :py:obj:`pydantic.types.NegativeFloat` (``>= 2.0.3``)
- :py:obj:`pydantic.types.NonNegativeFloat` (``>= 2.0.3``)
- :py:obj:`pydantic.types.NonPositiveFloat` (``>= 2.0.3``)
- :py:obj:`pydantic.types.PositiveFloat` (``>= 2.0.3``)
- :py:obj:`pydantic.types.StrictFloat` (``>= 2.0.3``)
- :py:obj:`pydantic.types.confloat` (``>= 2.0.3``)

Sequence types
--------------

- :py:obj:`pydantic.types.confrozenset`
- :py:obj:`pydantic.types.conlist`
- :py:obj:`pydantic.types.conset`
- :py:obj:`pydantic.types.confrozenset` (``>= 2.0.3``)
- :py:obj:`pydantic.types.conlist` (``>= 2.0.3``)
- :py:obj:`pydantic.types.conset` (``>= 2.0.3``)

Datetime types
--------------

- :py:obj:`pydantic.types.AwareDatetime`
- :py:obj:`pydantic.types.FutureDate`
- :py:obj:`pydantic.types.FutureDatetime`
- :py:obj:`pydantic.types.NaiveDatetime`
- :py:obj:`pydantic.types.PastDate`
- :py:obj:`pydantic.types.PastDatetime`
- :py:obj:`pydantic.types.condate`
- :py:obj:`pydantic.types.AwareDatetime` (``>= 2.0.3``)
- :py:obj:`pydantic.types.FutureDate` (``>= 2.0.3``)
- :py:obj:`pydantic.types.FutureDatetime` (``>= 2.0.3``)
- :py:obj:`pydantic.types.NaiveDatetime` (``>= 2.0.3``)
- :py:obj:`pydantic.types.PastDate` (``>= 2.0.3``)
- :py:obj:`pydantic.types.PastDatetime` (``>= 2.0.3``)
- :py:obj:`pydantic.types.condate` (``>= 2.0.3``)

Path types
----------

- :py:obj:`pydantic.types.DirectoryPath`
- :py:obj:`pydantic.types.FilePath`
- :py:obj:`pydantic.types.NewPath`
- :py:obj:`pydantic.types.DirectoryPath` (``>= 2.0.3``)
- :py:obj:`pydantic.types.FilePath` (``>= 2.0.3``)
- :py:obj:`pydantic.types.NewPath` (``>= 2.0.3``)

Decimal type
------------

- :py:obj:`pydantic.types.condecimal`
- :py:obj:`pydantic.types.condecimal` (``>= 2.0.3``)

URL types
---------

- :py:obj:`pydantic.networks.AnyHttpUrl`
- :py:obj:`pydantic.networks.AnyUrl`
- :py:obj:`pydantic.networks.FileUrl`
- :py:obj:`pydantic.networks.HttpUrl`
- :py:obj:`pydantic.networks.AnyHttpUrl` (``>= 2.0.3``)
- :py:obj:`pydantic.networks.AnyUrl` (``>= 2.0.3``)
- :py:obj:`pydantic.networks.FileUrl` (``>= 2.0.3``)
- :py:obj:`pydantic.networks.HttpUrl` (``>= 2.0.3``)

Email types
-----------
Expand All @@ -116,61 +120,64 @@ Email types
$ pip install feud[email]
- :py:obj:`pydantic.networks.EmailStr`
- :py:obj:`pydantic.networks.NameEmail`
- :py:obj:`pydantic.networks.EmailStr` (``>= 2.0.3``)
- :py:obj:`pydantic.networks.NameEmail` (``>= 2.0.3``)

Base-64 types
-------------

- :py:obj:`pydantic.types.Base64Bytes`
- :py:obj:`pydantic.types.Base64Str`
- :py:obj:`pydantic.types.Base64Bytes` (``>= 2.0.3``)
- :py:obj:`pydantic.types.Base64Str` (``>= 2.0.3``)
- :py:obj:`pydantic.types.Base64UrlBytes` (``>= 2.4.0``)
- :py:obj:`pydantic.types.Base64UrlStr` (``>= 2.4.0``)

Byte types
----------

- :py:obj:`pydantic.types.ByteSize`
- :py:obj:`pydantic.types.SecretBytes`
- :py:obj:`pydantic.types.StrictBytes`
- :py:obj:`pydantic.types.conbytes`
- :py:obj:`pydantic.types.ByteSize` (``>= 2.0.3``)
- :py:obj:`pydantic.types.SecretBytes` (``>= 2.0.3``)
- :py:obj:`pydantic.types.StrictBytes` (``>= 2.0.3``)
- :py:obj:`pydantic.types.conbytes` (``>= 2.0.3``)

JSON type
---------

- :py:obj:`pydantic.types.Json`
- :py:obj:`pydantic.types.Json` (``>= 2.0.3``)
- :py:obj:`pydantic.types.JsonValue` (``>= 2.5.0``)

IP address types
----------------

- :py:obj:`pydantic.networks.IPvAnyAddress`
- :py:obj:`pydantic.networks.IPvAnyInterface`
- :py:obj:`pydantic.networks.IPvAnyNetwork`
- :py:obj:`pydantic.networks.IPvAnyAddress` (``>= 2.0.3``)
- :py:obj:`pydantic.networks.IPvAnyInterface` (``>= 2.0.3``)
- :py:obj:`pydantic.networks.IPvAnyNetwork` (``>= 2.0.3``)

Database connection types
-------------------------

- :py:obj:`pydantic.networks.AmqpDsn`
- :py:obj:`pydantic.networks.CockroachDsn`
- :py:obj:`pydantic.networks.KafkaDsn`
- :py:obj:`pydantic.networks.MariaDBDsn`
- :py:obj:`pydantic.networks.MongoDsn`
- :py:obj:`pydantic.networks.MySQLDsn`
- :py:obj:`pydantic.networks.PostgresDsn`
- :py:obj:`pydantic.networks.RedisDsn`
- :py:obj:`pydantic.networks.AmqpDsn` (``>= 2.0.3``)
- :py:obj:`pydantic.networks.CockroachDsn` (``>= 2.0.3``)
- :py:obj:`pydantic.networks.KafkaDsn` (``>= 2.0.3``)
- :py:obj:`pydantic.networks.MariaDBDsn` (``>= 2.0.3``)
- :py:obj:`pydantic.networks.MongoDsn` (``>= 2.0.3``)
- :py:obj:`pydantic.networks.MySQLDsn` (``>= 2.0.3``)
- :py:obj:`pydantic.networks.PostgresDsn` (``>= 2.0.3``)
- :py:obj:`pydantic.networks.RedisDsn` (``>= 2.0.3``)

UUID types
----------

- :py:obj:`pydantic.types.UUID1`
- :py:obj:`pydantic.types.UUID3`
- :py:obj:`pydantic.types.UUID4`
- :py:obj:`pydantic.types.UUID5`
- :py:obj:`pydantic.types.UUID1` (``>= 2.0.3``)
- :py:obj:`pydantic.types.UUID3` (``>= 2.0.3``)
- :py:obj:`pydantic.types.UUID4` (``>= 2.0.3``)
- :py:obj:`pydantic.types.UUID5` (``>= 2.0.3``)

Boolean type
------------

- :py:obj:`pydantic.types.StrictBool`
- :py:obj:`pydantic.types.StrictBool` (``>= 2.0.3``)

Other types
-----------

- :py:obj:`pydantic.functional_validators.SkipValidation`
- :py:obj:`pydantic.functional_validators.SkipValidation` (``>= 2.0.3``)
Loading

0 comments on commit 6ad53e6

Please sign in to comment.