git.iko.soy/typeable/nixpkgs
on master help sign in
buildPythonPackage: be able to disable package conflict check
commit3ea80681813553bae50d5c411869f94d2ca29373 authorDomen Kožar <domen@dev.si> dateThu 16 Jun 2016, 11:49 (10 years ago) parent5b7c6a1
2 files changed+5−1
doc/languages-frameworks/python.md+1 pkgs/development/python-modules/generic/default.nix+4−1
doc/languages-frameworks/python.md+1
@@ -532,6 +532,7 @@ All parameters from `mkDerivation` function are still supported.
532532* `makeWrapperArgs`: A list of strings. Arguments to be passed to `makeWrapper`, which wraps generated binaries. By default, the arguments to `makeWrapper` set `PATH` and `PYTHONPATH` environment variables before calling the binary. Additional arguments here can allow a developer to set environment variables which will be available when the binary is run. For example, `makeWrapperArgs = ["--set FOO BAR" "--set BAZ QUX"]`.
533533* `installFlags`: A list of strings. Arguments to be passed to `pip install`. To pass options to `python setup.py install`, use `--install-option`. E.g., `installFlags=["--install-option='--cpp_implementation'"].
534534* `format`: Format of the source. Options are `setup` for when the source has a `setup.py` and `setuptools` is used to build a wheel, and `wheel` in case the source is already a binary wheel. The default value is `setup`.
535+* `catchConflicts` If `true`, abort package build if a package name appears more than once in dependency tree. Default is `true`.
535536
536537#### `buildPythonApplication` function
537538
pkgs/development/python-modules/generic/default.nix+4−1
@@ -42,6 +42,9 @@
4242# Additional flags to pass to "pip install".
4343, installFlags ? []
4444
45+# Raise an error if two packages are installed with the same name
46+, catchConflicts ? true
47+
4548, format ? "setup"
4649
4750, ... } @ attrs:
@@ -141,7 +144,7 @@ python.stdenv.mkDerivation (builtins.removeAttrs attrs ["disabled" "doCheck"] //
141144
142145 postFixup = attrs.postFixup or ''
143146 wrapPythonPrograms
144−
147+ '' + lib.optionalString catchConflicts ''
145148 # check if we have two packages with the same name in closure and fail
146149 # this shouldn't happen, something went wrong with dependencies specs
147150 ${python.interpreter} ${./catch_conflicts.py}