栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

覆盖cmdclass时将忽略python setuptools install_requires

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

覆盖cmdclass时将忽略python setuptools install_requires

我也遇到了同样的问题。似乎以某种方式触发setuptools进行“旧式安装”

distutils
,但确实不支持
install_requires

您可以在setuptools / setuptools / command /
install.py,第51-74行中调用install.run(self),后者会调用run(self)

https://bitbucket.org/pypa/setuptools/src/8e8c50925f18eafb7e66fe020aa91a85b9a4b122/setuptools/command/install.py?at=default

def run(self):    # Explicit request for old-style install?  Just do it    if self.old_and_unmanageable or self.single_version_externally_managed:        return _install.run(self)    # Attempt to detect whether we were called from setup() or by another    # command.  If we were called by setup(), our caller will be the    # 'run_command' method in 'distutils.dist', and *its* caller will be    # the 'run_commands' method.  If we were called any other way, our    # immediate caller *might* be 'run_command', but it won't have been    # called by 'run_commands'.  This is slightly kludgy, but seems to    # work.    #    caller = sys._getframe(2)    caller_module = caller.f_globals.get('__name__','')    caller_name = caller.f_pre.co_name    if caller_module != 'distutils.dist' or caller_name!='run_commands':        # We weren't called from the command line or setup(), so we        # should run in backward-compatibility mode to support bdist_*        # commands.        _install.run(self)    else:        self.do_egg_install()

我不确定这种行为是否有意,但是要替换

install.run(self)

install.do_egg_install()

应该可以解决您的问题。至少它对我有用,但是我也希望得到更详细的答案。谢谢!



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/429126.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号