From 3ea80681813553bae50d5c411869f94d2ca29373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Thu, 16 Jun 2016 11:49:19 +0100 Subject: [PATCH] buildPythonPackage: be able to disable package conflict check --- doc/languages-frameworks/python.md | 1 + pkgs/development/python-modules/generic/default.nix | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/languages-frameworks/python.md b/doc/languages-frameworks/python.md index 50acc7f28f78..809e51460848 100644 --- a/doc/languages-frameworks/python.md +++ b/doc/languages-frameworks/python.md @@ -532,6 +532,7 @@ All parameters from `mkDerivation` function are still supported. * `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"]`. * `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'"]. * `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`. +* `catchConflicts` If `true`, abort package build if a package name appears more than once in dependency tree. Default is `true`. #### `buildPythonApplication` function diff --git a/pkgs/development/python-modules/generic/default.nix b/pkgs/development/python-modules/generic/default.nix index 7221bac320c9..38d74e082445 100644 --- a/pkgs/development/python-modules/generic/default.nix +++ b/pkgs/development/python-modules/generic/default.nix @@ -42,6 +42,9 @@ # Additional flags to pass to "pip install". , installFlags ? [] +# Raise an error if two packages are installed with the same name +, catchConflicts ? true + , format ? "setup" , ... } @ attrs: @@ -141,7 +144,7 @@ python.stdenv.mkDerivation (builtins.removeAttrs attrs ["disabled" "doCheck"] // postFixup = attrs.postFixup or '' wrapPythonPrograms - + '' + lib.optionalString catchConflicts '' # check if we have two packages with the same name in closure and fail # this shouldn't happen, something went wrong with dependencies specs ${python.interpreter} ${./catch_conflicts.py}