TyberiusPrime / uv2nix_hammer_overrides

Override collection for uv2nix
MIT License
6 stars 1 forks source link

Conflicting files arre not detected #5

Open dschrempf opened 4 hours ago

dschrempf commented 4 hours ago

When two Python packages ship the same documentation file, the collision needs to be handled with manual overrides. That's not a big deal, but maybe we can also find automatic overrides for these cases?

For example, skpro, and sktime both ship

One can solve this collision using the following override

{ pkgs }:
final: prev: {
  skpro = prev.skpro.overrideAttrs (old: {
    postInstall = ''
      rm $out/lib/python${final.python.pythonVersion}/site-packages/build_tools/changelog.py
      rm $out/lib/python${final.python.pythonVersion}/site-packages/docs/source/conf.py
    '';
  });
}
TyberiusPrime commented 2 hours ago

Thanks for your interest.

I have been handling these when a single package triggers them (because that's how my 15k-top-python-packages project is set up, one package at a time).

I don't quite see how we could detect them for arbitrary package combinations though. I mean, I could try a project that has every successfully build package in it...

dschrempf commented 1 hour ago

Yes, I agree. Especially since it is not easy to decide which package to prefer. Also, if this package is installed alone, the file should NOT be removed...