Source: python-formencode
Version: 2.1.0-3
Severity: serious
Justification: Policy 5.6.30 autopkgtests to test packages
X-Debbugs-Cc: stu...@debian.org

Dear Maintainer,

The autopkgtest for python-formencode fails trying to import cgi,
despite this being protected in the code:

```
-import cgi
+try:
+    import cgi
+except ImportError:  # Python >= 3.13
+    cgi = None

```

```
179s   File 
"/tmp/tmp.ragNVqzDlz/testve/lib/python3.13/site-packages/formencode/validators.py",
 line 8, in <module>
179s     import cgi
179s ModuleNotFoundError: No module named 'cgi'
```

The reason is that the testfe-setuptools test is downloading the wheel
for python-formencode from pypi, rather than testing the packaged code.

```
175s Processing ./mypkg
175s   Installing build dependencies: started
177s   Installing build dependencies: finished with status 'done'
177s   Getting requirements to build wheel: started
178s   Getting requirements to build wheel: finished with status 'done'
178s   Preparing metadata (pyproject.toml): started
178s   Preparing metadata (pyproject.toml): finished with status 'done'
178s Collecting FormEncode>=2.0.0 (from testlib==0.0.1)
178s   Downloading FormEncode-2.1.0-py3-none-any.whl.metadata (2.6 kB)
178s Downloading FormEncode-2.1.0-py3-none-any.whl (179 kB)
178s Building wheels for collected packages: testlib
178s   Building wheel for testlib (pyproject.toml): started
178s   Building wheel for testlib (pyproject.toml): finished with status 'done'
178s   Created wheel for testlib: filename=testlib-0.0.1-py3-none-any.whl 
size=2160 
sha256=1aa083f239c6619c0268041352d9be133a0199edd4f62452662ce2bec24c629b
178s   Stored in directory: 
/tmp/pip-ephem-wheel-cache-2w10qcp7/wheels/a9/53/73/fc687042e85b74223bbd3af9c9f7c0579e392aa81868699a26
178s Successfully built testlib
178s Installing collected packages: FormEncode, testlib
178s Successfully installed FormEncode-2.1.0 testlib-0.0.1
```

Having downloaded FormEncode from pypi, the Debian patches are not in
place and the package fails.

Perhaps the call to virtualenv needs `--system-site-packages`?

regards
Stuart

Reply via email to