Hi,
On Thu, 09 Jun 2022 at 08:38:40 +0200, Marc Haber wrote:
On Thu, Jun 09, 2022 at 02:28:48PM +0800, Paul Wise wrote:
On Thu, 2022-06-09 at 07:28 +0200, Marc Haber wrote:
I am working on a package written in python that thankfully has a
test suite. Unfortunately, one of the tests fails if the en_GB.UTF-8
locale is not present.
Any idea why the test requires that locale? Tried C.UTF-8?
I havent looked at the test in detail, I have not yet decided whether
the package would be helpful in Debian. It looks like the test has en_GB.UTF-8 hardcoded, sets the locale to that value and then fails
it it's not there. Most likely it's the home locale of the dev.
How do I solve this? Do I need to build-depend on the locales-all
package or is there a less ugly way?
I think that using locales-all is currently the only way to ensure that
a specific locale other than C/C.UTF-8 is installed.
And build-depending on that is not bad in some way?
If a single locale is needed then an alternative is to ‘Build-Depends: locales’ — which is much smaller than locales-all — and generate the desired locale at build time (and/or via autopkgtests):
debian/control:
Build-Depends: […], locales <!nocheck>
debian/rules:
override_dh_auto_test:
[ -d tests/.locale ] || mkdir tests/.locale
localedef -c -i en_GB -f UTF-8 tests/.locale/en_GB.utf8
env LOCPATH=$(CURDIR)/tests/.locale test_command
debian/clean:
tests/.locale/
At least this is what I've done in a similar situation. I don't know
if that's better or worse than Build-Depends: locales-all :-)
Cheers
--
Guilhem.
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEERpy6p3b9sfzUdbME05pJnDwhpVIFAmKhzrsACgkQ05pJnDwh pVJyjxAAn/NbXY6w0w63xOcVo3LLITTn0Eblsjc8jAh5l1vF0n/wGxwJCDe8fiuH GJD0laTSX7OD1IhCD3SruRGnsv4gYNxOL4VIcjXVg+beC2W56BvYEUkppvD3djHi 9YUbpeRRJgOarmL2R69ALfmACUozS+Z1svfBm+0mg+rISiE+Ap4stvFdvn/doL+p Mt83Udc0cMMlsWCt6uff2Fep7y8U9MwfQeKOVLUkfpve+B+Ga1CL8IMFobyi/CJG IFn9E9eGyMvQA/cjeTxKNGovBfkzy2LDD0PugItRrxtDc8sfK8nhtzSB7JP/n899 hY14pkY46ymu1EsQy3dSHy1LoJ4+1sPkHBYVj+UvQezcP+0GFx2hqKWLHAwipo+v etlxr+ZLpek3PX4QYlj3FlTE5x3Fv9HFmc7aGXl0LPU3i/7esIzZTbz67N27aGsT 88p5Gk+yhvpltJNuSK3VvKZ999SjwdaF85PLvOMhvsyCVOdYfG2ZY/ezXbyZGCT0 nRKi751c8tazT9NJbe1NrOesYEUa5UcQNUQ3FhwIT3dfQlEyzYP0XxTj53KeiHy8 1LE/+lQdwYt0YcTd0ydlZN0BCbHs5IeIa0/DSC2UbYJEWz3CKn20Xi7qB6//S9jp d/q22z+yH4iMGXxBN20zRWmuWg2933QoOlPHmk5vK/dKQ/fsBAE=
=coOb
-----END PGP SIGNATURE-----
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)