diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2016-12-04 10:16:14 +0100 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2016-12-04 10:17:33 +0100 |
commit | 374ac13a6ee283fe45c489d642ea39a6199a5c48 (patch) | |
tree | 50fcf61a366c8600c4e83c64bb34930c0dc8c9a7 /doc/languages-frameworks/python.md | |
parent | 84d737cfe92967b9759f191d1b7c90ff87bea02b (diff) | |
download | nixpkgs-374ac13a6ee283fe45c489d642ea39a6199a5c48.tar nixpkgs-374ac13a6ee283fe45c489d642ea39a6199a5c48.tar.gz nixpkgs-374ac13a6ee283fe45c489d642ea39a6199a5c48.tar.bz2 nixpkgs-374ac13a6ee283fe45c489d642ea39a6199a5c48.tar.lz nixpkgs-374ac13a6ee283fe45c489d642ea39a6199a5c48.tar.xz nixpkgs-374ac13a6ee283fe45c489d642ea39a6199a5c48.tar.zst nixpkgs-374ac13a6ee283fe45c489d642ea39a6199a5c48.zip |
Docs: fix Python docs
Diffstat (limited to 'doc/languages-frameworks/python.md')
-rw-r--r-- | doc/languages-frameworks/python.md | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/doc/languages-frameworks/python.md b/doc/languages-frameworks/python.md index df60cc1e573..121e123c8cf 100644 --- a/doc/languages-frameworks/python.md +++ b/doc/languages-frameworks/python.md @@ -409,10 +409,10 @@ and in this case the `python35` interpreter is automatically used. ### Interpreters -Versions 2.6, 2.7, 3.3, 3.4 and 3.5 of the CPython interpreter are as respectively +Versions 2.6, 2.7, 3.3, 3.4 and 3.5 of the CPython interpreter are available as respectively `python26`, `python27`, `python33`, `python34` and `python35`. The PyPy interpreter is available as `pypy`. The aliases `python2` and `python3` correspond to respectively `python27` and -`python35`. The default interpreter, `python`, maps to `python3`. +`python35`. The default interpreter, `python`, maps to `python2`. The Nix expressions for the interpreters can be found in `pkgs/development/interpreters/python`. @@ -437,14 +437,16 @@ Each interpreter has the following attributes: ### Building packages and applications -Python packages (libraries) and applications that use `setuptools` or -`distutils` are typically built with respectively the `buildPythonPackage` and -`buildPythonApplication` functions. +Python libraries and applications that use `setuptools` or +`distutils` are typically build with respectively the `buildPythonPackage` and +`buildPythonApplication` functions. These two functions also support installing a `wheel`. All Python packages reside in `pkgs/top-level/python-packages.nix` and all -applications elsewhere. Some packages are also defined in +applications elsewhere. In case a package is used as both a library and an application, +then the package should be in `pkgs/top-level/python-packages.nix` since only those packages are made +available for all interpreter versions. The preferred location for library expressions is in `pkgs/development/python-modules`. It is important that these packages are -called in `pkgs/top-level/python-packages.nix` and not elsewhere, to guarantee +called from `pkgs/top-level/python-packages.nix` and not elsewhere, to guarantee the right version of the package is built. Based on the packages defined in `pkgs/top-level/python-packages.nix` an @@ -462,14 +464,14 @@ and the aliases * `pkgs.python2Packages` pointing to `pkgs.python27Packages` * `pkgs.python3Packages` pointing to `pkgs.python35Packages` -* `pkgs.pythonPackages` pointing to `pkgs.python3Packages` +* `pkgs.pythonPackages` pointing to `pkgs.python2Packages` #### `buildPythonPackage` function The `buildPythonPackage` function is implemented in `pkgs/development/interpreters/python/build-python-package.nix` -and can be used as: +The following is an example: twisted = buildPythonPackage { name = "twisted-8.1.0"; |