scikit-hep / fastjet

Jet-finding in the Scikit-HEP ecosystem.
https://fastjet.readthedocs.io
BSD 3-Clause "New" or "Revised" License
21 stars 13 forks source link

Add repository reset tools for developers #279

Open matthewfeickert opened 8 months ago

matthewfeickert commented 8 months ago

After a local build of the the package

python -m pip install --upgrade --verbose .

the repository is left in a dirty state with additional untracked files in both the repository and the Git submodules. It would be useful to add either a Makefile or a noxfile.py that impliments git clean commands to quickly reset the repository and submodules to a clean state with a single command.

matthewfeickert commented 2 months ago

An attempt at this (which hasn't been looked at for a long time, so might need fixing) is the following build.sh script

#!/bin/bash

# rm the directories that are created but are also in .gitignore
rm -rf CGAL-5.6*
rm -rf build
rm -rf src/fastjet/_fastjet_core/

cd fastjet-core
git reset --hard fastjet-3.4.2
git clean -f
cd plugins/SISCone/siscone
git clean -f
cd ../../../
cd ..

cd fastjet-contrib
git clean -f
cd ..

python -m pip install --upgrade --verbose .
matthewfeickert commented 2 months ago

cc @jmduarte and co given Discussion https://github.com/scikit-hep/fastjet/discussions/302

matthewfeickert commented 1 month ago

A better script:

#!/bin/bash

rm -rf CGAL-5.6*

# c.f. https://gist.github.com/nicktoumpelis/11214362
git submodule foreach --recursive git clean -d -f -x
git submodule foreach --recursive git reset --hard

python -m pip install --upgrade --verbose .