Skip to content

typer 0.12.0 breaks django_typer 1.0.9 #47

@oliverandrich

Description

@oliverandrich

I added django_typer to a fresh project and it pulled as a depedency typer 0.12.0. The result is, that my management commands that use django_typer show the following error message.

Traceback (most recent call last):
  File "/Users/oa/tmp/example_project/./manage.py", line 23, in <module>
    main()
  File "/Users/oa/tmp/example_project/./manage.py", line 19, in main
    execute_from_command_line(sys.argv)
  File "/Users/oa/tmp/example_project/.venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/Users/oa/tmp/example_project/.venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/oa/tmp/example_project/.venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 275, in fetch_command
    klass = load_command_class(app_name, subcommand)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/oa/tmp/example_project/.venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 48, in load_command_class
    module = import_module("%s.management.commands.%s" % (app_name, name))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/Users/oa/tmp/example_project/.venv/lib/python3.12/site-packages/django_tailwind_cli/management/commands/tailwind.py", line 18, in <module>
    from django_typer import TyperCommand, command, initialize
  File "/Users/oa/tmp/example_project/.venv/lib/python3.12/site-packages/django_typer/__init__.py", line 84, in <module>
    from django_typer import patch
  File "/Users/oa/tmp/example_project/.venv/lib/python3.12/site-packages/django_typer/patch.py", line 132, in <module>
    from typer import __version__ as typer_version
ImportError: cannot import name '__version__' from 'typer' (unknown location)

If I pin typer to 0.11.0 by calling poetry add typer==0.11.0 everything is fine again.

It seems as upstream has introduced changes that need to be reflected in django_typer.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdependenciesPull requests that update a dependency file

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions