From f05e28dda04814ff737ea400a34fdbe4f1d3fc93 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Wed, 11 Sep 2024 03:04:45 -0500 Subject: [PATCH] build: Remove transient directories after install to allow for rebuild * While doing multiple rebuilds it is advisable to also clean up the state of the Git submodules with 'git clean -f', removing the OUTPUT directory at src/fastjet/_fastjet_core/ and the top level build directory is sufficient to do local development rebuilds --- i.e., the command 'python -m pip install --upgrade .' can be run twice in a row without error. --- setup.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setup.py b/setup.py index 36c0c44a..e90bcf30 100644 --- a/setup.py +++ b/setup.py @@ -29,6 +29,13 @@ PYTHON = DIR / "src/fastjet" OUTPUT = PYTHON / "_fastjet_core" + +# Clean up transient directories to allow for rebuilds during development +if (DIR / "build").exists(): + shutil.rmtree(DIR / "build") +if OUTPUT.exists(): + shutil.rmtree(OUTPUT) + LIBS = [ "fastjet", "fastjettools",