I always announce well before I pass. And then thank them as I pass.
I HATE it when other riders pass me without announcing, or announcing too late.
I have bee startled a number of times, risking a crash.
Even if I am riding steady, I never know when I may need to swerve to avoid rocks, potholes, horse droppings, or other obstacles. I hope no one is trying to pass me under these circumstances.
H.