Since
7f802c7046
using --suffix-each in makeWrapperArgs is no longer supported and breaks
like this:
$ nix-build ./any-mach-nix-env-with-latest-nixpkgs.nix
[...]
<stdin>: In function 'main':
<stdin>:9:6: error: #error makeCWrapper: Unknown argument --suffix-each
<stdin>:10:6: error: #error makeCWrapper: Unknown argument PATH
<stdin>:11:6: error: #error makeCWrapper: Unknown argument :
<stdin>:12:6: error: #error makeCWrapper: Unknown argument
builder for '/nix/store/41713mrzrqlq12kgfgcx10wmdvmkfh7k-python3-3.9.12-env.drv' failed with exit code 1
So replace it with multiple --suffix args, which the new
makeBinaryWrapper/makeCWrapper program supports (and is compatible with
the old makeWrapper).
Fixes https://github.com/DavHau/mach-nix/issues/444.
- retrieve dependency information for nixpkgs packages only from sdist and not from wheel provider
- skip dependency removal if package dependencies are unknown
Otherwise, it is likely that there will be collisions building the python environment,
as the dependencies of packages in packagesExtra won't match with the dependencies
calculated by mach-nix.
As a side-effect, this also causes the dependencies of mach-nix built packages included
by the `nixpkgs` provider to be included in dependency resolution.
This changes the internal format used to pass version information for nix to
python to not require parsing strings. This new format also makes it easier
to pass additional information (such as requirements, when available).
Given that we update the dependencies of all the packages we add to the
override, and remove any dependencies of those packages that we don't override,
there is no need to recursivly update the dependencies, since the dependcies we
are adding have already had their dependencies updated.
This switches to using `packaging.version` for version numbers
and `packaging.specifiers` for handling specifiers, the later
which implements the PEP440 logic for prereleases.