aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/bdist_egg.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2005-07-10 04:49:31 +0000
committerPJ Eby <distutils-sig@python.org>2005-07-10 04:49:31 +0000
commit451377d0e877fc610d1bdf8181ba70a90e4c14cc (patch)
tree89e0ecc02b8040a747eee92971c0166e63e9e6b2 /setuptools/command/bdist_egg.py
parent74f597fec6a91b8305177461e7c25bb231999e61 (diff)
downloadexternal_python_setuptools-451377d0e877fc610d1bdf8181ba70a90e4c14cc.tar.gz
external_python_setuptools-451377d0e877fc610d1bdf8181ba70a90e4c14cc.tar.bz2
external_python_setuptools-451377d0e877fc610d1bdf8181ba70a90e4c14cc.zip
Detect and handle conflicts with "unmanaged" packages when installing
packages managed by EasyInstall. Also, add an option to exclude source files from .egg distributions. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041109
Diffstat (limited to 'setuptools/command/bdist_egg.py')
-rw-r--r--setuptools/command/bdist_egg.py49
1 files changed, 45 insertions, 4 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py
index 74a2cd26..552bd7e8 100644
--- a/setuptools/command/bdist_egg.py
+++ b/setuptools/command/bdist_egg.py
@@ -49,6 +49,8 @@ class bdist_egg(Command):
('plat-name=', 'p',
"platform name to embed in generated filenames "
"(default: %s)" % get_platform()),
+ ('exclude-source-files', None,
+ "remove all .py files from the generated egg"),
('keep-temp', 'k',
"keep the pseudo-installation tree around after " +
"creating the distribution archive"),
@@ -59,7 +61,7 @@ class bdist_egg(Command):
]
boolean_options = [
- 'keep-temp', 'skip-build',
+ 'keep-temp', 'skip-build', 'exclude-source-files'
]
@@ -78,8 +80,6 @@ class bdist_egg(Command):
-
-
def initialize_options (self):
self.bdist_dir = None
self.plat_name = None
@@ -87,7 +87,7 @@ class bdist_egg(Command):
self.dist_dir = None
self.skip_build = 0
self.egg_output = None
-
+ self.exclude_source_files = None
def finalize_options(self):
@@ -227,6 +227,8 @@ class bdist_egg(Command):
"Use the install_requires/extras_require setup() args instead."
)
+ if self.exclude_source_files: self.zap_pyfiles()
+
# Make the archive
make_zipfile(self.egg_output, archive_root, verbose=self.verbose,
dry_run=self.dry_run)
@@ -242,6 +244,45 @@ class bdist_egg(Command):
+ def zap_pyfiles(self):
+ log.info("Removing .py files from temporary directory")
+ for base,dirs,files in os.walk(self.bdist_dir):
+ if 'EGG-INFO' in dirs:
+ dirs.remove('EGG-INFO')
+ for name in files:
+ if name.endswith('.py'):
+ path = os.path.join(base,name)
+ log.debug("Deleting %s", path)
+ os.unlink(path)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
# Attribute names of options for commands that might need to be convinced to