Skip to content

V2.2.2 #110

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

Merged
merged 4 commits into from
Aug 25, 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
19 changes: 14 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13.0-rc.1']
django-version:
- '3.2' # LTS April 2024
- '4.2' # LTS April 2026
Expand All @@ -37,6 +37,12 @@ jobs:
django-version: '5.1'
- python-version: '3.9'
django-version: '5.1'
- python-version: '3.13.0-rc.1'
django-version: '3.2'
- python-version: '3.13.0-rc.1'
django-version: '4.2'
- python-version: '3.13.0-rc.1'
django-version: '5.0'

steps:
- uses: actions/checkout@v4
Expand All @@ -50,6 +56,9 @@ jobs:
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install libopenblas-dev
if: matrix.python-version == '3.13.0-rc.1'
run: sudo apt-get install libopenblas-dev
- name: Install Release Dependencies
run: |
poetry config virtualenvs.in-project true
Expand Down Expand Up @@ -89,10 +98,10 @@ jobs:
python-version: ['3.8', '3.12']
django-version:
- '3.2' # LTS April 2024
- '5.0' # April 2025
- '5.1' # December 2025
exclude:
- python-version: '3.8'
django-version: '5.0'
django-version: '5.1'
- python-version: '3.12'
django-version: '3.2'

Expand Down Expand Up @@ -146,10 +155,10 @@ jobs:
python-version: ['3.8', '3.12']
django-version:
- '3.2' # LTS April 2024
- '5.0' # April 2025
- '5.1' # December 2025
exclude:
- python-version: '3.8'
django-version: '5.0'
django-version: '5.1'
- python-version: '3.12'
django-version: '3.2'

Expand Down
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, 2, 1)
VERSION = (2, 2, 2)

__title__ = "Django Typer"
__version__ = ".".join(str(i) for i in VERSION)
Expand Down
9 changes: 6 additions & 3 deletions django_typer/management/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
patch.apply()

import typer # noqa: E402
from typer.core import MarkupMode # noqa: E402
import typer.core # noqa: E402
from typer.core import TyperCommand as CoreTyperCommand # noqa: E402
from typer.core import TyperGroup as CoreTyperGroup # noqa: E402
from typer.main import get_command as get_typer_command # noqa: E402
Expand Down Expand Up @@ -61,6 +61,9 @@
from typing import ParamSpec


DEFAULT_MARKUP_MODE = getattr(typer.core, "DEFAULT_MARKUP_MODE", None)


__all__ = [
"TyperCommand",
"CommandNode",
Expand Down Expand Up @@ -895,7 +898,7 @@ def __init__(
deprecated: bool = Default(False),
add_completion: bool = True,
# Rich settings
rich_markup_mode: MarkupMode = None,
rich_markup_mode: typer.core.MarkupMode = Default(DEFAULT_MARKUP_MODE),
rich_help_panel: t.Union[str, None] = Default(None),
pretty_exceptions_enable: bool = True,
pretty_exceptions_show_locals: bool = True,
Expand Down Expand Up @@ -1875,7 +1878,7 @@ def __new__(
add_help_option: bool = Default(True),
hidden: bool = Default(False),
deprecated: bool = Default(False),
rich_markup_mode: MarkupMode = None,
rich_markup_mode: typer.core.MarkupMode = Default(DEFAULT_MARKUP_MODE),
rich_help_panel: t.Union[str, None] = Default(None),
pretty_exceptions_enable: t.Union[DefaultPlaceholder, bool] = Default(True),
pretty_exceptions_show_locals: t.Union[DefaultPlaceholder, bool] = Default(
Expand Down
6 changes: 6 additions & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Change Log
==========

v2.2.2 (25-AUG-2024)
====================

* Implemented `Support python 3.13 <https://github.com/bckohan/django-typer/issues/109>`_
* Fixed `typer > 0.12.5 toggles rich help renderings off by default <https://github.com/bckohan/django-typer/issues/108>`_

v2.2.1 (17-AUG-2024)
====================

Expand Down
43 changes: 20 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "django-typer"
version = "2.2.1"
version = "2.2.2"
description = "Use Typer to define the CLI for your Django management commands."
authors = ["Brian Kohan <[email protected]>"]
license = "MIT"
Expand Down Expand Up @@ -29,6 +29,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: Site Management",
"Topic :: Software Development :: Libraries",
Expand All @@ -48,7 +49,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.4,<0.13.0"
typer-slim = ">=0.12.5,<0.13.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 All @@ -61,21 +62,17 @@ typing-extensions = { version = ">=3.7.4.3", markers = "python_version < '3.10'"


[tool.poetry.group.dev.dependencies]
ipdb = "^0.13.13"
pytest-django = "^4.7.0"
pytest-cov = "^4.1.0"
Sphinx = [
{ version = "^7.2.0", markers = "python_version > '3.8'" },
{ version = "^7.0.0", markers = "python_version <= '3.8'" },
]
sphinx-rtd-theme = "^2.0.0"
mypy = "^1.0"
doc8 = "^1.1.1"
aiohttp = "^3.9.1"
readme-renderer = {extras = ["md"], version = ">=42,<44"}
sphinxcontrib-typer = {extras = ["html", "pdf", "png"], version = "^0.3.0", markers="python_version >= '3.9'"}
scikit-learn = "^1.0.0"
pytest-env = "^1.0.0"
ipdb = ">=0.13.13"
pytest-django = ">=4.8.0"
pytest-cov = ">=5.0.0"
Sphinx = ">=7.0"
mypy = ">=1.0"
doc8 = ">=1.1.1"
aiohttp = ">=3.9.1"
readme-renderer = {extras = ["md"], version = ">=42"}
sphinxcontrib-typer = {extras = ["html", "pdf", "png"], version = ">=0.5.0", markers="python_version >= '3.9'"}
scikit-learn = ">=1.0.0"
pytest-env = ">=1.0.0"
numpy = [
{ version = ">=1.26", markers = "python_version > '3.8'" },
{ version = "<=1.24", markers = "python_version <= '3.8'" },
Expand All @@ -85,12 +82,12 @@ scipy = [
{ version = "<=1.10", markers = "python_version <= '3.8'" },
]
django-stubs = ">=4.2.7"
pexpect = "^4.9.0"
pyright = "^1.1.357"
ruff = "^0.4.1"
graphviz = "^0.20.3"
sphinx-tabs = "^3.4.5"
furo = "^2024.7.18"
pexpect = ">=4.9.0"
pyright = ">=1.1.357"
ruff = ">=0.4.1"
graphviz = ">=0.20.3"
sphinx-tabs = ">=3.4.5"
furo = ">=2024.7.18"

[tool.poetry.extras]
rich = ["rich"]
Expand Down
2 changes: 2 additions & 0 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ def test_basic(self):
observed_help = run_command(
"basic", "--settings", self.settings, "--no-color", "--help"
)[0].strip()
# import ipdb
# ipdb.set_trace()
self.assertGreater(
similarity(
observed_help, basic_help if rich_installed else basic_help_no_rich
Expand Down
Loading