Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Read the docs is a bit messy to work with sometimes, because it comes with sphinx<2 pre-installed, so when we run pip install -r doc-requirements.txt it will settle for version 1 unless a dependency forces is to go higher.
But, it seems MyST-Parser have a hard dependency of sphinx>1 due to the following error:
File "/home/docs/checkouts/readthedocs.org/user_builds/zero-to-jupyterhub/envs/latest/lib/python3.7/site-packages/myst_parser/sphinx_renderer.py", line 16, in <module>
from sphinx.project import Project
Due to this, I suggest to add the requirement of sphinx >=2 directly in MyST-Parser.
Z2JH setup that broke
doc-requirements.txt
pydata_sphinx_theme
pyyaml
myst_parser
sphinx-autobuild
sphinx-copybutton
sphinx<3
.readthedocs.yml
# Configuration on how ReadTheDocs (RTD) builds our documentation
# ref: https://readthedocs.org/projects/zero-to-jupyterhub/
# ref: https://docs.readthedocs.io/en/stable/config-file/v2.html
# Required (RTD configuration version)
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/source/conf.py
# Optionally build your docs in additional formats such as PDF and ePub
formats: all
# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
# WARNING: This requirements file will be installed without the pip
# --upgrade flag in an existing environment. This means that if a
# package is specified without a lower boundary, we may end up
# accepting the existing version.
#
# ref: https://github.com/readthedocs/readthedocs.org/blob/0e3df509e7810e46603be47d268273c596e68455/readthedocs/doc_builder/python_environments.py#L335-L344
- requirements: doc/doc-requirements.txt
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
consideRatio commentedon May 9, 2020
Hmmm...
MyST-Parser/setup.py
Lines 40 to 52 in f32bd38
Ah, so MyST-Parser does not require sphinx directly unless specifying it like
myst_parser[sphinx]? Then I wonder what makes sense for Z2JH to declare. There are two sets that could be relevant, bothsphinxandrtd.Suggestions on what to do here? For now, I'll go to Z2JH and make it explicit that we want
sphinx>=2,<3and then I think the issue I ran into may go away, but perhaps there is a change that makes sense for MyST-Parser still given this experience. I'm not sure...[-]Dependency of sphinx>=2 isn't explicit[/-][+]Usage with RTD - sphinx>=2 requirement was optional?[/+]chrisjsewell commentedon May 9, 2020
Hey @consideRatio, thanks for the feedback. As mentioned in the documentation (https://myst-parser.readthedocs.io/en/latest/using/intro.html#installation) you should use the
sphinxextra. Thertdis only really for internal use, to build the docs for this repo.You know you can use
myst-parser[sphinx]in your requirements.txt?consideRatio commentedon May 9, 2020
@chrisjsewell excellent okay I understand, I'll go for
myst-parser[sphinx]in my requirements.txt file.And here I'm confirming what you say makes sense:
MyST-Parser/.readthedocs.yml
Lines 1 to 10 in f32bd38
I'm considering if there is a concrete action point following this. I found the documentation to be good already, and my issue was mostly that I was outdated with the documentation.
But perhaps having
rtdin the setup.py file'sextras_requireis a bit confusing to others as well? It felt to me as it could been a hard requirements for using myst-parser on RTD in general, but it ended up being specifically what this repo needed to build its own opinionated docs.I think what makes sense is to add an inline comment saying that the
rtdpart is what is required for this repo specifically, or extract bothrtdandtestingrequirements out of thesetup.pyfile, but that is probably adding complexity without much benefit.chrisjsewell commentedon May 9, 2020
Ok no problem, I can add a comment in the setup.py 👍
consideRatio commentedon May 9, 2020
@choldgraf and @chrisjsewell for your information, watch out for this.
mlncn commentedon Jun 2, 2020
I was about to open a separate issue for documenting the simplest way to use MyST on ReadTheDocs— i probably still should. 'Cause yeah i saw this documentation itself is hosted on readthedocs but i couldn't follow how, so knew there had to be simpler setups. So thrilled to know about this project, thanks Chris!
choldgraf commentedon Jun 2, 2020
good call @mlncn - I opened up #155 to track it
Use [sphinx] variant of myst-parser