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

SourceForge.net noreply at sourceforge.net
Wed Aug 18 14:38:54 CEST 2004


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

Category: Distutils and setup.py
Group: None
Status: Open
Resolution: None
Priority: 5
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: Martin v. Löwis (loewis)
Date: 2004-08-18 14: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 18: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 18: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