Adding string type macros to src through extra_scripts

platformio.ini

[platformio]
; some configurationns
[env]

extra_scrpts = 
  script.py
 

script.py

Import("projenv")

projenv.Append(CPPDEFINES=[
  ("MACRO", "Value")
]) 

I want to push a macro to my src files such that when I will call

auto val = MACRO;

than val will be Value.
The problem is that in src the MACRO gets interpreted as ‘Value’ and not “Value” which causes problems because C++ code doesn’t accept single quote strings (which python does).

Is there a way to modify these values so that they will actually be double quoted?

See documentation

https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_flags.html#stringification