vexcl icon indicating copy to clipboard operation
vexcl copied to clipboard

can't build doc from tarball

Open Alessandro-Barbieri opened this issue 3 years ago • 3 comments

It looks like docs can be built only from git checkout

Running Sphinx v4.0.1                                                                                                  
                                                                                                                                                                                                                                              
Configuration error:                           
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/usr/lib/pypy3.7/site-packages/sphinx/config.py", line 323, in eval_config_file
    exec(code, namespace)
  File "/var/tmp/portage/dev-cpp/vexcl-1.4.2/work/vexcl-1.4.2/docs/conf.py", line 78, in <module>
    version = git_version()
  File "./git_version.py", line 40, in git_version
    raise ValueError("Cannot find the version number!")
ValueError: Cannot find the version number!

Alessandro-Barbieri avatar May 12 '21 14:05 Alessandro-Barbieri

Yes, the docs are supposed to be built from full git tree. The docs are built on readthedocs (https://vexcl.readthedocs.io/en/latest/), so may be it is enough to point there?

It should be possible to provide a fallback here: https://github.com/ddemidov/vexcl/blob/master/docs/git_version.py#L37

for example, using environment variables (PV in ebuild?). A less intrusive (and less Gentoo-specific) option would be to read the version from a file, like it is done here: https://github.com/ddemidov/amgcl/blob/master/git_version.py#L57

The file could be written by the ebuild script I guess.

ddemidov avatar May 12 '21 14:05 ddemidov

That's what I've did here https://github.com/gentoo/guru/commit/d288205bf81177e99b2e867052db04c774f800dd#diff-32a587d54febe5bc38ec43d872734378f7bdedf619d53d2c49d8f9206d499d0eR37

Alessandro-Barbieri avatar May 13 '21 16:05 Alessandro-Barbieri

This looks good. I've added sphinx.ext.autodoc to docs/conf.py to save you one patch: 626aab93d5931cac2dd8887e625ea1bddf7611d9.

ddemidov avatar May 13 '21 16:05 ddemidov