-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix building documentation out of source tree #134
Conversation
Move importing pyngrok after altering `sys.path`. This itrival fix allows buid documentation without have `pyngrok` installed using only source tree. Signed-off-by: Tomasz Kłoczko <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #134 +/- ##
===========================================
- Coverage 92.29% 68.27% -24.02%
===========================================
Files 7 7
Lines 662 662
===========================================
- Hits 611 452 -159
- Misses 51 210 +159 ☔ View full report in Codecov by Sentry. |
Thanks for fixing this! The auto-formatter moved this in the latest release, I'll merge this and also add a comment to ensure it doesn't get moved again. |
Thank you 👍 😄 |
Do you need a new release to resolve your issue, or is this simply being in the |
No .. it is not-so-urgent change/it can wait 😋 |
Running |
Reason for that is very simple [tkloczko@pers-jacek SPECS]$ grep ^%sphinx_build_man python-*spec | wc -l; ls -1 python-*spec | wc -l
692
1238 So .. as you see in +50% build procedures of python modules I'm using the same build procedure lego piece to build python module documentation as man page. %sphinx_build /usr/bin/sphinx-build
%sphinx_build_man() %{expand:\\\
PBR_VERSION=%(v=%{version}; echo ${v%~*}) \\\
PDM_BUILD_SCM_VERSION=%(v=%{version}; echo ${v%~*}) \\\
SETUPTOOLS_SCM_PRETEND_VERSION=%(v=%{version}; echo ${v%~*}) \\\
JARACO_PACKAGING_SPHINX_WHEEL=$(ls -1 $PWD/dist/*whl) \\\
%sphinx_build -n -T -b man %["%{*}"?"%{*}":"docs"] build/sphinx/man} Yes in many cases it requires some additional adjustments like this PR. [tkloczko@pers-jacek SPECS]$ grep "Patch:.*%{name}-add_module_path_in_conf.py.patch" python-*spec | wc -l; grep "Patch:.*%{name}-fix_module_path_in_conf.py.patch" python-*spec| wc -l
244
21 In this case it is clearly visible that procedure which I'm using is possible to use in case +60% of of that population of +1.2k python modules which comes with sphinx rendered documentation .. without fixes like here 😋 |
You will still see warnings with this approach, for example in type linking—for this package specifically, you'll see warnings related to |
Here is sphinx output with this PR + /usr/bin/sphinx-build -n -T -b man docs build/sphinx/man
Running Sphinx v7.2.6
making output directory... done
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
building [mo]: targets for 0 po files that are out of date
writing output...
building [man]: all manpages
updating environment: [new config] 4 added, 0 changed, 0 removed
reading sources... [100%] troubleshooting
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-pyngrok.3 { api integrations troubleshooting } done
build succeeded.
The manual pages are in build/sphinx/man. |
Move importing pyngrok after altering
sys.path
.This itrival fix allows buid documentation without have
pyngrok
installed using only source tree.Description
A clear and concise description of what was changed.
Fixes # (issue number)
Type of Change
Testing Done
A clear and concise description of the new tests added to validate the change as well as any manual testing done.
Checklist
make test
passes with no new errors or warningsmake check
to ensure no new errors or warningsmake docs
to ensure no new errors or warningsWithout that patch documentation build fails with