The upstream Nixpkgs renamed `pythonForBuild` to `pythonOnBuildForHost`
and made `pythonForBuild` emit warnings: NixOS/nixpkgs#265764. Adjust
the poetry2nix code to avoid warnings with the new version, while still
keeping compatibility with the old one.
The AST module throws errors on encountering a BOM.
For a file without a BOM this change makes no difference, but for one with a BOM, the mark character is skipped.
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.
It seems like this bandaid to avoid some build-system related overrides causes more problems than it fixes.
Let's just deal with reality up-front and hope that https://github.com/python-poetry/poetry/issues/2789 will be fixed at some point.
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.