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

Broken with mistune 2.0 #130

Closed
reinerh opened this issue Jan 10, 2022 · 4 comments
Closed

Broken with mistune 2.0 #130

reinerh opened this issue Jan 10, 2022 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@reinerh
Copy link

reinerh commented Jan 10, 2022

Debian recently upgraded mistune from 0.8.4 to 2.0.0.
Unfortunately the new version is not backwards compatible and breaks lookatme.

It fails to start with the following error:

Traceback (most recent call last):
  File "/usr/bin/lookatme", line 33, in <module>
    sys.exit(load_entry_point('lookatme==2.3.0', 'console_scripts', 'lookatme')())
  File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/lookatme/__main__.py", line 122, in main
    pres = Presentation(
  File "/usr/lib/python3/dist-packages/lookatme/pres.py", line 54, in __init__
    self.reload(data=input_stream.read())
  File "/usr/lib/python3/dist-packages/lookatme/pres.py", line 87, in reload
    self.meta, self.slides = parser.parse(data)
  File "/usr/lib/python3/dist-packages/lookatme/parser.py", line 33, in parse
    input_data, slides = self.parse_slides(meta, input_data)
  File "/usr/lib/python3/dist-packages/lookatme/parser.py", line 44, in parse_slides
    md = mistune.Markdown()
TypeError: __init__() missing 1 required positional argument: 'renderer'

I tried to change md = mistune.Markdown() with md = mistune.create_markdown(), but then it fails a bit later with:

Traceback (most recent call last):
  File "/usr/bin/lookatme", line 33, in <module>
    sys.exit(load_entry_point('lookatme==2.3.0', 'console_scripts', 'lookatme')())
  File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/lookatme/__main__.py", line 122, in main
    pres = Presentation(
  File "/usr/lib/python3/dist-packages/lookatme/pres.py", line 54, in __init__
    self.reload(data=input_stream.read())
  File "/usr/lib/python3/dist-packages/lookatme/pres.py", line 87, in reload
    self.meta, self.slides = parser.parse(data)
  File "/usr/lib/python3/dist-packages/lookatme/parser.py", line 33, in parse
    input_data, slides = self.parse_slides(meta, input_data)
  File "/usr/lib/python3/dist-packages/lookatme/parser.py", line 50, in parse_slides
    num_hrules, hinfo = self._scan_for_smart_split(tokens)
  File "/usr/lib/python3/dist-packages/lookatme/parser.py", line 121, in _scan_for_smart_split
    hinfo["counts"][token["level"]] += 1
KeyError: 'level'

As many more packages got broken by the upgrade, it looks like the upstream version will get temporarily reverted again in Debian: https://bugs.debian.org/1001591
But in a few months 2.0 will then be the only version available again.

Environment:

  • Debian unstable
  • Lookatme Version 2.3.0
@reinerh reinerh added the bug Something isn't working label Jan 10, 2022
@d0c-s4vage
Copy link
Owner

Thank you for reporting this! Lookatme should probably upgrade to the newer mistune anyways.

@d0c-s4vage d0c-s4vage moved this to 🆕 New in lookatme v3.0 Oct 1, 2022
@d0c-s4vage d0c-s4vage added this to the v3.0 milestone Oct 1, 2022
@d0c-s4vage
Copy link
Owner

I'm closing this as lookatme is moving away from mistune with v3.0.

Repository owner moved this from 🆕 New to ✅ Done in lookatme v3.0 Oct 2, 2022
@aikooo7
Copy link

aikooo7 commented Oct 15, 2023

This is still a issue:

lookatme Apresentação.md                                                                                                           Traceback (most recent call last):                                                                                                     File "/usr/sbin/lookatme", line 33, in <module>                                                                                        sys.exit(load_entry_point('lookatme===-VERSION-', 'console_scripts', 'lookatme')())                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                 File "/usr/lib/python3.11/site-packages/click/core.py", line 1157, in __call__                                                         return self.main(*args, **kwargs)                                                                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                  File "/usr/lib/python3.11/site-packages/click/core.py", line 1078, in main                                                             rv = self.invoke(ctx)                                                                                                                     ^^^^^^^^^^^^^^^^                                                                                                              File "/usr/lib/python3.11/site-packages/click/core.py", line 1434, in invoke                                                           return ctx.invoke(self.callback, **ctx.params)                                                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                     File "/usr/lib/python3.11/site-packages/click/core.py", line 783, in invoke                                                            return __callback(*args, **kwargs)                                                                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                 File "/usr/lib/python3.11/site-packages/lookatme/__main__.py", line 122, in main                                                       pres = Presentation(                                                                                                                        ^^^^^^^^^^^^^                                                                                                               File "/usr/lib/python3.11/site-packages/lookatme/pres.py", line 54, in __init__
    self.reload(data=input_stream.read())
  File "/usr/lib/python3.11/site-packages/lookatme/pres.py", line 87, in reload
    self.meta, self.slides = parser.parse(data)
                             ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/lookatme/parser.py", line 33, in parse
    input_data, slides = self.parse_slides(meta, input_data)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/lookatme/parser.py", line 44, in parse_slides
    md = mistune.Markdown()
         ^^^^^^^^^^^^^^^^^^
TypeError: Markdown.__init__() missing 1 required positional argument: 'renderer'
cat Apresentação.md
   1   │ # This is a Normal Slide
   2   │
   3   │ With some content.
   4   │
   5   │ ---
   6   │
   7   │ # This is a Multi-part Slide
   8   │
   9   │ - This is the first part.
  10   │
  11   │ <!-- stop -->
  12   │
  13   │ - And this is the second part.
  14   │
  15   │ <!-- stop -->
  16   │
  17   │ - Parts are separated by a `<!-- stop -->` paragraph.

I installed using yay -S python-lookatme.

@aikooo7
Copy link

aikooo7 commented Oct 15, 2023

I'm going to ping you @d0c-s4vage just because this is closed and would probably not see it otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants