aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/command')
-rw-r--r--setuptools/command/__init__.py13
-rwxr-xr-xsetuptools/command/egg_info.py38
2 files changed, 22 insertions, 29 deletions
diff --git a/setuptools/command/__init__.py b/setuptools/command/__init__.py
index 29f3000d..a58b5344 100644
--- a/setuptools/command/__init__.py
+++ b/setuptools/command/__init__.py
@@ -1,17 +1,10 @@
-import distutils.command
-
__all__ = [
- 'test', 'develop', 'bdist_egg', 'saveopts', 'setopt', 'rotate', 'alias'
+ 'alias', 'bdist_egg', 'build_ext', 'build_py', 'depends', 'develop',
+ 'easy_install', 'egg_info', 'install', 'install_lib', 'rotate', 'saveopts',
+ 'sdist', 'setopt', 'test', 'upload',
]
-# Make our commands available as though they were part of the distutils
-
-distutils.command.__path__.extend(__path__)
-distutils.command.__all__.extend(
- [cmd for cmd in __all__ if cmd not in distutils.command.__all__]
- )
-
from distutils.command.bdist import bdist
if 'egg' not in bdist.format_commands:
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index a5418568..8577230f 100755
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -8,7 +8,7 @@ from setuptools import Command
from distutils.errors import *
from distutils import log
from pkg_resources import parse_requirements, safe_name, \
- safe_version, yield_lines
+ safe_version, yield_lines, EntryPoint
from setuptools.dist import iter_distribution_names
class egg_info(Command):
@@ -95,7 +95,7 @@ class egg_info(Command):
metadata.write_pkg_info(self.egg_info)
finally:
metadata.name, metadata.version = oldname, oldver
-
+ self.write_entry_points()
self.write_requirements()
self.write_toplevel_names()
self.write_or_delete_dist_arg('namespace_packages')
@@ -183,23 +183,23 @@ class egg_info(Command):
if not self.dry_run:
os.unlink(filename)
+ def write_entry_points(self):
+ ep = getattr(self.distribution,'entry_points',None)
+ if ep is None:
+ return
+ epname = os.path.join(self.egg_info,"entry_points.txt")
+ log.info("writing %s", epname)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ if not self.dry_run:
+ f = open(epname, 'wt')
+ if isinstance(ep,basestring):
+ f.write(ep)
+ else:
+ for section, contents in ep.items():
+ if not isinstance(contents,basestring):
+ contents = EntryPoint.parse_list(section, contents)
+ contents = '\n'.join(map(str,contents.values()))
+ f.write('[%s]\n%s\n\n' % (section,contents))
+ f.close()