diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2016-08-30 17:06:17 +0200 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2016-08-30 17:06:44 +0200 |
commit | 95021f061a3df49e041b474a7088f105c3a69dd1 (patch) | |
tree | 6472405aa8cd87b99ca72f01a0f9af42baad0d15 /doc | |
parent | c7bbe3dd4a5528cb223da091dbaaba409b48fe9d (diff) | |
download | nixpkgs-95021f061a3df49e041b474a7088f105c3a69dd1.tar nixpkgs-95021f061a3df49e041b474a7088f105c3a69dd1.tar.gz nixpkgs-95021f061a3df49e041b474a7088f105c3a69dd1.tar.bz2 nixpkgs-95021f061a3df49e041b474a7088f105c3a69dd1.tar.lz nixpkgs-95021f061a3df49e041b474a7088f105c3a69dd1.tar.xz nixpkgs-95021f061a3df49e041b474a7088f105c3a69dd1.tar.zst nixpkgs-95021f061a3df49e041b474a7088f105c3a69dd1.zip |
Doc: fix python override examples
Diffstat (limited to 'doc')
-rw-r--r-- | doc/languages-frameworks/python.md | 24 |
1 files 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 <nixpkgs> {}; (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 <nixpkgs> {}; 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 <nixpkgs> {}; + +(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 |