Repository: mkdocs/mkdocs

Issue:
Update Lunr dependency to 0.5.9
Please consider updating Lunr to the latest version, [0.5.9](https://github.com/yeraydiazdiaz/lunr.py/releases/tag/0.5.9). This avoids the following error without he need to downgrade Lunr:

```python
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 568, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 886, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 777, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (lunr 0.5.9 (/usr/lib/python3.9/site-packages), Requirement.parse('lunr[languages]==0.5.8'), {'mkdocs'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/bin/mkdocs", line 33, in <module>
    sys.exit(load_entry_point('mkdocs==1.1.2', 'console_scripts', 'mkdocs')())
  File "/bin/mkdocs", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/mkdocs/__main__.py", line 14, in <module>
    from mkdocs import utils                                  # noqa: E402
  File "/usr/lib/python3.9/site-packages/mkdocs/utils/__init__.py", line 11, in <module>
    import pkg_resources
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3243, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 570, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 583, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 772, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'lunr[languages]==0.5.8' distribution was not found and is required by mkdocs
```



Discussion:
A PR is always welcome.

<sub>Sent with <a href="http://githawk.com">GitHawk</a></sub>
Brief initial test indicates that the current version of mkdoc is compatible with lunr-0.5.9, it's just blocked by a rigid requirement. 

Changing the requirements line in setup.py is sufficent.

Installed into a venv environment with mkdocs-1.1.2 and lunr-0.5.9:

`'lunr[languages]==0.5.8'` to `'lunr[languages]>=0.5.8'`
Note that the version of `lunr.py` is expect to match the version of `lunr.js` which is included with the themes. A PR will need to both include an updated copy of `lunr.js` along with the updated requirement for `lunr.py`.

For the record, I have asked the developer of `lunr.py` to commit to any future point releases (x.x.x) be bug fixes only and guarantee that any feature releases (x.x) would be compatible. However, he has not made that commitment. If he would make that commitment, then we could require the feature release (x.x) and all point releases within that feature release would be acceptable. However, as long as no such commitment exists, we will need to require a specific version (using `==x.x.x`).

Finally, I am thinking that we should perhaps move the `lunr.py` dependency to be an optional installation. In other words, `lunr.py` would not be installed by default. However, if the user ran `pip install mkdocs[lunrpy]` then it would be installed.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -54,7 +54,7 @@ def get_packages(package):
         'click>=3.3',
         'Jinja2>=2.10.1',
         'livereload>=2.5.1',
-        'lunr[languages]==0.5.8',  # must support lunr.js version included in search
+        'lunr[languages]==0.5.9',  # must support lunr.js version included in search
         'Markdown>=3.2.1',
         'PyYAML>=3.10',
         'tornado>=5.0',


Test patch: