On 15. 02. 19 17:57, Gabriel L. Somlo wrote:
I'm trying to package 'migen':

http://www.contrib.andrew.cmu.edu/~somlo/python-migen-rpm/python-migen.spec

The sources come with a ./doc directory that uses sphinx-build to
generate documentation, and a ./doc/conf.py file which imports
the package being built, in order to automatically paste various
code and doc bits from the module into the resulting documentation
...
make: Entering directory 
'/builddir/build/BUILD/migen-afe4405becdbc76539f0195c319367187012b05e/doc'
sphinx-build -b man -d _build/doctrees   . _build/man
Running Sphinx v1.7.5
make: Leaving directory 
'/builddir/build/BUILD/migen-afe4405becdbc76539f0195c319367187012b05e/doc'

Configuration error:
There is a programable error in your configuration file:

Traceback (most recent call last):
   ...
pkg_resources.DistributionNotFound: The 'migen' distribution was not found and 
is required by the application


This is tricky. It doesn't import it (that is easily tricked with PYTHONPATH), but uses pkg_resources to fetch data about installed packages.

I believe the easiest way is to sed conf.py to replace

  pkg_resources.require("migen")[0].version

with the version.


Another hacky solution:

Crate a --system-site-packages venv, install the package to that venv, build docs from that venv, destroy the venv.


A less hacky theoretical solution:

Build docs after %py3_install.
Explain pkg_resources that you package is installed in a custom dir.
I'm however not aware of a way to do so.


--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
_______________________________________________
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org

Reply via email to