Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #138 #139

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion django_typer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
model_parser_completer, # noqa: F401
)

VERSION = (2, 3, 0)
VERSION = (2, 4, 0)

__title__ = "Django Typer"
__version__ = ".".join(str(i) for i in VERSION)
Expand Down
5 changes: 5 additions & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Change Log
==========

v2.4.0 (2024-11-07)
===================

* Implemented `Support Typer 0.13 <https://github.com/django-commons/django-typer/issues/138>`_

v2.3.0 (2024-10-13)
===================

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "django-typer"
version = "2.3.0"
version = "2.4.0"
description = "Use Typer to define the CLI for your Django management commands."
authors = [
"Brian Kohan <[email protected]>",
Expand Down Expand Up @@ -63,7 +63,7 @@ click = "^8.1.0"
# typer's release history is full of breaking changes for minor versions
# given the reliance on some of its private internals we peg the typer
# version very strictly to bug fix releases for specific minor lines.
typer-slim = ">=0.12.5,<0.13.0"
typer-slim = ">=0.13.0,<0.14.0"

# this should track typer's rich dependency, so long as our console
# patches still work - so be sure to test on the low end of the range
Expand Down
14 changes: 7 additions & 7 deletions tests/test_parser_completers.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,14 @@ def test_ip_field(self):
result = StringIO()
with contextlib.redirect_stdout(result):
call_command("shellcompletion", "complete", "model_fields test --ip ")
result = result.getvalue()
result = result.getvalue().replace("\\", "")
for ip in self.field_values["ip_field"]:
self.assertTrue(ip in result)

result = StringIO()
with contextlib.redirect_stdout(result):
call_command("shellcompletion", "complete", "model_fields test --ip 2001:")
result = result.getvalue()
result = result.getvalue().replace("\\", "")
for ip in ["2001::1"]:
self.assertTrue(ip in result)

Expand All @@ -274,7 +274,7 @@ def test_ip_field(self):
call_command(
"shellcompletion", "complete", "model_fields test --ip 2a02:42"
)
result = result.getvalue()
result = result.getvalue().replace("\\", "")
for ip in ["2a02:42fe::4", "2a02:42ae::4"]:
self.assertTrue(ip in result)

Expand All @@ -283,28 +283,28 @@ def test_ip_field(self):
call_command(
"shellcompletion", "complete", "model_fields test --ip 2a02:42f"
)
result = result.getvalue()
result = result.getvalue().replace("\\", "")
for ip in ["2a02:42fe::4"]:
self.assertTrue(ip in result)

result = StringIO()
with contextlib.redirect_stdout(result):
call_command("shellcompletion", "complete", "model_fields test --ip 192.")
result = result.getvalue()
result = result.getvalue().replace("\\", "")
for ip in ["192.168.1.1", "192.0.2.30"]:
self.assertTrue(ip in result)

result = StringIO()
with contextlib.redirect_stdout(result):
call_command("shellcompletion", "complete", "model_fields test --ip 192.1")
result = result.getvalue()
result = result.getvalue().replace("\\", "")
for ip in ["192.168.1.1"]:
self.assertTrue(ip in result)

result = StringIO()
with contextlib.redirect_stdout(result):
call_command("shellcompletion", "complete", "model_fields test --ip :")
result = result.getvalue()
result = result.getvalue().replace("\\", "")
for ip in ["::ffff:10.10.10.10"]:
self.assertTrue(ip in result)

Expand Down
Loading