Example "Dynamic build flags" does not work

my first post, did not find anything relate with search.

The example fails because it does not search the script in right place. Frpm doc it shall look in same dir as platformio.ini, but it searches in ~/.platformio subdir

Example from Redirecting...

build_flags = !python git_rev_macro.py

it does not even find python:
*** [.pioenvs/sonoff-cover-df/firmware.elf] Implicit dependency /home/fauthd/.platformio/platforms/espressif8266/builder/!python' not found, needed by target .pioenvs/sonoff-cover-df/firmware.elf’.

I think it should either search in $PATH or local dir of the project (or both), but not in the dir it searches.

Thanks a lot, Dieter

Could you provide a full platformio.ini?