classification
Title: distutils support for swig is under par
Type: behavior Stage: resolved
Components: Distutils Versions: Python 3.7, Python 3.6, Python 3.1, Python 3.2, Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: tarek Nosy List: Jeff.Laughlin, akitada, sjoerd, steve.dower, tarek, theller
Priority: normal Keywords:

Created on 2004-08-26 09:11 by sjoerd, last changed 2021-02-03 18:19 by steve.dower. This issue is now closed.

Messages (8)
msg60555 - (view) Author: Sjoerd Mullender (sjoerd) * (Python committer) Date: 2004-08-26 09:11
To my delight there is support for swig built into
distutils.  However a few problems exist with the support.

- there is no way to specify any extra flags to the
swig command (I need -I/usr/include -DHAVE_LONG_LONG);
- swig generates two files, the XXX_wrap.c file which
is turned into a _XXX.so file, and a XXX.py file. 
distutils only deals with the XXX_wrap.c file.

I have no suggested fix for these problems, but
problems they are.

(Python from CVS HEAD on Fedora Core 2).
msg60556 - (view) Author: Sjoerd Mullender (sjoerd) * (Python committer) Date: 2004-10-15 14:27
Logged In: YES 
user_id=43607

Part of the problem described here (the extra options that
need to be given to swig) is solved by [ 1046644 ] improving
distutils swig support (2).  However, the other part is
still a problem.
msg60557 - (view) Author: Sjoerd Mullender (sjoerd) * (Python committer) Date: 2004-10-15 14:37
Logged In: YES 
user_id=43607

I just came up with a possible solution:

In command/build.py change the order of the
build.sub_commands list and put the entry for build_ext
before build_py.

The question is, does this cause a problem for anybody?
msg60558 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2004-10-15 15:34
Logged In: YES 
user_id=11105

Haven't read the original problem (I don't use swig myself),
but if changing the order of the sub_commands list than it
can as well be done in the setup script by installing a
custom build command.
msg60559 - (view) Author: Sjoerd Mullender (sjoerd) * (Python committer) Date: 2004-10-15 18:07
Logged In: YES 
user_id=43607

Hmm, you can't really call that "decent swig support" then,
can you?
If this "solution" were properly documented (in a place one
would notice when trying to create a setup.py to do swig!)
then it wouldn't be too much of a problem, but I wouldn't
know where that would be.

So, if my change doesn't cause any detrimental effects I'd
much rather see it fixed that way.
msg60560 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2004-10-15 18:19
Logged In: YES 
user_id=11105

> Hmm, you can't really call that "decent swig support"
then, can you?

Of course not ;-)

And I have setup scripts myself which would be more happy
with this change, anyway, because they need the extensions
built with build_ext to generate python modules.

So, personally, I'm +1 on this change (but what does this
count).
msg81410 - (view) Author: Akira Kitada (akitada) * Date: 2009-02-08 19:08
Same with issue2624?
msg386346 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:19
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools
History
Date User Action Args
2021-02-03 18:19:35steve.dowersetstatus: open -> closed

nosy: + steve.dower
messages: + msg386346

resolution: out of date
stage: resolved
2018-08-18 08:13:19benmsetversions: + Python 3.4, Python 3.5, Python 3.6, Python 3.7
2010-12-03 21:04:01Jeff.Laughlinsetnosy: + Jeff.Laughlin
2010-08-19 16:07:58BreamoreBoysetversions: + Python 3.2
2009-02-08 19:34:47tareksetassignee: tarek
type: behavior
versions: + Python 3.1, Python 2.7
2009-02-08 19:08:51akitadasetnosy: + tarek, akitada
messages: + msg81410
2004-08-26 09:11:49sjoerdcreate