Documenter.jl: getting documenter to install mkdocs-material on Travis via Python 3?

Created on 13 Feb 2020  路  3Comments  路  Source: JuliaDocs/Documenter.jl

hi. my docs stopped building on Travis recently.

  • the problem is the deploydocs function is failing when installing mkdocs-material
  • it seems that Travis is using Python 2.7. How can I get it to use Python 3 for Deps.pip? Maybe this will solve the problem.

build here
my make.jl here
my travis.yml here

please help me! thanks!

exact Travis build error message:

Installing collected packages: futures, singledispatch, backports-abc, tornado, click, Markdown, MarkupSafe, Jinja2, livereload, mkdocs
Successfully installed Jinja2-2.11.1 Markdown-3.1.1 MarkupSafe-1.1.1 backports-abc-0.5 click-7.0 futures-3.3.0 livereload-2.6.1 mkdocs-1.0.4 singledispatch-3.4.0.3 tornado-5.1.1
You are using pip version 19.0.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting mkdocs-material
  Downloading https://files.pythonhosted.org/packages/8a/47/6b81c9f0ac553b0930d5e74a24a5bc8acdc477bf61a0d87bfce24c306bd2/mkdocs_material-4.6.2-py2.py3-none-any.whl (723kB)
Requirement already satisfied: mkdocs>=1.0 in /home/travis/.local/lib/python2.7/site-packages (from mkdocs-material) (1.0.4)
Collecting mkdocs-minify-plugin>=0.2 (from mkdocs-material)
  Downloading https://files.pythonhosted.org/packages/ba/e6/3b0cf04c430b7c5468fa64c70ee9acfc19dcfebff7d0f796dd5d7664bad2/mkdocs_minify_plugin-0.2.3-py2-none-any.whl
Collecting Pygments>=2.2 (from mkdocs-material)
  Downloading https://files.pythonhosted.org/packages/be/39/32da3184734730c0e4d3fa3b2b5872104668ad6dc1b5a73d8e477e5fe967/Pygments-2.5.2-py2.py3-none-any.whl (896kB)
Collecting markdown>=3.2 (from mkdocs-material)
  Could not find a version that satisfies the requirement markdown>=3.2 (from mkdocs-material) (from versions: 1.7, 2.0, 2.0.1, 2.0.2, 2.0.3, 2.1.0, 2.1.1, 2.2.0, 2.2.1, 2.3, 2.3.1, 2.4, 2.4.1, 2.5, 2.5.1, 2.5.2, 2.6, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.6.6, 2.6.7, 2.6.8, 2.6.9, 2.6.10, 2.6.11, 3.0, 3.0.1, 3.1, 3.1.1)
No matching distribution found for markdown>=3.2 (from mkdocs-material)
You are using pip version 19.0.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
ERROR: LoadError: failed process: Process(`pip install --user mkdocs-material`, ProcessExited(1)) [1]
Stacktrace:
 [1] pipeline_error at ./process.jl:525 [inlined]
 [2] #run#565(::Bool, ::typeof(run), ::Cmd) at ./process.jl:440
 [3] run at ./process.jl:438 [inlined]
 [4] pip(::String, ::Vararg{String,N} where N) at /home/travis/.julia/packages/Documenter/HmOsT/src/Deps.jl:34
 [5] top-level scope at /home/travis/build/SimonEnsemble/Controlz.jl/docs/make.jl:26
 [6] include at ./boot.jl:328 [inlined]
 [7] include_relative(::Module, ::String) at ./loading.jl:1105
 [8] include(::Module, ::String) at ./Base.jl:31
 [9] exec_options(::Base.JLOptions) at ./client.jl:287
 [10] _start() at ./client.jl:460
in expression starting at /home/travis/build/SimonEnsemble/Controlz.jl/docs/make.jl:26
/usr/lib/python3/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
/usr/lib/python3/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
Done. Your build exited with 0.
Markdown Question

All 3 comments

Can confirm, same thing happens for the docs of DynamicalSystems.jl : https://travis-ci.org/JuliaDynamics/DynamicalSystems.jl/jobs/650160176#L696 and its probably because of FINALLY killing Python 2.+

It looks like you need to pin some (or all) of the package versions, in a similar fashion to this, i.e. something like this:

deps = Deps.pip("mkdocs==X.Y.Z", "mkdocs-bootswatch==X.Y.Z", "pymdown-extensions==X.Y.Z")

Not sure what version numbers you should use in place of X.Y.Z though.

In case you do want to try Python 3, you can pass your own closure to deploydocs that will install the dependencies with pip3:

pip3(deps) = () -> map(dep -> run(`pip3 install --user $(dep)`), deps)
deploydocs(..., deps = pip3(...))

It should work, but I didn't test it.

@SimonEnsemble I just noticed -- you're not actually even using the Markdown backend, so the MkDocs-related deps have no effect. You should just remove the deps = ... line and everything should work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BioTurboNick picture BioTurboNick  路  5Comments

jebej picture jebej  路  3Comments

timholy picture timholy  路  6Comments

jonathan-laurent picture jonathan-laurent  路  3Comments

haampie picture haampie  路  3Comments