ojacques/mkdocs-git-committers-plugin-2

Missing dependency: `lxml`

squidfunk opened this issue · 2 comments

We just removed lxml from our requirements.txt, because we could refactor all uses to the native HTML parser, which makes download and installation of Material for MkDocs much faster. However, now our builds started failing because this plugin uses BeautifulSoup, which relies on the presence of a parser library.

Possible solution: adding lxml to the list of dependencies.

On a more general note, I would recommend not using parsers like BeautifulSoup when building plugins, because they parse the entirety of the content you feed them and construct a tree representation for simple querying. The worst case is that multiple plugins parse the same HTMl over and over again.

In Material for MkDocs, we're always trying to make parsing as efficient as possible:

  • Find relevant segments in the HTML with regular expressions
  • Extract those segments and parse them as fragments by using a streaming parser

See our readtime computation implementation with its parser for reference.

Thanks @squidfunk - indeed, I will be looking at removing / simplifying dependencies. There is nothing that simple request could not handle.