Control: reassign -1 src:asdf-astropy
Control: tags -1 + patch
Hi!
Looking at the asdf-astropy package, this is a bug in the upstream build
system.
The sequence of steps for building with pybuild's
pybuild-plugin-pyproject plugin is that the upstream build system is
asked to make a wheel, and then python3-installer unpacks the wheel;
looking at the wheels that the upstream build system is producing, they
are missing the data files and python3-installer is faithfully unpacking
these wheels. (Hence reassigning back to src:asdf-astropy.)
The bug is that the upstream build system sometimes produces wheels that
do not contain all the files. Getting data files into packages is
notoriously difficult. There are many sharp edges.
Where setuptools_scm is used, as in asdf-astropy:
- when run inside a git checkout with git installed, all the data files
that are checked into git get included in the wheel.
- when run outside of a git checkout or when git is not installed, the
other setuptools config (pyproject.toml and MANIFEST.in) is used to
find the package files.
The latter accounts for your observation that it depends on what
packages are installed, particularly on the presence of git.
Looking at the config for asdf-astropy, there is not enough config for
setuptools (outside setuptools_scm) to pick up the data files and so
they are missing when built outside of a git checkout.
There are lots of ways to fix this and one needs to figure out
precedence rules across the multiple difference places it can be
configured. In the attached patch, I push the data files into the wheel
by explicitly including it as a 'graft' in MANIFEST.in [1].
[1]
https://setuptools.pypa.io/en/latest/userguide/miscellaneous.html#using-manifest-in
The balance of the attached patch just lets pybuild install the module
as normal.
I see in the packaging that the tests are currently suppressed in
d/rules. The tests would currently fail if the wheel does not contain
all the files because the tests are run against unpacked wheel in
.pybuild/ (not the source - the purpose is to test the packaging, not
test that upstream's CI works). I've not looked at enabling these tests
as it looks like a bit of knowledge about various pytest plugins and
asdf plugins is needed for that.
regards
Stuart
--
Stuart Prescott http://www.nanonanonano.net/ stu...@nanonanonano.net
Debian Developer http://www.debian.org/ stu...@debian.org
GPG fingerprint 90E2 D2C1 AD14 6A1B 7EBB 891D BBC1 7EBB 1396 F2F7
diff --git a/debian/install b/debian/install
deleted file mode 100644
index 390e8a4..0000000
--- a/debian/install
+++ /dev/null
@@ -1 +0,0 @@
-asdf_astropy usr/lib/python3/dist-packages
\ No newline at end of file
diff --git a/debian/patches/manifest.patch b/debian/patches/manifest.patch
new file mode 100644
index 0000000..71eb1d7
--- /dev/null
+++ b/debian/patches/manifest.patch
@@ -0,0 +1,8 @@
+--- a/MANIFEST.in
++++ b/MANIFEST.in
+@@ -4,3 +4,5 @@
+ global-exclude *.pyc
+
+ exclude .*
++
++graft asdf_astropy/resources
diff --git a/debian/patches/series b/debian/patches/series
index de0ed0b..80c4755 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
+manifest.patch
drop-private-API-usage-of-_open_impl.patch
diff --git a/debian/rules b/debian/rules
index 0615868..94c7df1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,6 +2,7 @@
#export DH_VERBOSE=1
export PYBUILD_DISABLE=test
+export PYBUILD_NAME=asdf_astropy
%:
dh $@ --with python3 --buildsystem=pybuild