Reputation: 1588
I have a folder of files /foo
. This folder gets included as package_data in the setup.py
for my Python package. When someone pip install
's my package, they're able to download /foo
to their computer.
I've noticed though that when this happens, a __pycache__
folder gets included for all the *.py
files in /foo
. I'm not sure if this is created when my wheel is created, or when it's installed. I'm assuming it's during wheel creation though.
Since my package should work on windows/osx/linux, will things break because of the __pycache__
folder? Is it platform specific, or will it work cross platform? Or does the folder get created during wheel installation and it doesn't matter anyway.
Upvotes: 3
Views: 372
Reputation: 11070
__pycache__
is usually generated on the fly at the point the package is installed, unless you have accidentally included it in your project (in which case it is best to remove it). For the full spec, see PEP3147.
The compiled code is designed to fail safe. That is, if it exists but isn't compiled for your OS/architecture, then it should be ignored.
Upvotes: 3