snakebids icon indicating copy to clipboard operation
snakebids copied to clipboard

Snakebids create docs

Open akhanf opened this issue 1 year ago • 3 comments

The problem

The docs for the CLI (app and snakemake) don't build properly since the snakebids isn't in the requirements.txt for the docs.

Looks like simple fix is to add snakebids to the requirements.txt, any objections to that?

Steps to reproduce

Create an app, say yes to docs: snakebids create test_snakebids

Then make venv (python3.11) for docs/requirements.txt, install them, then from docs/:

sphinx-build . _build_docs

Screenshots

(venv_docs) alik@AFI-CBS-H-10:/local/scratch/test_snakebids/docs$ sphinx-build . _build_docs
Running Sphinx v5.3.0
making output directory... done
myst v1.0.0: MdParserConfig(commonmark_only=False, gfm_only=False, enable_extensions=set(), disable_syntax=[], all_links_external=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_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)
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 4 source files that are out of date
updating environment: [new config] 4 added, 0 changed, 0 removed
reading sources... [100%] usage/snakemake_cli                                                                                                                                                                            
/local/scratch/test_snakebids/docs/usage/app_cli.md:3: ERROR: Failed to import "get_parser" from "test_snakebids.run".
No module named 'test_snakebids'
/local/scratch/test_snakebids/docs/usage/snakemake_cli.md:3: ERROR: Failed to import "get_argument_parser" from "snakebids.snakemake_compat".
No module named 'snakebids'
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] usage/snakemake_cli                                                                                                                                                                             
generating indices... genindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 2 warnings.

akhanf avatar Jun 03 '24 19:06 akhanf

Should be fine, the only thing is we have a test for this, so it looks like we also have a false negative. A fix should also fix the test https://github.com/khanlab/snakebids/blob/816f114247b5aaf506c51bb18e7ee60bed7f99c7/snakebids/tests/test_template.py#L340

pvandyken avatar Jun 04 '24 19:06 pvandyken

Sorry for leaving this so long... I'm just having another look at the docs building because of the test failure that came up on nightly.

Just wondering, normal procedure for building docs is to first install the local project pip install ., then install the requirements, no? With that procedure, snakebids should be installed correctly? At the very least, this is why this problem didn't come up on testing: the tests first install the local repository

pvandyken avatar Jul 23 '24 00:07 pvandyken

With readthedocs it just builds from the docs requirements.

akhanf avatar Jul 23 '24 02:07 akhanf