The current check if makeSetupHook takes `deps` returns true because
of backwards compat in nixpkgs that emits a trace on use.
By checking for propagatedBuildInputs instead we check for the new behaviour first.
Upstream packaging has changed and using wildcards in python_requires is now considered a bug as it's not PEP400 compliant.
Realistically we have to work around this issue as we can't expect every older version to change.
We do this by rewriting the problematic definitions and dropping the
version precision. This works out because 3.9.* is functionally
equivalent to 3.9.
This is a fairly common packaging mistake that it's better that we solve in a hook than in one-by-one in overrides.
Normal files in site-packages isn't always a mistake, so we can't clean them up wholesale, but we can clean up some common mistakes.
We should never have to use `format = "setuptools"` since pip can
_also_ handle setuptools packages.
This uses a custom pipBuildHook that removes pyproject.toml in case
there is also a setup.py in the same sources.