Package Details: python-xmlformatter 0.2.9-1

Git Clone URL: https://aur.archlinux.org/python-xmlformatter.git (read-only, click to copy)
Package Base: python-xmlformatter
Description: CLI utility and Python library for formatting XML documents
Upstream URL: https://pypi.org/project/xmlformatter
Licenses: MIT
Conflicts: xmlformatter
Provides: xmlformatter
Submitter: carstene1ns
Maintainer: danirod
Last Packager: danirod
Votes: 6
Popularity: 0.000000
First Submitted: 2014-09-04 00:42 (UTC)
Last Updated: 2026-07-09 22:51 (UTC)

Required by (1)

Sources (1)

Latest Comments

danirod commented on 2025-11-29 15:43 (UTC)

This is a tricky bug because I cannot replicate it even when python-xmlformatter is not installed (just to be safe). That's why I did not catch it when upgrading the package to 0.2.8.

However, this PKGBUILD is not compiling from the pypi package; it downloads the Git tag, and the file context.py is indeed in the Git tag. wgetting the package wouldn't change much.

The offending line is a relative import. The original GitHub Action is also testing the package using the same method and it works.

I have the following proposal to make to the PKGBUILD but just to be safe I'd wait for feedback to know if it works or not before making the change in AUR:

diff --git a/PKGBUILD b/PKGBUILD
index a88f6b4..206e21f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -27,7 +27,7 @@ build() {

 check() {
   cd "${_distname}-$pkgver/test"
-  python test_xmlformatter.py
+  python -m pytest
 }

 package() {

At least with this, pytest should figure out the proper syspath so that the relative import works.

frankspace commented on 2025-11-27 19:04 (UTC)

Compilation is failing during check() with the following error:

Traceback (most recent call last):
  File "/build/python-xmlformatter/src/xmlformatter-0.2.8/test/test_xmlformatter.py", line 4, in <module>
    from context import xmlformatter
ModuleNotFoundError: No module named 'context'

It appears that the author somehow left a file out of the tarball uploaded to pypi. One way to solve that problem, albeit probably not an elegant way, is simply to insert wget 'https://raw.githubusercontent.com/pamoller/xmlformatter/refs/heads/master/test/context.py' into the check() function.