fedora-python / pyp2rpm

Tool to convert a package from PyPI to RPM SPECFILE or to generate SRPM.
MIT License
123 stars 39 forks source link

sphinx-build in %build on EL7 produces an import error for the package being built #116

Open brianjmurrell opened 7 years ago

brianjmurrell commented 7 years ago

I'm trying to build some PyPI packages in Copr and while some build others fail in %build with such:

...
+ sleep 1
+ sphinx-build doc html
Making output directory...
Running Sphinx v1.1.3
Traceback (most recent call last):
  File "generate_rst.py", line 5, in <module>
    import gevent
ImportError: No module named gevent
Exception occurred:
  File "/builddir/build/BUILD/gevent-1.0.1/doc/conf.py", line 64, in <module>
    from gevent import __version__
ImportError: No module named gevent

As can be seen in this log from this package.

I have enough that are failing like this that this must be a common problem, with a common solution?

brianjmurrell commented 7 years ago

I had to set the PYTHONPATH to $PWD:$PWD/doc for the sphinx-build doc html to be successful.

brianjmurrell commented 7 years ago

Hrm. I find that I am having to do this on a number of packages. Is this a problem with the Python packages themselves or is this something that pyp2rpm should be doing?