Skip to content

Commit b572435

Browse files
authored
Merge pull request #107 from bckohan/v2.x.x
v2.2.1
2 parents fb53de0 + 1bc0198 commit b572435

File tree

4 files changed

+8
-33
lines changed

4 files changed

+8
-33
lines changed

django_typer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
model_parser_completer, # noqa: F401
4848
)
4949

50-
VERSION = (2, 2, 0)
50+
VERSION = (2, 2, 1)
5151

5252
__title__ = "Django Typer"
5353
__version__ = ".".join(str(i) for i in VERSION)

django_typer/patch.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -127,33 +127,3 @@ def get_console(stderr: bool = False) -> Console:
127127

128128
strip_ansi = _compat.strip_ansi
129129
_compat.strip_ansi = lambda value: strip_ansi(str(value))
130-
131-
132-
from typer import __version__ as typer_version # noqa: E402
133-
134-
if (0, 4, 0) <= tuple(int(v) for v in typer_version.split(".")) < (0, 13, 0):
135-
from typer import main as typer_main
136-
from typer.models import ParamMeta
137-
138-
upstream_get_click_param = typer_main.get_click_param
139-
140-
def patched_get_click_param(
141-
param: ParamMeta,
142-
) -> t.Tuple[t.Union[click.Argument, click.Option], t.Any]:
143-
"""
144-
Patch this bug: https://github.com/tiangolo/typer/issues/334
145-
146-
This gets shell completions working for arguments. As of 0.9.0 I have
147-
an open PR to fix this problem upstream, but it is enough of an issue
148-
that its worth patching here until it gets merged.
149-
"""
150-
click_param = upstream_get_click_param(param)
151-
if isinstance(click_param[0], click.Argument) and getattr(
152-
param.default, "shell_complete", None
153-
):
154-
click_param[0]._custom_shell_complete = param.default.shell_complete
155-
return click_param
156-
157-
typer_main.get_click_param = patched_get_click_param
158-
else: # pragma: no cover
159-
pass

doc/source/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Change Log
33
==========
44

5+
v2.2.1 (17-AUG-2024)
6+
====================
7+
8+
* Fixed `Remove shell_complete monkey patch when upstream PR is merged. <https://github.com/bckohan/django-typer/issues/66>`_
9+
510
v2.2.0 (26-JUL-2024)
611
====================
712

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-typer"
3-
version = "2.2.0"
3+
version = "2.2.1"
44
description = "Use Typer to define the CLI for your Django management commands."
55
authors = ["Brian Kohan <[email protected]>"]
66
license = "MIT"
@@ -48,7 +48,7 @@ click = "^8.1.0"
4848
# typer's release history is full of breaking changes for minor versions
4949
# given the reliance on some of its private internals we peg the typer
5050
# version very strictly to bug fix releases for specific minor lines.
51-
typer-slim = ">=0.12.0,<0.13.0"
51+
typer-slim = ">=0.12.4,<0.13.0"
5252

5353
# this should track typer's rich dependency, so long as our console
5454
# patches still work - so be sure to test on the low end of the range

0 commit comments

Comments
 (0)