Support use of distutils-extra on systems without DISPLAY

Bug #735408 reported by Michel Lind
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Dexter - Old
Invalid
Undecided
Unassigned
python-distutils-extra
Fix Released
Undecided
Unassigned
python-distutils-extra (Fedora)
Fix Released
Medium

Bug Description

RPM-based builders tend to build packages with DISPLAY unset; this works fine for most Python modules, but 'gtk' would throw a RuntimeError without access to a working display. Alas, distutils-extra automatically compiles a list of requirements by trying to import them, and this would fail.

The following patch (against distutils) creates a special case for gtk. It's made against distutils-extra 0.22 (latest in Fedora currently), will rebase to 0.26. Do you have a preferred patch format?

Revision history for this message
Michel Lind (michel-slm) wrote :
Revision history for this message
In , Michel (michel-redhat-bugs) wrote :

Created attachment 484441
Patches auto.py to skip test of whether gtk is an external module

Description of problem:
Python programs that use python-distutils-extra to manage their build and installation process cannot currently be built on RPM builders (e.g. rpm-build) because DISPLAY will be unset, while distutils-extra's automatic dependency tracker would attempt to import every module used by the package to classify which of the dependencies are internal, and which external.

This unfortunately would fail since 'import gtk' throws a runtime exception without a working display. The patch attached (for distutils-extra 0.22) fixes that by short-circuiting the test, marking gtk an external module without testing it.

Version-Release number of selected component (if applicable):
python-distutils-extra-2.22-2.fc15.noarch

How reproducible:
Always

Steps to Reproduce:
1. Try building, say, the Dexter source, without DISPLAY set
   https://launchpad.net/dexter-rolodex

Actual results:
Fails when gtk is imported

Expected results:
Should just work

Additional info:

Revision history for this message
In , Michel (michel-redhat-bugs) wrote :

ps: I subscribed python-distutils-extra for upstream release monitoring; a new bug should automatically be opened today about version 2.26 being available. I've not checked whether it fixes this issue, probably not.

Revision history for this message
In , Fabian (fabian-redhat-bugs) wrote :

I will add the patch. Thanks.

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

python-distutils-extra-2.26-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/python-distutils-extra-2.26-1.fc14

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

python-distutils-extra-2.26-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/python-distutils-extra-2.26-1.fc15

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

python-distutils-extra-2.26-1.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

python-distutils-extra-2.26-1.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
Martin Pitt (pitti) wrote :

Fixed in trunk r259, thanks!

Changed in python-distutils-extra:
status: New → Fix Released
Changed in dexter-rolodex:
status: New → Invalid
Revision history for this message
Martin Pitt (pitti) wrote :
Revision history for this message
Michel Lind (michel-slm) wrote :

Thanks! We can now drop the patch in Fedora for our next release

Changed in python-distutils-extra (Fedora):
importance: Unknown → Medium
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.