简体   繁体   中英

How can I disable generation of pyc and pyo files?

Autotools insists on generating pyo and pyc files when building my project (not when running it) no matter what I do. The problem is that my Python configuration is somewhat strange, and I don't want the Python compiler to run during installation. Is there any way to disable generating these files?

For reference, here are the things I've tried:

  • Setting py_compile=echo so that automake won't compile Python scripts
  • Manually defining install-pythonPYTHON in Makefile.am
  • Setting PYTHONFLAGS=-B
  • Setting PYTHONDONTWRITEBYTECODE in Makefile.am, configure.ac, etc.
  • Creating a new automake variable "python2dir" and installing the script using dist_python2_DATA = Script.py

Basically, if a file ends with the .py extension, Automake WILL create pyc and pyo files, no matter what you do.

请参阅文档中的-B选项。

Please try again with your last attempt.

dist_python_DATA = foo.py

will treat foo.py as any regular file, distribute it, and install it in $(pythondir) . _DATA does not trigger any kind of compilation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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