[Patches] [ python-Patches-793070 ] Add --remove-source option to setup.py

SourceForge.net noreply at sourceforge.net
Fri Dec 22 19:52:16 CET 2006


Patches item #793070, was opened at 2003-08-22 06:10
Message generated for change (Comment added) made by akuchling
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=793070&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Distutils and setup.py
Group: None
>Status: Closed
>Resolution: Rejected
Priority: 5
Private: No
Submitted By: David Fraser (davidfraser)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add --remove-source option to setup.py

Initial Comment:
For distributing non-opensource software, it is helpful
to just distribute the .pyc/.pyo files and not the
original .py files.
The reverse (just distributing .py files) is possible
through the --no-target-compile and
--no-target-optimize switches to the distutils bdist
command.
We have added a --remove-source option which goes
through and deletes all the source files from the build
directory. This has been tested and works smoothly with
Python 2.2.3 and seems to apply cleanly to Python 2.3

----------------------------------------------------------------------

>Comment By: A.M. Kuchling (akuchling)
Date: 2006-12-22 13:52

Message:
Logged In: YES 
user_id=11375
Originator: NO

Closing this patch as requested by the original submitter.


----------------------------------------------------------------------

Comment By: David Fraser (davidfraser)
Date: 2005-01-18 04:36

Message:
Logged In: YES 
user_id=221678

I have now extracted the remove source code into a separate
module, that can insert the required code into distutils and
so be used without patching distutils.
I'll attach it here for future reference. This can probably
marked as closed since it is doable from outside

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2004-08-18 08:38

Message:
Logged In: YES 
user_id=21627

The patch is still incorrect, though: it unconditionally
decides that bdist_wininst is now going to ship byte code.
This is incorrect, since the byte code can only belong to
the current Python version, which might be different from
the target Python version.

In addition, "removing all source" means to remove all .py
files. Instead, it should remove the files that are
byte-compiled, i.e. the files returned from
get_outputs(include_bytecode=0).

----------------------------------------------------------------------

Comment By: David Fraser (davidfraser)
Date: 2003-09-01 12:25

Message:
Logged In: YES 
user_id=221678

As far as I understand, the compiled files are generated in
the build dir from the source files which have been copied
there.
Simply removing the source files afterwards means we don't
have to make any changes to the whole way distutils operates. 
Also, we don't want to compile in-tree and then move the
files as that might create confusing results when compiling
for multiple versions of Python.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-08-31 12:18

Message:
Logged In: YES 
user_id=21627

Wouldn't it be better not to copy the files into the build
dir in the first place?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=793070&group_id=5470


More information about the Patches mailing list