Python Distribute、epydoc和setup.py

Python Distribute、epydoc和setup.py,python,setup.py,epydoc,Python,Setup.py,Epydoc,我希望有一个为我的包运行epydoc的目标(比如docs)。我假设我需要创建一个新命令,但我运气不太好 以前有人这样做过吗?提供了几个用于setup.py文件的命令 您需要使用命令定义一个distutils.commands入口点;示例来自: 其中额外的命令可以作为python setup.py commandname使用 入口点从distutils.cmd import命令指向的子类。来自巴别塔的示例,来自: entry_points = """ [distutils.commands] co

我希望有一个为我的包运行epydoc的目标(比如
docs
)。我假设我需要创建一个新命令,但我运气不太好

以前有人这样做过吗?

提供了几个用于
setup.py
文件的命令

您需要使用命令定义一个
distutils.commands
入口点;示例来自:

其中额外的命令可以作为
python setup.py commandname
使用

入口点从distutils.cmd import命令指向
的子类。来自巴别塔的示例,来自:

entry_points = """
[distutils.commands]
compile_catalog = babel.messages.frontend:compile_catalog
extract_messages = babel.messages.frontend:extract_messages
init_catalog = babel.messages.frontend:init_catalog
update_catalog = babel.messages.frontend:update_catalog
"""
from distutils.cmd import Command
from distutils.errors import DistutilsOptionError


class compile_catalog(Command):
    """Catalog compilation command for use in ``setup.py`` scripts."""

    # Description shown in setup.py --help-commands
    description = 'compile message catalogs to binary MO files'
    # Options available for this command, tuples of ('longoption', 'shortoption', 'help')
    # If the longoption name ends in a `=` it takes an argument
    user_options = [
        ('domain=', 'D',
         "domain of PO file (default 'messages')"),
        ('directory=', 'd',
         'path to base directory containing the catalogs'),
        # etc.
    ]
    # Options that don't take arguments, simple true or false options.
    # These *must* be included in user_options too, but without a = equals sign
    boolean_options = ['use-fuzzy', 'statistics']

    def initialize_options(self):
        # Set a default for each of your user_options (long option name)

    def finalize_options(self):
        # verify the arguments and raise DistutilOptionError if needed

    def run(self):
        # Do your thing here.