readthedocs.org icon indicating copy to clipboard operation
readthedocs.org copied to clipboard

Upgrade the version of mkdocs that readthedocs uses to one that isn't broken

Open mcarans opened this issue 2 years ago • 5 comments

Details

Failing build: https://readthedocs.org/projects/hdx-python-country/builds/16574497/

Fixed build with forced install of mkdocs 1.3.0: https://readthedocs.org/projects/hdx-python-country/builds/16574520/

jinja2 3.1.0 breaks version of mkdocs before 1.2.4 and I get another error in my failing build "ImportError: cannot import name 'Sequence' from 'collections'". Both these errors are fixed by newer mkdocs.

mcarans avatar Apr 06 '22 05:04 mcarans

I think the error you are seeing is because you are using Python 3.10 together with mkdocs<1.1 (the version that RTD installs by default). It does work with 3.9, but it doesn't with 3.10

▶ python
Python 3.9.7 (default, Nov  3 2021, 12:39:37) 
[GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import Sequence, namedtuple
<stdin>:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
>>>

We cannot easily upgrade the default version we are installing because there are a lot of projects that rely on that version. Then, if we upgrade the default mkdocs version, all those projects will be broken. We have been talking about writing a deprecation policy to allow us to move forward and keep the dependencies up to date, but we are not sure yet what's the best way to do it.

humitos avatar Apr 06 '22 09:04 humitos

I just realized that we fixed the problem related to Jinjja for Sphinx 1.8.x (https://github.com/readthedocs/readthedocs.org/pull/9036/) but we may need to do the same for MkDocs, cc @ericholscher

humitos avatar Apr 06 '22 09:04 humitos

Can confirm, the issue occurs for me also. Here's a recent build.

Thank you.

mike-eason avatar Apr 07 '22 15:04 mike-eason

Thanks for writing in. You can install whatever version of mkdocs you'd like with our platform: https://docs.readthedocs.io/en/latest/guides/reproducible-builds.html#reproducible-builds

We will work to upgrade the default version however, since that's not a great experience to have it broken.

ericholscher avatar Apr 07 '22 16:04 ericholscher

I got this same error "ImportError: cannot import name 'Sequence' from 'collections'".

Forcing the build to install mkdocs 1.3.0 worked for me to solve this.

jamiehewitt15 avatar Jun 27 '22 13:06 jamiehewitt15

Starting on August 7, Read the Docs will start installing the latest MkDocs version available. See https://blog.readthedocs.com/python-core-requirements-changed/

humitos avatar Jul 12 '23 08:07 humitos