Le 2022-10-30 00:39, Scott Kitterman a écrit :
Adding pybuild-plugin-pyproject to build-depends should solve it. It
looks like it is trying to do the new pyproject.toml style build
without all the necessary parts in place.
the package contain a pyproject.toml file and a setup.py one.
the build system in the pyproject file is setuptools.
[build-system]
requires = ["setuptools", "wheel", "numpy"]
build-backend = "setuptools.build_meta"
So I imagine that under the hood it use the setup.py file.
now it fails with this error message
adding 'xrayutilities-1.7.3.dist-info/top_level.txt'
adding 'xrayutilities-1.7.3.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
* Building wheel...
Successfully built xrayutilities-1.7.3-cp310-cp310-linux_x86_64.whl
I: pybuild plugin_pyproject:118: Unpacking wheel built for python3.10 with "installer" module
E: pybuild pybuild:379: build: plugin pyproject failed with: File already exists: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.10_xrayutilities/build/xrayutilities/VERSION
dh_auto_build: error: pybuild --build -i python{version} -p 3.10 returned exit code 13
make[1]: *** [debian/rules:20: override_dh_auto_build-arch] Error 25
this failure seems to come from the indep part
%:
dh $@ --buildsystem=pybuild
execute_after_dh_auto_clean:
rm -rf build
override_dh_auto_build-arch:
dh_auto_build
override_dh_auto_build-indep: override_dh_auto_build-arch
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
dh_auto_build -- -s custom --build-args="env
PYTHONPATH={build_dir} {interpreter} setup.py build_doc"
endif
since I make the indep part depends on the arch one, it build the
package a second time. and this is during this second reconstruction
that
it failes.
it seems that the arch rules does not gard from a second build, and it
is not indepotent...
$ git diff
diff --git a/debian/control b/debian/control
index 4a702ea..1b746a3 100644
--- a/debian/control
+++ b/debian/control
@@ -10,9 +10,9 @@ Section: science
Priority: optional
Build-Depends:
debhelper-compat (= 13),
- dh-python,
dh-sequence-numpy3,
dh-sequence-python3,
+ pybuild-plugin-pyproject,
python3-all-dev,
python3-h5py,
python3-lmfit,
diff --git a/debian/rules b/debian/rules
index 54c4cb0..089385d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,6 +4,7 @@
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+export DEB_HOST_ARCH?=$(shell dpkg-architecture -qDEB_HOST_ARCH)
# copy the tests to the build dir to be able to pass nose
export PYBUILD_NAME=xrayutilities
@@ -11,18 +12,13 @@ export PYBUILD_BEFORE_TEST=cp -r tests {build_dir}; cp -r examples {build_dir};
export PYBUILD_AFTER_TEST=rm -rf {build_dir}/tests; rm -rf {build_dir}/xrayutilities/materials/data; rm -rf {build_dir}/examples
%:
- dh $@ --buildsystem=pybuild
+ dh $@ --with sphinxdoc --buildsystem=pybuild
-execute_after_dh_auto_clean:
- rm -rf build
-
-override_dh_auto_build-arch:
- dh_auto_build
-
-override_dh_auto_build-indep: override_dh_auto_build-arch
+override_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
- dh_auto_build -- -s custom --build-args="env PYTHONPATH={build_dir} {interpreter} setup.py build_doc"
+ PYTHONPATH=. python3 -m sphinx -b html -N doc/source $(CURDIR)/debian/python-xrayutilities-doc/usr/share/doc/python-xrayutilities-doc/html
+ dh_sphinxdoc
endif
-execute_after_dh_installdocs:
- dh_installdocs -p python-xrayutilities-doc build/sphinx/html
+execute_after_dh_auto_clean:
+ rm -rf build