Reputation: 480
I am using:
mkdir -p build/python/lib/python3.6/site-packages
pipenv run pip install -r requirements.txt --target build/python/lib/python3.6/site-packages
to create a directory build
with everything I need for my python project but I also need to save as much space as possible.
What can I safely remove in order to save space?
Maybe can I do find build -type d -iname "*.dist-info" -exec rm -R {} \;
?
Can I remove *.py
if I leave *.pyc
?
Thanks
Upvotes: 0
Views: 1089
Reputation: 1209
You can safely remove any .pyc
, .pyo
, .md
files. Also you can delete all __pycache__
, and with a bit of risk, all those ending with /test
or /tests
Upvotes: 0
Reputation: 560
Perhaps platform specific *.exe files, if your project doesn't need to run on Windows:
Delete *.pyc (byte-compiled files), with an impact to load-time: 100% supported, unlike your trick of the reverse: retain just *.pyc (and delete most *.py sources) in some python versions; not safe IMHO but never tried it.
Upvotes: 1