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

TypeError: 'Forward' object is not subscriptable #8

Closed
hhslepicka opened this issue Jul 30, 2020 · 8 comments
Closed

TypeError: 'Forward' object is not subscriptable #8

hhslepicka opened this issue Jul 30, 2020 · 8 comments

Comments

@hhslepicka
Copy link

  • doctr_versions_menu version: 0.2.0
  • Python version: 3.6.7
  • Operating System: Linux

Description

Upload of docs started to fail with doctr-versions-menu 0.2.0.

What I Did

CI started failing with doctr-versions-menu 0.2.0 and Python 3.6.

Traceback (most recent call last):
361  File "/home/travis/virtualenv/python3.6.7/bin/doctr-versions-menu", line 8, in <module>
362    sys.exit(main())
363  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/click/core.py", line 829, in __call__
364    return self.main(*args, **kwargs)
365  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/click/core.py", line 782, in main
366    rv = self.invoke(ctx)
367  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
368    return ctx.invoke(self.callback, **ctx.params)
369  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/click/core.py", line 610, in invoke
370    return callback(*args, **kwargs)
371  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/doctr_versions_menu/cli.py", line 242, in main
372    label_specs=label,
373  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/doctr_versions_menu/version_data.py", line 52, in get_version_data
374    latest = resolve_folder_spec(latest_spec, groups)[-1]
375  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/doctr_versions_menu/folder_spec.py", line 154, in resolve_folder_spec
376    spec_list = _parse_folder_spec(spec, groups, sort_key=sort_key)
377  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/doctr_versions_menu/folder_spec.py", line 121, in _parse_folder_spec
378    + Optional(SliceSpec)
TypeError: 'Forward' object is not subscriptable

More details here: https://travis-ci.com/github/hhslepicka/testproject1234/jobs/366798126#L360-L378

@goerz
Copy link
Owner

goerz commented Jul 30, 2020

Thanks for reporting! I'll look into it...

@hhslepicka
Copy link
Author

@goerz i just found the issue. We need a strict version on pyparsing.
Leaving it open allows for old versions that are no longer compatible with doctr-versions-menu.

Would you mind to add a more strict version at the setup.py to avoid this issue?

@goerz
Copy link
Owner

goerz commented Jul 30, 2020

So it looks like the broken CI had pyparsing 2.4.0, and the one that works has pyparsing 2.4.7... I'll see if I can nail down what the minimum version requirement is, or maybe I can even find some fix that will make it work on all versions.

@hhslepicka
Copy link
Author

Awesome! That was exactly the issue. Thank you!
For now I updated our CI scripts to force an update of pyparsing before running the deploy of the docs.

@goerz goerz closed this as completed in ec705bb Jul 31, 2020
@goerz
Copy link
Owner

goerz commented Jul 31, 2020

Turns out it is easy to write the grammar in such a way that it works with a wider range of pyparsing versions (2.0.2 seems like the oldest one that works, but that's more than 6 years old, so that should be plenty)

@hhslepicka
Copy link
Author

Great! Thank you for addressing this issue so fast. 👍
doctr-versions-menu is great!

@goerz
Copy link
Owner

goerz commented Jul 31, 2020

I'll try to make a 0.3.0 release in the next few days. I still have to decide if I want to resolve #6 for that version, or keep it for later.

@goerz
Copy link
Owner

goerz commented Aug 3, 2020

The 0.3.0 release is out now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants