gnu: csvkit: Fix tests.

* gnu/packages/wireservice.scm (csvkit): Fix tests
[source]: Apply patch.
[native-inputs]: Add (libc-utf8-locales-for-target).
* gnu/packages/patches/csvkit-set-locale-for-tests.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.

Change-Id: I787c0da270fa4062491efcfa0c55a1b8bbac7b59
Signed-off-by: Guillaume Le Vaillant <glv@posteo.net>
This commit is contained in:
Wiktor Żelazny 2024-12-26 10:41:07 +01:00 committed by Guillaume Le Vaillant
parent 16d22911e8
commit 4a4a8c9d26
No known key found for this signature in database
GPG key ID: 6BE8208ADF21FE3F
3 changed files with 20 additions and 4 deletions

View file

@ -1131,6 +1131,7 @@ dist_patch_DATA = \
%D%/packages/patches/crc32c-unbundle-googletest.patch \ %D%/packages/patches/crc32c-unbundle-googletest.patch \
%D%/packages/patches/crda-optional-gcrypt.patch \ %D%/packages/patches/crda-optional-gcrypt.patch \
%D%/packages/patches/clucene-contribs-lib.patch \ %D%/packages/patches/clucene-contribs-lib.patch \
%D%/packages/patches/csvkit-set-locale-for-tests.patch \
%D%/packages/patches/cube-nocheck.patch \ %D%/packages/patches/cube-nocheck.patch \
%D%/packages/patches/cups-minimal-Address-PPD-injection-issues.patch \ %D%/packages/patches/cups-minimal-Address-PPD-injection-issues.patch \
%D%/packages/patches/curl-CVE-2024-8096.patch \ %D%/packages/patches/curl-CVE-2024-8096.patch \

View file

@ -0,0 +1,13 @@
Contents copied from python-agate. See
https://github.com/wireservice/agate/issues/712 for the source and the
rationale.
diff --git a/tests/__init__.py b/tests/__init__.py
index e69de29..ee8beb5 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -0,0 +1,4 @@
+import locale
+
+# The test fixtures can break if the locale is non-US.
+locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')

View file

@ -217,10 +217,13 @@ for xls and xlsx files support to all @code{agate.Table} instances.")))
(uri (pypi-uri "csvkit" version)) (uri (pypi-uri "csvkit" version))
(sha256 (sha256
(base32 (base32
"08wj0hlmbdmklar12cjzqp91vcxzwifsvmgasszas8kbiyvvgpdy")))) "08wj0hlmbdmklar12cjzqp91vcxzwifsvmgasszas8kbiyvvgpdy"))
(patches
(search-patches "csvkit-set-locale-for-tests.patch"))))
(build-system python-build-system) (build-system python-build-system)
(native-inputs (native-inputs
(list python-psycopg2 ; to test PostgreSQL support (list (libc-utf8-locales-for-target)
python-psycopg2 ; to test PostgreSQL support
python-sphinx python-sphinx-rtd-theme)) python-sphinx python-sphinx-rtd-theme))
(inputs (inputs
(list python-agate-dbf python-agate-excel python-agate-sql (list python-agate-dbf python-agate-excel python-agate-sql
@ -234,8 +237,7 @@ for xls and xlsx files support to all @code{agate.Table} instances.")))
(man1 (string-append out "/share/man/man1"))) (man1 (string-append out "/share/man/man1")))
(with-directory-excursion "docs" (with-directory-excursion "docs"
(invoke "make" "man") (invoke "make" "man")
(copy-recursively "_build/man" man1)) (copy-recursively "_build/man" man1))))))))
#t))))))
(home-page "https://csvkit.rtfd.org") (home-page "https://csvkit.rtfd.org")
(synopsis "Command-line tools for working with CSV") (synopsis "Command-line tools for working with CSV")
(description "csvkit is a suite of command-line tools for converting to (description "csvkit is a suite of command-line tools for converting to