Package: construct
Version: 2.10.68+dfsg1-2
Severity: normal
Tags: patch
Dear Maintainer,
I'd like to submit a patch for the construct package that fixes the
failure couldn't import the local modules. See the failure in
https://ci.debian.net/packages/c/construct/unstable/amd64/57941369/
I can reproduce this case with the following command in the unstable
distro docker image:
$ autopkgtest . -- null
My patch updates debian/tests/control to add the setting 'PYTHONPATH=.'
in the Test-Command, ensuring the source directory is included in the
module search path, so that the issue of ModuleNotFoundError could be gone.
Thank you for considering this patch attached
Zhixiong
From 2283c9af89ee81d48fc6257018f50f125572362a Mon Sep 17 00:00:00 2001
From: Zhixiong Chi <[email protected]>
Date: Fri, 11 Apr 2025 05:06:23 +0000
Subject: [PATCH] set PYTHONPATH for autopkgtest to locate local modules
Some test modules failed to import local packages during autopkgtest
runs in the stable docker image, resulting in ModuleNotFoundError
(eg: tests.declarativeunittest).
After PYTHONPATH being set, the local modules in the source tree could
be visible to pytest.
This patch updates debian/tests/control to set PYTHONPATH=. in the
Test-Command, ensuring the source directory is included in the module
search path.
This allows pytest to correctly import local modules and avoids
collection-time import errors.
Signed-off-by: Zhixiong Chi <[email protected]>
---
debian/tests/control | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/debian/tests/control b/debian/tests/control
index 716af19..d2f69bb 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,2 @@
-Test-Command: pytest-3 --ignore tests/gallery/ --ignore tests/deprecated_gallery/
+Test-Command: PYTHONPATH=. pytest-3 --ignore tests/gallery/ --ignore tests/deprecated_gallery/
Depends: @builddeps@, @
--
2.47.1