When you say “via pep517”, do you mean specifically this python package?
I think for recent setuptools, if you put a requirement in setup_requires, and you’re using a PEP 517-aware frontend (like the pep517 package, or recent pip), then anything in setup_requires gets converted into get_requires_for_build_wheel. So… if I’m right, then either setup_requires should work for your use case, or else, if it doesn’t, then that might mean that you actually do need the expensive packages already installed before you can call hooks.get_requires_for_build_wheel().