we-like-parsers / pegen

PEG parser generator for Python
https://we-like-parsers.github.io/pegen/
MIT License
150 stars 32 forks source link

Remove hard dependencies #53

Closed MatthieuDartiailh closed 2 years ago

MatthieuDartiailh commented 2 years ago

Currently we have hard dependencies on psutil, flask and flaks-wtf which seems completely overkill since one can perfectly use pegen without any of those.

MatthieuDartiailh commented 2 years ago

Looking in details at the use of each dependency:

pablogsal commented 2 years ago

Looking in details at the use of each dependency:

  • psutil is used in tests/utils and is already behind a try, except block. I believe it can simply be removed. We could add a 'memory' extra_requires though.
  • flask and flask-wtf are used in the web.py module which provides a web based playground from reading quickly. Do we want to keep it ? @pablogsal If we want to keep this making the dependency optional should not be a problem and allowing to access the module as an executable would make sense (pegen-web-playground ?). It may also duplicate some utilities but I did not check in details yet.

We can make flask and flask-wtf optional, as is not required for the core functionality of pegen. We can make this install under pegen[web] for example. Optionally we could even move this to a separate package, but they may be too much. What are your thoughts?

MatthieuDartiailh commented 2 years ago

I am fine having them under pegen[web] but I will audit the different helpers found in web.py. At first glance they look a lot like some testing helpers.

pablogsal commented 2 years ago

By the way, another thing we can do is to make the generated parsers self-contained, so you don't need pegen installed to run them.

MatthieuDartiailh commented 2 years ago

True. If nobody beats me to it I will look into it but probably after dealing with improving the error reporting of the parser.

lysnikolaou commented 2 years ago

@MatthieuDartiailh Can we close this now?

MatthieuDartiailh commented 2 years ago

I believe so yes. Sorry I forgot to close it.