Commit Graph

44 Commits

Author SHA1 Message Date
Frederik Rietdijk
f7e28bf5d8 Split buildPythonPackage into setup hooks
This commit splits the `buildPythonPackage` into multiple setup hooks.

Generally, Python packages are built from source to wheels using `setuptools`.
The wheels are then installed with `pip`. Tests were often called with
`python setup.py test` but this is less common nowadays. Most projects
now use a different entry point for running tests, typically `pytest`
or `nosetests`.

Since the wheel format was introduced more tools were built to generate these,
e.g. `flit`. Since PEP 517 is provisionally accepted, defining a build-system
independent format (`pyproject.toml`), `pip` can now use that format to
execute the correct build-system.

In the past I've added support for PEP 517 (`pyproject`) to the Python
builder, resulting in a now rather large builder. Furthermore, it was not possible
to reuse components elsewhere. Therefore, the builder is now split into multiple
setup hooks.

The `setuptoolsCheckHook` is included now by default but in time it should
be removed from `buildPythonPackage` to make it easier to use another hook
(curently one has to pass in `dontUseSetuptoolsCheck`).
2019-09-06 15:18:45 +02:00
Frederik Rietdijk
7da15d9b36 buildPythonPackage: add support for setupPyGlobalFlags (2) 2019-07-15 17:47:57 +02:00
Frederik Rietdijk
271b57c219 Revert "buildPythonPackage: add support for setupPyDistFlags"
I merged this a bit too quick. We need to have a closer look at it.
See the points brought up in https://github.com/NixOS/nixpkgs/pull/64682.

