我正在使用setuptools版本0.9.6,并希望按照此处或此处显示的说明添加命令挂钩到setup 。 我在同一个setup.py文件中创建了一个派生自setuptools.Command的类MyCommand ,我试图按如下方式添加这个钩子:
setup( # ... entry_points = { "distutils.commands": [ "my_command = MyCommand"]} )但是,无法识别命令my_command ,即python setup.py my_command给出错误
error: invalid command 'my_command'也许我需要以不同的方式参考我的命令? 或者使用版本工具0.9.6的版本有变化吗? 怎么做对了?
I am using setuptools Version 0.9.6 and want to add a command hook into setup, following the description shown here or here. I have created a class MyCommand derived from setuptools.Command within the same setup.py file and I am trying to add this hook as follows:
setup( # ... entry_points = { "distutils.commands": [ "my_command = MyCommand"]} )However, the command my_command is not recognized, i.e. python setup.py my_command gives an error
error: invalid command 'my_command'Maybe I do need to refer to my command in a different way? Or are there changes to the used version 0.9.6 of setuptools? How to do it right?
最满意答案
在cmdclass中添加命令,而不是我找到的。
setup( cmdclass = {'my_command':MyCommand}, )类型:
>>> python setup.py --help-commands将在Extra Commands列出您的Extra Commands
Add your command in cmdclass instead thats what i found.
setup( cmdclass = {'my_command':MyCommand}, )Type :
>>> python setup.py --help-commandsWill list your command in Extra Commands
更多推荐
发布评论