How can I disable generation of pyc and pyo files?

automake, autotools, python

Solution

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.

Problem

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.

Original source

Related problems