This reverts commit 1e0ebdb8a4.
2019-07-13 13:25:32 +02:00
Kirill Boltaev
1e0ebdb8a4 buildPythonPackage: add support for setupPyDistFlags
Flags passed to the "python setup.py" command.
2019-07-13 09:47:00 +02:00
Frederik Rietdijk
f1ff85e61d Docs Python: fix example on how to override the package set
Not passing in the newly created interpreter as `self` results in an
incorrect `passthru`. Solves #64334.
2019-07-05 13:56:03 +02:00
Tom McLaughlin
7f3d805e1c Add documentation for recent permitUserSite change (#61502) 2019-05-15 08:27:59 +02:00
Linus Heckemann
b3d9da5f0a doc: fix syntax error in python documentation 2019-04-25 22:37:53 +02:00
cdyson37
6ea4aa481d
python-docs: typo 2019-04-23 10:37:10 +01:00
Daniel Schaefer
bac4d95aa2 treewide: Change URLs to HTTPS
Lots of URLs were HTTP redirect to HTTPS. Changed those and checked them
if there's actual content. Inspired by
https://github.com/NixOS/nixpkgs/issues/60004
2019-04-22 10:19:54 +02:00
worldofpeace
0ccfebf9f2 fix Including a derivation using callPackage
The example didn't use pkgs.
2019-03-24 05:33:07 -04:00
worldofpeace
94a409450a fixup! doc/python: cleanup examples, references 2019-03-24 05:29:53 -04:00
worldofpeace
63f244193b doc/python: cleanup examples, references 2019-03-22 22:50:30 -04:00
Felix Biggs
1e86c0a7df doc/python: remove unnecessary let statement 2019-03-22 22:20:55 -04:00
Frederik Rietdijk
1fccd25595 buildPythonPackage: always export LANG=C.UTF-8 2019-02-23 20:08:26 +01:00
Frederik Rietdijk
e7b4608d02 buildPythonPackage: initial support for PEP 517 2019-02-23 20:05:19 +01:00
Frederik Rietdijk
b4acd97729 buildPython*: enable strictDeps 2019-02-17 14:40:48 +01:00
Benjamin Hipple
6206a342e0 mkl: include Intel's libiomp.so in the MKL RPM unpack
Since Intel's default openmp implementation is available in the same src
tarball, we can just include it in the package. This means that `mkl` now "just
works" without any environment variables, fragile setup-hooks, or forced
propagation.

Since the openmp implementation is only needed at runtime (and for test cases),
users can substitute a different one if they prefer by exporting it with
`LD_PRELOAD`, which is how Intel recommends handling this. If they do not do so,
`libiomp.so` lives next to `libmkl_rt.so` and thus will be in the RPATH as a
sane default.

Since this still comes from the same src tarball, we can ship it without losing
the fixed-output derivation; likewise, since Hydra is not building or caching
these, shipping these proprietary packages costs no bandwidth for the nix
community.
2018-12-19 22:05:22 +01:00
Anders Kaseorg
85379a29ec pypy3: init at 6.0.0
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-12-19 09:53:31 +01:00
Frederik Rietdijk
7863aae5b2 Merge master into staging-next 2018-11-11 08:59:44 +01:00
Benjamin Hipple
a649f1c0cd doc: fix default python interpreter
The default for `python3` is currently `python36`.
2018-11-10 13:00:10 -05:00
Frederik Rietdijk
53d00c3351 Merge master into staging-next 2018-11-10 11:08:54 +01:00
Frederik Rietdijk
b1bdce0793 python34: remove
Python 3.4 will receive it's final patch release in March 2019 and there won't
be any releases anymore after that, so also not during NixOS 2019.03.

Python 3.4 is not used anymore in Nixpkgs. In any case, migrating code from
3.4 to 3.4+ is trivial.
2018-11-04 18:48:24 +01:00
Vladimír Čunát
a92a2c8e15
Merge branch 'master' into staging
Conflict: rename of pythondaemon -> python-daemon.
2018-11-02 14:40:14 +01:00
Benjamin Hipple
baf0703010 pythonPackages.pythondaemon: rename to pythonPackages.python-daemon
This commit renames the pythondaemon module to match its module name, github
name, and pypi name, which makes it easier to find and reference. In order to
avoid breaking any external users, I've left an alias with a deprecated warning.
2018-10-30 21:09:34 +01:00
Frederik Rietdijk
0f38d9669f python3 is now python37 instead of python36
With Python 3.7 now at 3.7.1, and Python 3.6 at it's final maintenance
mode release, it is time to move on to 3.7 as the default interpreter.
2018-10-24 20:05:44 +02:00
Chris Ostrouchov
277b73ab6f pythonPackages.{numpy,scipy,numexpr}: support MKL as BLAS
This adds support building with MKL.
2018-10-20 11:50:37 +02:00
Benjamin Hipple
1bcdf27c48 Update with code review feedback; add example python application 2018-10-12 10:06:25 +02:00
Benjamin Hipple
c0af13f1c8 python: update documentation
This touches up a handful of places in the python documentation to try to make
the current best-practices more obvious. In particular, I often find the
function signatures (what to pass, what not to pass) confusing and have added
them to the docs.

Also updated the metas to be more consistent with the most frequently used
modern style.
2018-10-12 10:06:25 +02:00
Jörg Thalheim
86bd041196 docs/python: fix attribute naming example
https://github.com/NixOS/nixpkgs/pull/45822#issuecomment-417566642
2018-08-31 08:02:55 +01:00
Jörg Thalheim
e5124b0f75 doc/python: convention for attributes names
cc @FRidh, @dotlambda
2018-08-31 06:52:53 +01:00
Frederik Rietdijk
b7e0c40d29 docs python: python.buildEnv does not include buildPythonApplication modules
Clarify the issue encountered at
https://github.com/NixOS/nixpkgs/issues/45503
2018-08-26 09:31:39 +02:00
Erik Arvstedt
eb60a87887 python-docs: minor typo and grammar fixes 2018-07-26 14:28:23 +02:00
Erik Arvstedt
fa01100f40 python-docs: fix override examples
Use example package `zerobin` instead of `bepasty-server` which
is no longer part of python-packages.
This fixes the examples for current nixpkgs versions.
2018-07-25 21:33:48 +02:00
Erik Arvstedt
42e3727aa2 python docs: improve override example
1. Use the same approach like in the overlay example:
   Override `python` instead of `pythonPackages` so that
   `python.pkgs` refers to the new package set like `pythonPackages`.

   This also fixes a bug in the original example where
   `pkgs.fetchgit` was not in scope.

   Add an extra example to illustrate how to override just a
   package set.

2. Fix mix-up between `super` and `self` in the explanation text.
   Also, simplify the explanation.
2018-07-25 21:29:25 +02:00
Erik Arvstedt
a8f54972f4 python docs: improve overlay example
The `pythonPackages` definition is redundant
2018-07-25 16:44:56 +02:00
Alyssa Ross
79ab3370ed manual: fix buildPythonPackage example (#42866) 2018-07-03 17:19:18 +02:00
Matthew Pickering
11551f06e2
Update Python documentation overlay
Using a recursive attribute set is not recommended.
2018-06-30 16:35:49 +01:00
Ryan Mulligan
1d54dc6841 treewide: http -> https 2018-06-29 17:18:27 -07:00
Ryan Mulligan
fce8f26af6 treewide: http -> https (#42665) 2018-06-27 22:12:57 +02:00
Frederik Rietdijk
7c9d95fef5 python37: init at 3.7.0rc1 2018-06-25 10:41:32 +02:00
Rolf Schröder
979ac47cd8 doc/languages-frameworks/python.section.md: fix typo (#41824) 2018-06-11 10:24:07 +01:00
Frederik Rietdijk
39e9de1b85 Docs: improve Python section
Explain `toPythonApplication` and `toPythonModule` as well as some minor improvements.
2018-05-30 19:08:06 +02:00
Will Dietz
4f273627a1 tree-wide: fix instance of "meta.maintainer" -> "meta.maintainers"
Encountered one of these when using check-meta, did a quick
search to find other instances.
2018-04-19 10:41:12 -05:00
Graham Christensen
92d53362d4
Move all nixpkgs doc files in to the doc directory
This makes a makefile-driven developer workflow nicer.
2018-03-25 19:52:00 -04:00