You should parse the file by running it.
Adding custom programming logic into the requirements' file isn't really an issue, when setup.py could already grab a C compiler and start binding in system libraries into its package.
And unless you're using a homoiconic format, code is not (easily) parsable as data.