Closed kloczek closed 1 week ago
Q: why documentation build is trying to update some modules? 🤔
OK, I can see why this would happen. We use entrypoints to facilitate extensibility. These entrypoints require a package to be installed. This isn't something that we can really fix - is there a reason that you can't run sphinx with the package installed?
Building package I cannot install anything (build is performed from non-root account) and packaging procedure should not be about installing anything. To be honest I don't understand this approach with entry points .. 🤔
I don't think there should be anything wrong with requiring a package to be installed in order for its documentation to be built. I am not intimately familiar with OS packaging processes, however. Is it possible for you to create a virtual environment that is used during building?
Let me show you something
[tkloczko@pers-jacek SPECS]$ grep %sphinx_build_man -l python-*spec| wc -l; ls -1 python-*.spec | wc -l
671
1217
So it means that I have +1.2k rpm packa build procedures in form of rpm spec files and amongst those files +670 is able to produce man page using sphinx.
That %sphinx_build_man
rpm macro looks like below:
[tkloczko@pers-jacek SPECS]$ rpm -E %sphinx_build_man
\
PBR_VERSION=%{version} \
PDM_BUILD_SCM_VERSION=%{version} \
SETUPTOOLS_SCM_PRETEND_VERSION=%{version} \
JARACO_PACKAGING_SPHINX_WHEEL=$(ls -1 $PWD/dist/*whl) \
/usr/bin/sphinx-build -n -T -b man docs build/sphinx/man
Amongst all those python modules literally NONE requires such special approach which is in this case ..
Q: what makes impossible to use only source tree without installing anything to build documentation? Maybe it is kind of only artificial assumption which is easy to remove from documentation build procedure? 🤔
Building documentation out of ONLY source tree has IMO huge advantage because it provides 100% guarantee that documentation will be build out of source tree ano not out of installed module (which may ne not the same version). 😋
As it was mentioned above, having a package available is kind of standard for python documentation; many even use the plot or other directives to generate docs outputs using the given library;
and indeed I don't see any unusual in the configsl and starting a build in a clean new environment using the usual/standard tools (e.g using tox with e.g. tox -e docs-update
, or RTD) it all works as expected.
So I would suggest closing this issue unless you have a clear path as well as it builds on RTD without problems, so I would suggest closing this issue.
That being said, I also went ahead, uninstalled myst-nb; and run your man page generating command; from the repo directory. Besides a few warnings I didn't run into any issues either.
$ ~/munka/devel/executablebooks/MyST-NB [MAINT_removing_upper_pins L|✚ 1⚑ 1] $ pip uninstall myst-nb
WARNING: Skipping myst-nb as it is not installed.
$ ~/munka/devel/executablebooks/MyST-NB [MAINT_removing_upper_pins L|✚ 1⚑ 1] $ sphinx-build -n -T -b man docs build/sphinx/man
Running Sphinx v8.0.2
loading translations [en]... done
Coconut: Installing Jupyter kernel 'coconut'...
Coconut: Installing Jupyter kernels 'coconut_py', 'coconut_py2', 'coconut_py3'...
Coconut: Successfully installed Jupyter kernels: 'coconut', 'coconut_py', 'coconut_py2', 'coconut_py3'
loading pickled environment... done
myst v4.0.0: MdParserConfig(commonmark_only=False, gfm_only=False, enable_extensions={'dollarmath', 'amsmath', 'deflist', 'colon_fence', 'html_image'}, disable_syntax=[], all_links_external=False, links_external_new_tab=False, url_schemes=('http', 'https', 'mailto', 'ftp'), ref_domains=None, fence_as_directive=set(), number_code_blocks=[], title_to_header=False, heading_anchors=0, heading_slug_func=None, html_meta={}, footnote_sort=True, footnote_transition=True, words_per_minute=200, substitutions={}, linkify_fuzzy_links=True, dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, dmath_double_inline=False, update_mathjax=True, mathjax_classes='tex2jax_process|mathjax_process|math|output_area', enable_checkboxes=False, suppress_warnings=[], highlight_code_blocks=True)
myst-nb v1.1.1: NbParserConfig(custom_formats={'.Rmd': ('jupytext.reads', {'fmt': 'Rmd'}, False)}, metadata_key='mystnb', cell_metadata_key='mystnb', kernel_rgx_aliases={}, eval_name_regex='^[a-zA-Z_][a-zA-Z0-9_]*$', execution_mode='cache', execution_cache_path='', execution_excludepatterns=(), execution_timeout=60, execution_in_temp=False, execution_allow_errors=False, execution_raise_on_error=False, execution_show_tb=False, merge_streams=False, render_plugin='default', remove_code_source=False, remove_code_outputs=False, code_prompt_show='Show code cell {type}', code_prompt_hide='Hide code cell {type}', number_source_lines=False, output_stderr='show', render_text_lexer='myst-ansi', render_error_lexer='ipythontb', render_image_options={}, render_figure_options={}, render_markdown_format='commonmark', output_folder='build', append_css=True, metadata_to_fm=False)
Using jupyter-cache at: /Users/bsipocz/munka/devel/executablebooks/MyST-NB/build/sphinx/.jupyter_cache
building [mo]: targets for 0 po files that are out of date
writing output...
building [man]: all manpages
updating environment: 0 added, 0 changed, 0 removed
reading sources...
looking for now-outdated files... none found
writing... myst-nb.1 { quickstart authoring/index authoring/basics authoring/jupyter-notebooks authoring/text-notebooks authoring/custom-formats computation/index computation/execute computation/coconut-lang render/index render/format_code_cells render/hiding render/interactive render/inline render/glue configuration docutils reference/api reference/changelog reference/contributing } /Users/bsipocz/munka/devel/executablebooks/MyST-NB/docs/render/format_code_cells.md:391: WARNING: No mime type available in priority list for builder 'man' ('custommimetype') [mystnb.mime_priority] [mystnb.mime_priority]
/Users/bsipocz/munka/devel/executablebooks/MyST-NB/docs/render/interactive.md:51: WARNING: No mime type available in priority list for builder 'man' ('text/html') [mystnb.mime_priority] [mystnb.mime_priority]
/Users/bsipocz/munka/devel/executablebooks/MyST-NB/docs/render/interactive.md:51: WARNING: No mime type available in priority list for builder 'man' ('text/html') [mystnb.mime_priority] [mystnb.mime_priority]
/Users/bsipocz/munka/devel/executablebooks/MyST-NB/docs/render/interactive.md:79: WARNING: No mime type available in priority list for builder 'man' ('text/html') [mystnb.mime_priority] [mystnb.mime_priority]
/Users/bsipocz/munka/devel/executablebooks/MyST-NB/docs/render/interactive.md:79: WARNING: No mime type available in priority list for builder 'man' ('application/javascript') [mystnb.mime_priority] [mystnb.mime_priority]
/Users/bsipocz/munka/devel/executablebooks/MyST-NB/docs/render/interactive.md:84: WARNING: No mime type available in priority list for builder 'man' ('text/html') [mystnb.mime_priority] [mystnb.mime_priority]
/Users/bsipocz/munka/devel/executablebooks/MyST-NB/docs/render/interactive.md:84: WARNING: No mime type available in priority list for builder 'man' ('application/javascript') [mystnb.mime_priority] [mystnb.mime_priority]
/Users/bsipocz/munka/devel/executablebooks/MyST-NB/docs/render/interactive.md:84: WARNING: No mime type available in priority list for builder 'man' ('text/html') [mystnb.mime_priority] [mystnb.mime_priority]
/Users/bsipocz/munka/devel/executablebooks/MyST-NB/docs/render/interactive.md:84: WARNING: No mime type available in priority list for builder 'man' ('application/javascript') [mystnb.mime_priority] [mystnb.mime_priority]
/Users/bsipocz/munka/devel/executablebooks/MyST-NB/myst_nb/core/config.py:docstring of myst_nb.core.config.NbParserConfig.get_cell_level_config:1: WARNING: py:class reference target not found: myst_nb.warnings_.MystNBWarnings [ref.class]
/Users/bsipocz/munka/devel/executablebooks/MyST-NB/myst_nb/sphinx_.py:docstring of myst_nb.sphinx_.Parser.env:1: WARNING: py:class reference target not found: SphinxEnvType [ref.class]
done
build succeeded, 11 warnings.
The manual pages are in build/sphinx/man.
Describe the bug
Looks like documentation build still fail.
Reproduce the bug
I'm building documentation without have
myst-nb
installed. It is possible to do that with below patchThat kind of hack is listed in example sphinx conf.py https://www.sphinx-doc.org/en/master/usage/configuration.html#example-of-configuration-file
With that patch documentation build fails with
List your environment
Here is list of installed modules in build env