Commit graph

295 commits

Author SHA1 Message Date
Sebastián Ramírez
413d585f1f
📝 Remove obsolete references to --install-completion for typer.run() scripts (#595)
📝 Remove obsolete references to --install-completion for typer.run() scripts
2023-05-02 06:15:24 +00:00
Sebastián Ramírez
4c6098f9fe 🔖 Release version 0.9.0 2023-05-02 07:14:19 +02:00
Sebastián Ramírez
02f0722750 📝 Update release notes 2023-05-02 07:12:51 +02:00
github-actions
3ce45f1bb5 📝 Update release notes 2023-05-02 05:03:35 +00:00
Sebastián Ramírez
58522bf0fc
📝 Update docs examples for custom param types using Annotated, fix overloads for typer.Argument (#594)
* 📝 Add source examples for custom parameter types with Annotated

*  Add tests for custom parameters with Annotated

* 📝 Update docs for custom parameters with Annotated

* ♻️ Fix overloads default in Argument after Annotated

*  Fix test for custom param types
2023-05-01 22:02:57 -07:00
github-actions
8c59b68c62 📝 Update release notes 2023-05-02 04:20:25 +00:00
github-actions
a28c74bdf8 📝 Update release notes 2023-05-02 04:19:58 +00:00
Ryan Miller Galamb
458a492ed9
Add support for PEP-593 Annotated for specifying options and arguments (#584)
*  Add support for PEP-593 `Annotated` for specifying options and arguments

Implements #184

* Revert things I did to get a 3.6 virtualenv 😅

A lot of the dev dependency packages weren't installable on 3.6, so I
had to remove them from the pyproject.toml.

This commit adds them back

* Fix mypy/lint errors

* Skip coverage on test lines that shouldn't execute

* Missed a spot

* ♻️ Tweak examples and tests with Annotated, add extra examples and tests

* 🔥 Remove Pydantic-specific logic from _typing.py

* 📝 Update docs to use new Annotated examples

* 📝 Add docs introducing Annotated and previous versions

* 🔧 Add commented out MkDocs config for highlighting docs examples

*  Fix tests for Click 7

---------

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-05-01 21:19:19 -07:00
Sebastián Ramírez
1260b8dd93 🔖 Release version 0.8.0 2023-05-01 13:29:07 +02:00
Sebastián Ramírez
32f606a186 📝 Update release notes 2023-05-01 13:27:06 +02:00
github-actions
39ed1e5229 📝 Update release notes 2023-05-01 11:22:19 +00:00
github-actions
0b8c31d028 📝 Update release notes 2023-05-01 11:21:03 +00:00
github-actions
0c418b4a2f 📝 Update release notes 2023-05-01 11:17:13 +00:00
github-actions
a6a578797e 📝 Update release notes 2023-05-01 11:07:03 +00:00
jmills
46154f2fc9
✏ Fix spelling (shinny -> shiny) (#586)
shinny -> shiny
2023-05-01 04:05:30 -07:00
Sebastián Ramírez
606df45a02 📝 Update release notes 2023-05-01 12:59:15 +02:00
github-actions
0ee670f624 📝 Update release notes 2023-05-01 10:52:11 +00:00
Sebastián Ramírez
e7c3467a08
📝 Tweak docs, Custom Types path, main page and READAME colors, broken links (#588)
* 📝 Tweak name for Custom Types

* ✏️ Fix broken internal links in CLI Option autocompletion

* 📝 Update main page docs, remove colors as that renders badly in README

* 📝 Update README, sync with index.md, remove colors for GitHub and PyPI
2023-05-01 03:51:35 -07:00
github-actions
27d0fdeb3f 📝 Update release notes 2023-05-01 10:04:11 +00:00
John Purviance
3e37e01979
Add support for custom types and parsers (updates/builds upon PR #443) (#583)
* Support custom parameter types

While most CLI parameters are strings, ints, etc, we sometimes need custom
types.

Currently typer has no support for it (See #77), and while there are a few hacks, the
likely solution is to add a 'str' argument and parse it inside the main function.

This PR adds support for custom types in 3 different ways:
- Manually specifying a `click_type`
- Manually specifying a `parse` function
- Using a Callable type annotation (It is very common for types to have a string constructor, like `int("1")`)

* Document how to parse custom objects with Typer.

Typer supports parsing of cutom types with:
- A user provided parser class
- A click custom type parser

* 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks

* 📝 Tweak and simplify docs

*  Tweak tests to run scripts and remove pragma: nocover in examples

* 📝 Tweak examples for docs, add types and remove # pragma: nocover

* ♻️ Tweak implementation checking for parser and Click type

---------

Co-authored-by: Paulo Costa <me@paulo.costa.nom.br>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-05-01 03:03:26 -07:00
github-actions
8dd7642d6e 📝 Update release notes 2023-04-25 23:30:29 +00:00
github-actions
50caff2757 📝 Update release notes 2023-02-21 11:05:36 +00:00
github-actions
b9515e88e3 📝 Update release notes 2023-02-03 17:52:27 +00:00
Sebastián Ramírez
6386bcd741
📝 Update docs about helping Typer (#547) 2023-02-03 18:51:55 +01:00
github-actions
1201e7f3b2 📝 Update release notes 2023-01-31 14:11:55 +00:00
github-actions
898ca8f663 📝 Update release notes 2023-01-30 10:35:54 +00:00
github-actions
4ba8226505 📝 Update release notes 2023-01-30 10:29:22 +00:00
github-actions
35c63685ca 📝 Update release notes 2022-12-16 23:10:44 +00:00
github-actions
fbd713a980 📝 Update release notes 2022-12-16 20:46:01 +00:00
github-actions
f6665d9f37 📝 Update release notes 2022-12-16 18:29:42 +00:00
github-actions
e3f746793f 📝 Update release notes 2022-11-14 21:52:28 +00:00
github-actions
e14cf38029 📝 Update release notes 2022-11-11 12:33:26 +00:00
github-actions
40cca5fa92 📝 Update release notes 2022-11-10 21:46:01 +00:00
Xuan (Sean) Hu
915f89b6f8
✏️ Fix typo in datetime docs (#495) 2022-11-10 22:45:09 +01:00
github-actions
95a0dbf532 📝 Update release notes 2022-11-10 10:28:41 +00:00
github-actions
6d1a87b89d 📝 Update release notes 2022-11-09 11:49:18 +00:00
github-actions
f294638786 📝 Update release notes 2022-11-09 11:47:34 +00:00
github-actions
d7c4d0dd0a 📝 Update release notes 2022-11-07 18:02:28 +00:00
github-actions
e001b15262 📝 Update release notes 2022-11-07 17:54:14 +00:00
github-actions
29bec40e89 📝 Update release notes 2022-11-06 15:12:34 +00:00
Oskar Skjærvø Gjølga
9f2d7ebe05
✏️ Add quotes to package name that includes brackets in docs (#475)
Adds quotes to package name with brackets

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-11-06 15:12:01 +00:00
Sebastián Ramírez
6c5698fc90 🔖 Release version 0.7.0 2022-11-05 20:37:40 +01:00
Sebastián Ramírez
aaf3cdd408 📝 Update release notes 2022-11-05 20:24:18 +01:00
github-actions
24d3c39316 📝 Update release notes 2022-11-05 19:23:51 +00:00
Sebastián Ramírez
5e46deb8f7 📝 Update release notes 2022-11-05 17:18:01 +01:00
github-actions
8999df2513 📝 Update release notes 2022-11-05 16:14:17 +00:00
Sebastián Ramírez
36e40806b7
Make typer.run() not add completion scripts by default, it only makes sense in installed apps (#488) 2022-11-05 16:13:37 +00:00
github-actions
bd7dd4cf1c 📝 Update release notes 2022-11-05 14:51:19 +00:00
github-actions
2b0aa7107a 📝 Update release notes 2022-11-05 14:43:19 +00:00
github-actions
ee2b763f9d 📝 Update release notes 2022-11-05 14:41:32 +00:00