使用 waf,如何在配置期间检查 python 模块的最低版本?
Using waf, how to check for a minimum version of a python module during configure?
除了在 ./waf configure
期间检查特定 python 模块的存在之外,我还需要检查它是否具有最低版本号。
这就是我在 wscript
:
中已经在做的事情
def configure(cfg):
cfg.load('python')
cfg.check_python_module('some_module')
我怎样才能做到这一点?
看看这个https://waf.io/apidocs/tools/python.html#waflib.Tools.python.check_python_module
def options(opt):
opt.load('python')
def configure(conf):
conf.load('python')
conf.check_python_module(
're',
condition="ver > num(2, 0, 4) and ver <= num(3, 0, 0)")
除了在 ./waf configure
期间检查特定 python 模块的存在之外,我还需要检查它是否具有最低版本号。
这就是我在 wscript
:
def configure(cfg):
cfg.load('python')
cfg.check_python_module('some_module')
我怎样才能做到这一点?
看看这个https://waf.io/apidocs/tools/python.html#waflib.Tools.python.check_python_module
def options(opt):
opt.load('python')
def configure(conf):
conf.load('python')
conf.check_python_module(
're',
condition="ver > num(2, 0, 4) and ver <= num(3, 0, 0)")