clean ffi/build with setup.py clean
Fixes #567
@ARF1 thanks for submitting this, I have labeled it as needing review for now.
CI needs #903.
@gmarkall thank you for adopting this. When is the ffi/build directory created:
I did:
$ python setup.py build
...
$ git status --ignored
On branch wip/fix_setup_clean
Untracked files:
ffi/libllvmlite.dylib.dSYM/
gitlog2changelog.py
test.sh
Ignored files:
build/
ffi/libllvmlite.dylib
ffi/libllvmlite.dylib.dSYM/Contents/Resources/
llvmlite/binding/libllvmlite.dylib
$ python setup.py clean
/Users/esc/miniconda3-arm64/envs/llvmlite_3.10/lib/python3.10/site-packages/setuptools/dist.py:529: UserWarning: Normalizing '0.40.0dev0+54.gab202ba385' to '0.40.0.dev0+54.gab202ba385'
warnings.warn(tmpl.format(**locals()))
running clean
removing '/Users/esc/git/llvmlite/__pycache__' (and everything under it)
$ git status --ignored
On branch wip/fix_setup_clean
Untracked files:
ffi/libllvmlite.dylib.dSYM/
gitlog2changelog.py
test.sh
Ignored files:
build/
ffi/libllvmlite.dylib
ffi/libllvmlite.dylib.dSYM/Contents/Resources/
llvmlite/binding/libllvmlite.dylib
So I am not yet sure when the clean command is supposed to pickup ffi/build? Can you explain?
It's created when using CMake to build. This happens on Windows, or if you build on Linux / macOS with the environment variable LLVMLITE_USE_CMAKE set to 1.
@stuartarchibald thanks for catching that - now updated.
I also spotted that the clean command leaves .dll and .dylib files lying around. Testing the clean command on Windows:
(numbadev) PS C:\Users\gmarkall\work\numbadev\llvmlite> python setup.py clean
C:\Users\gmarkall\Miniconda3\envs\numbadev\lib\site-packages\setuptools\dist.py:487: UserWarning: Normalizing '0.40.0dev0+58.g8300243' to '0.40.0.dev0+58.g8300243'
warnings.warn(tmpl.format(**locals()))
running clean
removing 'C:\Users\gmarkall\work\numbadev\llvmlite\llvmlite.egg-info' (and everything under it)
removing 'C:\Users\gmarkall\work\numbadev\llvmlite\llvmlite\binding\llvmlite.dll'
removing 'C:\Users\gmarkall\work\numbadev\llvmlite\ffi\build' (and everything under it)
removing 'C:\Users\gmarkall\work\numbadev\llvmlite\llvmlite\__pycache__' (and everything under it)
removing 'C:\Users\gmarkall\work\numbadev\llvmlite\__pycache__' (and everything under it)
After running the command, there is nothing left:
(numbadev) PS C:\Users\gmarkall\work\numbadev\llvmlite> git status --ignored
On branch wip/fix_setup_clean
Your branch is up to date with 'ARF1/wip/fix_setup_clean'.
nothing to commit, working tree clean
@stuartarchibald I think this should be ready for another look now.
@gmarkall do you want to pickup work on this again? I think it got reasonably far and just needs a few more lines?
@esc I'm not able to pick this up again in the short term. If you're aiming to tidy up the PRs and reduce the number of things open, I don't mind if you'd prefer to close / abandon this.
@gmarkall it would be a shame to abandon this since it's fairly close to finish. I've placed it on the contributor self-service board, who knows, maybe we get lucky.