<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font face="monospace, monospace">$ cat include/Make/Python.make</font> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font face="monospace, monospace"><br></font><font face="monospace, monospace">PY_SOURCES := $(wildcard *.py)</font><font face="monospace, monospace"><br></font><font face="monospace, monospace">%.pyc: %.py<br></font><font face="monospace, monospace"><span style="white-space:pre"> </span>$(PYTHON) -t -m py_compile $<</font></blockquote></div><div><br></div><div>The make command explicitly compiles the *.py files to *.pyc and copies them to the dist directory. I haven't tested the packaging code but I guess that they might get included in the packages too.</div><div><br></div><div>Just for the record, on linux x64 + Python 3:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font face="monospace, monospace">du -ch ./dist.x86_64-pc-linux-gnu</font><span style="font-family:monospace,monospace"> | tail -n1</span></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font face="monospace, monospace">93M<span style="white-space:pre"> </span>./</font></blockquote></div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font face="monospace, monospace">$ find ./dist.x86_64-pc-linux-gnu</font><span style="font-family:monospace,monospace"> -name *.pyc -exec du -ch {} + | tail -n1</span></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font face="monospace, monospace">6.6M<span style="white-space:pre">       </span>total</font> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font face="monospace, monospace">$ find ./dist.x86_64-pc-linux-gnu</font><span style="font-family:monospace,monospace"> -name *.py -exec du -ch {} + | tail -n1</span></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font face="monospace, monospace">9.7M<span style="white-space:pre">   </span>total</font></blockquote><br class="gmail-Apple-interchange-newline"><div>Is there a reason why this is happening? AFAIK distributing just the *.py files is usually enough since *.pyc files get created on first import (if the user has write permissions; for more info <a href="https://effbot.org/pyfaq/how-do-i-create-a-pyc-file.htm">here</a>) </div><div><br></div><div>The other downside, and the real reason I looked into this, is that on my laptop I need ~5 secs to run make on lib/python (on Python 3; Python 2 is faster). Not too big, but big enough for an interpreted language like Python. And smaller compilation times help you get into and stay <a href="https://www.joelonsoftware.com/2001/02/12/human-task-switches-considered-harmful/">in the flow</a> :P </div></div><div><br></div><div>PS. Not a real biggie, but I am just curious.</div></div></div></div></div></div></div></div>