Bug 531901 - The python package has a dependency on the python-devel package
The python package has a dependency on the python-devel package
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: python (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Dave Malcolm
Fedora Extras Quality Assurance
:
: 533341 (view as bug list)
Depends On:
Blocks: 510659
  Show dependency treegraph
 
Reported: 2009-10-29 15:21 EDT by Andrew McNabb
Modified: 2009-11-06 11:26 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-10-29 23:27:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Andrew McNabb 2009-10-29 15:21:20 EDT
Currently, %{pylibdir}/config/* are put into the devel subpackage.  However, distutils needs to load %{pylibdir}/config/Makefile (see the get_makefile_filename() function in distutils/sysconfig.py.  Since distutils is and should be in the main python package, then %{pylibdir}/config/Makefile also needs to be in the main python package instead of the devel subpackage.  Based on _init_posix() in distutils/sysconfig.py, it looks like this is also true for /usr/include/python2.6/pyconfig.h.  The only alternative would be to put distutils into the python3-devel subpackage, but that doesn't seem right at
all.
Comment 1 Andrew McNabb 2009-10-29 15:21:55 EDT
Sorry, in the last line, that should be python-devel, not python3-devel.
Comment 2 Toshio Ernie Kuratomi 2009-10-29 19:52:43 EDT
Discussed before in:
  https://bugzilla.redhat.com/show_bug.cgi?id=251645#c18

Upstream bug about this (no response -- if someone wants to follow up, we can talk to tarek on #distutils):
  http://bugs.python.org/issue4359

FWIW, I'm for doing this as distutils at this point in time.
Comment 3 Dave Malcolm 2009-10-29 20:00:59 EDT
Thanks for filing this report.

From IRC:
<abadger1999> dmalcolm: https://bugzilla.redhat.com/show_bug.cgi?id=251645#c18
<abadger1999> dmalcolm: Upstream report too (but with no input since I opened it) http://bugs.python.org/issue4359

From my reading of the code, get_makefile_filename merely tells you what the filename is.

_init_posix() needs to actually _read_ the filename, so it would have to be present; similarly for parse_config_h().

So it looks like for _init_posix() to work, the following files should be moved from the -devel to the main subpackage:
  %{_libdir}/python%{pybasever}/config/Makefile
  /usr/include/python2.6/pyconfig-{32|64}.h

(but not /usr/include/python2.6/pyconfig.h ; it doesn't seem to be used)

thus requiring also these dirs be moved from -devel to core:
  %dir %{_libdir}/python%{pybasever}/config
  /usr/include/python2.6
whilst keeping the rest of their content in the -devel subpackage (thus requiring a slight rewrite of the %files part of the specfile)

Does this sound correct?
Comment 4 Toshio Ernie Kuratomi 2009-10-29 20:03:37 EDT
That sounds correct though I haven't read over that part of the code for several years, now.
Comment 5 Dave Malcolm 2009-10-29 23:27:17 EDT
OK, without python-devel installed, with local build of python-2.6.4-1.fc13.i386:
$ python -c "import distutils.sysconfig; distutils.sysconfig._init_posix()"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.6/distutils/sysconfig.py", line 378, in _init_posix
    raise DistutilsPlatformError(my_msg)
distutils.errors.DistutilsPlatformError: invalid Python installation: unable to open /usr/lib/python2.6/config/Makefile (No such file or directory)

With fixed local build of python (without python-devel installed) it works:
$ python -c "import distutils.sysconfig; print distutils.sysconfig._init_posix()"
None

Built into rawhide as 2.6.4-2 (http://koji.fedoraproject.org/koji/taskinfo?taskID=1778332)
Comment 6 Dave Malcolm 2009-10-29 23:28:02 EDT
I also addressed this for python 3, see:
https://bugzilla.redhat.com/show_bug.cgi?id=526126#c38
Comment 7 Dave Malcolm 2009-11-06 11:26:39 EST
*** Bug 533341 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.