watchfiles icon indicating copy to clipboard operation
watchfiles copied to clipboard

Watchfiles with editable packages

Open CharlesFr opened this issue 1 year ago • 1 comments

I have a docker-compose.yaml application using watchfiles to reload project files.

However, changes made to packages referenced locally and installed via pip install -e . aren't reflected. Changes only appear after rebuilding the whole clusters docker-compose up -d build." which is time-consuming.

My question is; how should I handle reloading packages installed via editable mode such that I don't need to rebuild every time?

I can confirm that adding sys.exit(0) inside the editable module launches a reload, but without the newly added line.

CharlesFr avatar Oct 03 '23 09:10 CharlesFr

Yup, we've had the same problem at Pydantic, it's because by default we ignore changes in the site-packages directory.

https://github.com/samuelcolvin/watchfiles/blob/6ea19cac0447b3594cca29793fe0d308c3585a6a/watchfiles/filters.py#L82

PR welcome to remove that directory from the list.

samuelcolvin avatar Oct 13 '23 12:10 samuelcolvin

fixed by #249.

samuelcolvin avatar Aug 07 '24 11:08 samuelcolvin