[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: build package xrayutilities - wheel and pip with setuptools



Hello Frederic,

please could you provide next time direct links to the VCS/Tracker of your package, that prevents time to search for the correct package on my or others people side. Also a speaking subject content is helping me to decide if I want to spend time on taking a look, you've choose a very generic line. :-)

https://tracker.debian.org/pkg/xrayutilities
https://salsa.debian.org/science-team/python-xrayutilities

Am 30.10.22 um 01:08 schrieb picca:
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.

No as you have overwritten the default target by a call that is quite similar to the original pybuild call.

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...

Yes, the environment isn't the same for the second call, you'd need to ensure that the build directory is clean before starting the second run. But I don't see why this construct you've build in d/rules is needed that way.

I can build the package basically doing these modifications and by adding the additional B-D package Scott did mention. Simply let dh_sphinxdoc build the documentation and adding the additional needed package dependencies.

$ 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

lintian has some additional remarks any way, I haven't looked further at these.

--
Regards
Carsten


Reply to: