How to override/disable python build hooks?


Building some python38 packages fail due to sphinx-7.2.6 not supported for interpreter python3.8

The patch

I try to patch it by overriding the hook, however, even using overlays, I cannot get the hook to be overridden.
What is missing on the overlay to actually override the hook?
There is an alternative flag to disable the hook?


Here is a ready to use example using flakes

Maybe pythonPackagesExtensions?

pythonPackagesExtensions = pkgs.pythonPackagesExtensions ++ [ (_: pythonPackages: {
  sphinxHook = pythonPackages.toPythonModule pkgs.emptyDirectory;
}) ];

I think you’re encountering this:

Ha, indeed, and here I thought “sphinxHook” was actually the name of some Python package. So circumventing that guard could look something like:

pythonPackagesExtensions = stable.pythonPackagesExtensions ++ [ (_: pythonPackages: {
  sphinx = pythonPackages.sphinx.overrideAttrs (attrs: {
    disabled = false;
}) ];

Of course if you actually try to use the resulting python38Packages.sphinx you immediately encounter identical obstacles from its dependencies.