From 95021f061a3df49e041b474a7088f105c3a69dd1 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Tue, 30 Aug 2016 17:06:17 +0200 Subject: [PATCH] Doc: fix python override examples --- doc/languages-frameworks/python.md | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/doc/languages-frameworks/python.md b/doc/languages-frameworks/python.md index 9c67dc4ebe6..e342c24063a 100644 --- a/doc/languages-frameworks/python.md +++ b/doc/languages-frameworks/python.md @@ -715,8 +715,8 @@ Python attribute sets are created for each interpreter version. We will therefor In the following example we change the name of the package `pandas` to `foo`. ``` newpkgs = pkgs.overridePackages(self: super: rec { - python35Packages = super.python35Packages.override { - self = python35Packages // { pandas = python35Packages.pandas.override{name="foo";};}; + python35Packages = (super.python35Packages.override { self = python35Packages;}) + // { pandas = super.python35Packages.pandas.override {name = "foo";}; }; }); ``` @@ -727,8 +727,8 @@ with import {}; (let newpkgs = pkgs.overridePackages(self: super: rec { - python35Packages = super.python35Packages.override { - self = python35Packages // { pandas = python35Packages.pandas.override{name="foo";};}; + python35Packages = (super.python35Packages.override { self = python35Packages;}) + // { pandas = super.python35Packages.pandas.override {name = "foo";}; }; }); in newpkgs.python35.withPackages (ps: [ps.blaze]) @@ -743,7 +743,7 @@ with import {}; newpkgs = pkgs.overridePackages(self: super: rec { python35Packages = super.python35Packages.override { - self = python35Packages // { scipy = python35Packages.scipy_0_16;}; + self = python35Packages // { scipy = python35Packages.scipy_0_17;}; }; }); in newpkgs.python35.withPackages (ps: [ps.blaze]) @@ -751,6 +751,20 @@ in newpkgs.python35.withPackages (ps: [ps.blaze]) ``` The requested package `blaze` depends upon `pandas` which itself depends on `scipy`. +A similar example but now using `django` +``` +with import {}; + +(let + +newpkgs = pkgs.overridePackages(self: super: rec { + python27Packages = (super.python27Packages.override {self = python27Packages;}) + // { django = super.python27Packages.django_1_9; }; +}); +in newpkgs.python27.withPackages (ps: [ps.django_guardian ]) +).env +``` + ### `python setup.py bdist_wheel` cannot create .whl Executing `python setup.py bdist_wheel` fails with