greenape/mktheapidocs

Latest plugin version causes exception with mkdocs 1.2

Closed this issue · 4 comments

Summary

This plugin works only with mkdocs <= 1.1.2. Once you upgrade to 1.2 you get this error (see below) at least because the function watcher was changed to watch, it may be more complicated than a mere name change though. (encountered when executing python -m mkdocs serve)

  File "my_project/venv/lib/python3.8/site-packages/mktheapidocs/plugin.py", line 136, in on_serve
    builder = server.watcher._tasks[config["docs_dir"]]["func"]
AttributeError: 'LiveReloadServer' object has no attribute 'watcher'

Note that the pipfile.lock for this repo has pinned mkdocs at 1.1.2: https://github.com/greenape/mktheapidocs/blob/master/Pipfile.lock#L178.

You can also see a mkdocs issue about this kind of exception: mkdocs/mkdocs#2655

More detailed cause information & recommended solution

The master branch does not have the offending line, it actually appears to have already been updated: https://github.com/greenape/mktheapidocs/blob/master/mktheapidocs/plugin.py#L141

However, last time the pip wheel push CI step succeeded, (July 28th, 2020, hash: 6ff4b88) it still had the old line:

builder = server.watcher._tasks[config["docs_dir"]]["func"]

So, I think that all we need to do is to open a new branch and:

  1. Update this plugin's version to 0.3.0 or 0.2.1 (not sure how you'd want to do it)
  2. Update this file to specify that mkdocs must be < 1.2: https://github.com/greenape/mktheapidocs/blob/master/setup.py#L62
  3. Make any further changes required to the Circle CI configuration so this error stops happening (are wheels immutable?)
  4. While we do that, might also want to update to a later version of python, not forgetting to update this line as well: https://github.com/greenape/mktheapidocs/blob/master/setup.py#L68

I would do it myself except I'm fairly new to the python ecosystem and there may be admin/maintainer level permissions required to troubleshoot Circle CI.

I suspect the CI issue may be as simple as artifact immutability

In general, the fact the Pipfile.lock hasn't been changed in two years is requiring me to decide between this plugin and using recent versions of shared dependencies. Not saying that in a mean way, but, as feedback, this is hurting the modules utility.

Note, you can test mkdocs 1.2 if you just pass the --no-livereload flag like so: python -m mkdocs serve --no-livereload

Tbh I'd recommend going with an alternative if available - I don't currently have time to work on this. Happy to accept PRs, but lack the time for anything beyond that unfortunately!