Make conf. files linter-compliant #208
Labels
bug
Something isn't working
improvement
Make an existing functionality better
question
Further information is requested
With the current setup of
custom_conf.py
andbuild_requirements.py
, the Mypy linter throws an error because it doesn't see thebuild_requirements.py
file (when it's in the.sphinx
directory -- for some reason, it ignores thesys.path.append('.sphinx/')
config; see How imports are found). Movingbuild_requirements.py
(back) into the same dir as the conf. files solves the problem, but not quite.It only works if the docs are in the root dir of the repo (i.e. not under
docs/
, for example). This is becausebuild_requirements.py
opensrequirements.txt
, but the RTD build system doesn't find this file:Unless the path to open it is specified as:
(Where
docs/
is the dir under which thecustom_conf.py
andbuild_requirements.py
files are.)However, such a change (adding
docs/
to the path to openrequirements.txt
) breaks the CI checks on GitHub because they already have the path specified inautomatic-doc-checks.yml
, and Python is run from there:For the time being, I "fixed" this by adding the following condition to
build_requirements.py
:(I'm taking the docs dir as specified in
custom_conf.py
and stripping the leading/
from it.)But it seems brittle (and it's not really a solution for the underlying problem, which is that Mypy chokes on the default setup.
(I suppose this might be worth considering together with #197.)
The text was updated successfully, but these errors were encountered: