Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.maint.python > #8825 > unrolled thread
| Started by | PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> |
|---|---|
| First post | 2016-08-30 09:40 +0200 |
| Last post | 2016-08-31 21:00 +0200 |
| Articles | 6 — 4 participants |
Back to article view | Back to linux.debian.maint.python
how to build sphinx doc when there is extension PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> - 2016-08-30 09:40 +0200
Re: how to build sphinx doc when there is extension Piotr Ożarowski <piotr@debian.org> - 2016-08-30 10:20 +0200
RE:how to build sphinx doc when there is extension PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> - 2016-08-30 10:40 +0200
Re: how to build sphinx doc when there is extension Ben Finney <ben+debian@benfinney.id.au> - 2016-08-30 23:10 +0200
Re: how to build sphinx doc when there is extension Dmitry Shachnev <mitya57@debian.org> - 2016-08-31 20:10 +0200
RE:how to build sphinx doc when there is extension PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> - 2016-08-31 21:00 +0200
| From | PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> |
|---|---|
| Date | 2016-08-30 09:40 +0200 |
| Subject | how to build sphinx doc when there is extension |
| Message-ID | <sbLOi-1No-21@gated-at.bofh.it> |
Hello
I am using this snipset when I want to build the sphinx documentation for all python available. (this is a sort of unit test).
Usually the sphinx doc use auto-doc and then it allows to check that all modules can be imported.
override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
PYBUILD_SYSTEM=custom \
PYBUILD_BUILD_ARGS="cd doc && PYTHONPATH={build_dir} http_proxy='127.0.0.1:9' {interpreter} -c \"import sys;from sphinx import main;sys.exit(main(sys.argv))\" -N -bhtml source build/html" dh_auto_build # HTML generator
dh_installdocs "doc/build/html" -p python-pyfai-doc
dh_sphinxdoc -O--buildsystem=pybuild
endif
I would like your opinion about this and if there is better way to do this ?
thanks
Frederic
[toc] | [next] | [standalone]
| From | Piotr Ożarowski <piotr@debian.org> |
|---|---|
| Date | 2016-08-30 10:20 +0200 |
| Message-ID | <sbMqZ-2gM-1@gated-at.bofh.it> |
| In reply to | #8825 |
[PICCA Frederic-Emmanuel, 2016-08-30]
> I am using this snipset when I want to build the sphinx documentation for all python available. (this is a sort of unit test).
> Usually the sphinx doc use auto-doc and then it allows to check that all modules can be imported.
>
> override_dh_sphinxdoc:
> ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
> PYBUILD_SYSTEM=custom \
> PYBUILD_BUILD_ARGS="cd doc && PYTHONPATH={build_dir} http_proxy='127.0.0.1:9' {interpreter} -c \"import sys;from sphinx import main;sys.exit(main(sys.argv))\" -N -bhtml source build/html" dh_auto_build # HTML generator
> dh_installdocs "doc/build/html" -p python-pyfai-doc
> dh_sphinxdoc -O--buildsystem=pybuild
> endif
>
>
> I would like your opinion about this and if there is better way to do this ?
how about doing it outside pybuild? Do you really need to build it for
each interpreter / version?
If you need the build dir:
override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
PYTHONPATH=$(pybuild --system=custom -i python3 --build --build-args="echo {build_dir}") \
cd doc && http_proxy='127.0.0.1:9' sphinx-build -N -bhtml source build/html
dh_installdocs "doc/build/html" -p python-pyfai-doc
dh_sphinxdoc -O--buildsystem=pybuild
endif
--
Piotr Ożarowski Debian GNU/Linux Developer
www.ozarowski.pl www.griffith.cc www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645
[toc] | [prev] | [next] | [standalone]
| From | PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> |
|---|---|
| Date | 2016-08-30 10:40 +0200 |
| Message-ID | <sbMKl-2qE-9@gated-at.bofh.it> |
| In reply to | #8827 |
> how about doing it outside pybuild? Do you really need to build it for
> each interpreter / version?
It is a sort of unit test during the build that auto-doc works for all versions of the interpreter.
th eunit test is
try to import all the modules provided by a packages.
Is there something whcih can be automatise at the autodep8 level for python ?
> If you need the build dir:
> override_dh_sphinxdoc:
> ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
> PYTHONPATH=$(pybuild --system=custom -i python3 --build --build-args="echo {build_dir}") \
> cd doc && http_proxy='127.0.0.1:9' sphinx-build -N -bhtml source build/html
the problem with sphinx-build is that it use python2
#!/usr/bin/python
this is why I extract the content of sphinx-build directly nthe rules file.
but this is ugly since I have no garantie that this snipset willnot chang ein the near futur.
cheers
Frederic
[toc] | [prev] | [next] | [standalone]
| From | Ben Finney <ben+debian@benfinney.id.au> |
|---|---|
| Date | 2016-08-30 23:10 +0200 |
| Message-ID | <sbYsa-1JI-21@gated-at.bofh.it> |
| In reply to | #8828 |
PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> writes: > > how about doing it outside pybuild? Do you really need to build it for > > each interpreter / version? > > > It is a sort of unit test during the build that auto-doc works for all > versions of the interpreter. You're only installing one version of the documentation, though. Correct? If so, this package is not a good place to do the test you describe. > th eunit test is > try to import all the modules provided by a packages. That isn't a good fit for “build the documentation”. It also does not explain why you try to do it with every interpreter. > Is there something whcih can be automatise at the autodep8 level for > python ? You can start with the tests I have in ‘python-coverage’ <URL:https://sources.debian.net/src/python-coverage/4.2%2Bdfsg.1-1/debian/tests/> which allows you to specify the module names to test. -- \ “Education is learning what you didn't even know you didn't | `\ know.” —Daniel J. Boorstin, historian, 1914–2004 | _o__) | Ben Finney
[toc] | [prev] | [next] | [standalone]
| From | Dmitry Shachnev <mitya57@debian.org> |
|---|---|
| Date | 2016-08-31 20:10 +0200 |
| Message-ID | <sci7v-5IJ-17@gated-at.bofh.it> |
| In reply to | #8825 |
[Multipart message — attachments visible in raw view] — view raw
Hi,
On Tue, Aug 30, 2016 at 07:14:53AM +0000, PICCA Frederic-Emmanuel wrote:
> I am using this snipset when I want to build the sphinx documentation for all python available. (this is a sort of unit test).
> Usually the sphinx doc use auto-doc and then it allows to check that all modules can be imported.
>
> override_dh_sphinxdoc:
> ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
> PYBUILD_SYSTEM=custom \
> PYBUILD_BUILD_ARGS="cd doc && PYTHONPATH={build_dir} http_proxy='127.0.0.1:9' {interpreter} -c \"import sys;from sphinx import main;sys.exit(main(sys.argv))\" -N -bhtml source build/html" dh_auto_build # HTML generator
> dh_installdocs "doc/build/html" -p python-pyfai-doc
> dh_sphinxdoc -O--buildsystem=pybuild
> endif
>
> I would like your opinion about this and if there is better way to do this ?
I agree with Ben that you shouldn’t really be using Sphinx for testing
your source.
But I also want to add that your command line is a too complicated way of
doing a simple thing. You could simply use “{interpreter} -m sphinx [args]”
instead.
--
Dmitry Shachnev
[toc] | [prev] | [next] | [standalone]
| From | PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> |
|---|---|
| Date | 2016-08-31 21:00 +0200 |
| Message-ID | <sciTT-62W-21@gated-at.bofh.it> |
| In reply to | #8832 |
Hello
> I agree with Ben that you shouldn’t really be using Sphinx for testing
> your source.
ok but thanks to this I found some missing binary dependencies during the build process...
so it increased the quality of my packages.
Even if I would prefer a complet unit test suite...
I could put this in the override_auto_test ;)
> But I also want to add that your command line is a too complicated way of
> doing a simple thing. You could simply use “{interpreter} -m sphinx [args]”
Thanks a lot :)), for your help
Cheers
Frederic
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.maint.python
csiph-web