Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythonPackages: Switch to lib.makeScope for overrideScope support
This change allows previously ~final package sets to be overridden with overlays , e.g. you can do `pkgs.python.pkgs.overrideScope' (self: super: { ... })` whereas previously only `pkgs.python.override { packageOverrides = (self: super: { ... })` was possible. This therefore also allows packages definitions to transitively override dependencies. So e.g. if jupyterlab_server requires jsonschema >= 3, but the rest of the packages should still use jsonschema == 2, you can define it as such: jupyterlab_server = (self.overrideScope' (self: super: { jsonschema = self.jsonschema3; })).callPackage ../development/python-modules/jupyterlab_server { }; This applies the overlay to the whole dependency closure, whereas jupyterlab_server = callPackage ../development/python-modules/jupyterlab_server { jsonschema = self.jsonschema3; }; would only make it apply to jupyterlab_server itself, but not its dependencies, resulting in build-time errors. To get the desired effect without this change, this would be needed for this specific case: jupyterlab_server = callPackage ../development/python-modules/jupyterlab_server { jsonschema = self.jsonschema3; notebook = self.notebook.override { nbformat = self.nbformat.override { jsonschema = self.jsonschema3; }; nbconvert = self.nbconvert.override { nbformat = self.nbformat.override { jsonschema = self.jsonschema3; }; }; }; };
- Loading branch information