Only delete zipapps cache on the main process#33
Only delete zipapps cache on the main process#33Joshix-1 wants to merge 3 commits intoClericPy:masterfrom
Conversation
With multiprocessing only the main process should delete the cache. Otherwise exceptions get thrown on exit. Silently ignoring exceptions would not work, as then when a single child dies the files would be gone.
|
how to test this change? |
|
create a zipapp with code like the following: |
|
https://github.com/ClericPy/zipapps/blob/master/test_utils.py What I mean is that there is a test case that can run successfully on different operating systems to verify that changes are valid and scenarios are explained Which is to prove the value of the change, and regression testing to avoid side effects. |
|
By the way, zipapps are actually not recommended to remove themselves after taking over the run. It's not as safe as an external program, which is not a very regular feature in itself. |
I'll try to write a test
This is about removing the files from the cache. E.g. the .so files of dependencies that get extracted. |
1d8f91a to
2a61ba9
Compare
|
Added a test. Sadly I don't know how to test on windows, as os.fork is not available there. |
With multiprocessing only the main process should delete the cache. Otherwise exceptions get thrown on exit. Silently ignoring exceptions would not work, as then when a single child dies the files would be gone.