scientific-python / spin

Developer tool for scientific Python libraries
BSD 3-Clause "New" or "Revised" License
101 stars 20 forks source link

Allow `build —clean` to uninstall the source files? #239

Closed adam2392 closed 38 minutes ago

adam2392 commented 3 weeks ago

I usually do a workflow like the following:

./spin build
./spin install
pytest ./<stuff>/

However, if I rewrite some logic and want to build from source again with a clean build, I would do something like:

./spin build —clean

But get the following message:

(sktree) (base) adam2392@arm64-apple-darwin20 treeple % ./spin build -j 6 --clean
$ git submodule update --init --force
Submodule path 'treeple/_lib/sklearn_fork': checked out '4fd15fdf88737e7e84e96217b2c9b0ce0c162c2c'
4fd15fdf88737e7e84e96217b2c9b0ce0c162c2c

$ mkdir -p ./treeple/_lib/sklearn/
$ touch ./treeple/_lib/commit.txt
./treeple/_lib/commit.txt
$ rm -rf treeple/_lib/sklearn
$ cp -r treeple/_lib/sklearn_fork/sklearn treeple/_lib/sklearn
Editable install of same source detected; skipping build

This is undesirable and I assume that if someone asks for a "clean" build, then shouldn't the installation be uninstalled, so this is fine?

stefanv commented 3 weeks ago

Right, so you need to either use spin build (and then use the spin run, spin ipython, spin test etc. commands to run things), or you can do spin install to make an editable install that automatically recompiles upon import.