silx-kit / pyFAI

Fast Azimuthal Integration in Python
Other
104 stars 95 forks source link

[manpages] the BuildMan target does not work during the Debian build process #646

Open picca opened 7 years ago

picca commented 7 years ago

Hello, now thaht I can run the BuildMan via

python setup.py build and the right options during the Debian build, I get this in the generated manpages.

.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.4.
.TH TRACEBACK "1" "July 2017" "Traceback (most recent call last):" "User Commands"
.SH NAME
Traceback \- manual page for Traceback (most recent call last):
.SH DESCRIPTION
.SS "Traceback (most recent call last):"
.IP
File "/tmp/check_calib_u1jdOA", line 2, in <module>
.IP
import pyFAI.app.check_calib as app
.IP
File "/home/picca/Debian/pyfai/pyfai/pyFAI/__init__.py", line 48, in <module>
.IP
raise RuntimeError("Do NOT use %s from its sources: build it and use the built version" % project)
.PP
RuntimeError: Do NOT use pyFAI from its sources: build it and use the built version
[29579 refs]
.IP
File "/tmp/check_calib_u1jdOA", line 2, in <module>
.IP
import pyFAI.app.check_calib as app
.IP
File "/home/picca/Debian/pyfai/pyfai/pyFAI/__init__.py", line 48, in <module>
.IP
raise RuntimeError("Do NOT use %s from its sources: build it and use the built version" % project)
.PP
RuntimeError: Do NOT use pyFAI from its sources: build it and use the built version
[29579 refs]
.SH "SEE ALSO"
The full documentation for
.B Traceback
is maintained as a Texinfo manual.  If the
.B info
and
.B Traceback
programs are properly installed at your site, the command
.IP
.B info Traceback
.PP
should give you access to the complete manual.

As you can see I get a RuntimeError, So the pyFAI loaded by the script is the one from the source. I need to figure out why this is the case.

The first culprite could be the PYTHONPATH modification done in the BuildMan

I would say. never ever modify an USER env in a setup.py script.

this is why in the autotolls you have

CFLAGS and AM_CGLAGS for the maintainer.

this is the principe of less surpise ;)

picca commented 7 years ago

I can confirm that

-        env["PYTHONPATH"] = os.pathsep.join(path)
+        #env["PYTHONPATH"] = os.pathsep.join(path)

solve the issue during the Debian build

vallsv commented 7 years ago

We anyway have to inject the build_lib path to the subprocess. The env of the setup is not the same as the env needed for help2man. How do you execute the BuildMan BTW? I don't understand this part.

We uses

python setup.py build build_man
picca commented 7 years ago

This is how I need to build the manpages.

override_dh_auto_build:
        dh_auto_build
        PYBUILD_SYSTEM=custom \
        PYBUILD_BUILD_ARGS="PYTHONPATH={build_dir} xvfb-run -a --server-args=\"-screen 0 1024x768x24\" {interpreter} setup.py build_man" dh_auto_build

indeed this is done with the PYTHONPATH commented explained previously.

I just discoverd that the build_man failed with python3 when I do not use xvfb. So it seems that with python3 the --help command request a working X windows system. This is not true with python2