简体   繁体   English

setup.py构建有什么作用?

[英]What does setup.py build do?

I read in the Python documentation : 我在Python文档中读到:

The build command is responsible for putting the files to install into a build directory. build命令负责将要安装的文件放入构建目录中。

I fear this documentation may be incomplete. 我担心此文档可能不完整。 Does python setup.py build do anything else? python setup.py build还能做什么吗? I expect this step to generate object files with Python bytecode, which will be interpreted at execution time by Python VM. 我希望这一步用Python字节码生成目标文件,Python VM将在执行时解释它。

Also, I'm building an automated code check in my source code repository. 另外,我正在我的源代码库中构建自动代码检查。 I want to know if there is any benefit of running setup.py build (does it do any checks?) or is a static code/PEP8 checker such as Pylint good enough? 我想知道运行setup.py构建是否有任何好处(是否进行任何检查?)或者是Pylint等静态代码/ PEP8检查程序是否足够好?

Does python setupy.py build do anything else? python setupy.py build是否还有其他功能?

If your package contains C extensions (or defines some custom compilation tasks), they will be compiled too. 如果您的包包含C扩展(或定义一些自定义编译任务),它们也将被编译。 If you only have Python files in your package, copying is all build does. 如果您的软件包中只包含Python文件,那么复制就是所有build

I expect this step to generate object files with Python bytecode, which will be interpreted at execution time by Python VM. 我希望这一步用Python字节码生成目标文件,Python VM将在执行时解释它。

No, build does not do that. 不, build不会那样做。 This happens at install stage. 这在install阶段发生。

I want to know if there is any benefit of running setup.py build (Does it do any checks?) or is a static code/PEP8 checker such as Pylint good enough? 我想知道运行setup.py构建是否有任何好处(它是否进行任何检查?)或者是静态代码/ PEP8检查器,如Pylint足够好吗?

By all means, run pylint . 无论如何,运行pylint build does not even check the syntax. build甚至不检查语法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM