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

Support Lean 3.15.0 (including widgets) #14

Open
jasonrute opened this issue Jun 3, 2020 · 8 comments
Open

Support Lean 3.15.0 (including widgets) #14

jasonrute opened this issue Jun 3, 2020 · 8 comments
Labels
bug Something isn't working

Comments

@jasonrute
Copy link
Collaborator

The newest version of the lean server now has widgets. Our current code breaks. I think the refactor proposed in #6 (or just adding to the PR #5) could make the lean client more future proof.

@jasonrute
Copy link
Collaborator Author

Specifically, the problems start in Lean 3.15.0. Here is an error when doing an info command:

Traceback (most recent call last):
  File "/tmp/mathlib/scripts/find_and_replace.py", line 152, in <module>
    trio.run(main, path, old, new)
  File "/tmp/mathlib/lean-python-env/lib/python3.7/site-packages/trio/_core/_run.py", line 1718, in run
    raise runner.main_task_outcome.error
  File "/tmp/mathlib/scripts/find_and_replace.py", line 105, in main
    nursery.cancel_scope.cancel()
  File "/tmp/mathlib/lean-python-env/lib/python3.7/site-packages/trio/_core/_run.py", line 723, in __aexit__
    raise combined_error_from_nursery
  File "/tmp/mathlib/lean-python-env/lib/python3.7/site-packages/lean_client/trio_server.py", line 73, in receiver
    resp = parse_response(line.decode())
  File "/tmp/mathlib/lean-python-env/lib/python3.7/site-packages/lean_client/commands.py", line 386, in parse_response
    return InfoResponse.from_dict(dic)
  File "/tmp/mathlib/lean-python-env/lib/python3.7/site-packages/lean_client/commands.py", line 206, in from_dict
    dic['record'] = InfoRecord.from_dict(dic.pop('record'))
  File "/tmp/mathlib/lean-python-env/lib/python3.7/site-packages/lean_client/commands.py", line 197, in from_dict
    return cls(**dic)
TypeError: __init__() got an unexpected keyword argument 'widget'

You can tell widget is now a new key returned in the dictionary.

@jasonrute jasonrute changed the title Support widgets Support Lean 3.15.0 (including widgets) Jun 3, 2020
@jasonrute jasonrute added the bug Something isn't working label Jun 3, 2020
@PatrickMassot
Copy link
Member

It would be nice if the Lean core development could document that kind of changes. Did you see anything there?

@jasonrute
Copy link
Collaborator Author

jasonrute commented Jun 5, 2020

I'm not sure what you mean by "lean core development" and "there". Are you talking about the lean repo? A thread/stream on Zulip? Somewhere else?

@bryangingechen
Copy link

The relevant PR is leanprover-community/lean#258. I think you can ping @EdAyers if you have any questions.

@EdAyers
Copy link
Member

EdAyers commented Jun 5, 2020

Hi, sorry about this. you can add ‘—no-widgets’ or -W to not return any widget info from the server.

@jasonrute
Copy link
Collaborator Author

@EdAyers I think we want to support widgets (They are a cool feature!), but maybe in the future, we can get a heads-up here (in the form of an issue or a PR) if the shape of the data from the lean server is going to change. Thanks!

@jasonrute
Copy link
Collaborator Author

Also, thanks for the flag info! That would be good to know for any apps currently using the server (like my refactor app which I gave Johan).

@PatrickMassot
Copy link
Member

I meant that the Lean server mode is globally undocumented, and it would be nice if new cool features like this widget thing could change that undocumenting tradition.

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
None yet
Development

No branches or pull requests

4 participants