3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/sentry-sdk/default.nix
Ruud van Asseldonk 302aed5ab4 python3Packages.sentry-sdk: fix trytond dependency
Tryton is an optional dependency, if it is present, Sentry can integrate
it, but when it is not present, Sentry should not pull it in as a
propagated build input, it is only required for the tests that test this
specific integration.

In particular, pulling in trytond creates a transitive dependency on
simplejson, which makes "requests" behave differently in a way that can
break error handling.
2020-07-28 09:10:28 -07:00

55 lines
1.3 KiB
Nix

{ aiohttp
, bottle
, buildPythonPackage
, celery
, certifi
, django
, falcon
, fetchPypi
, flask
, iana-etc
, isPy3k
, libredirect
, pyramid
, rq
, sanic
, sqlalchemy
, stdenv
, tornado
, urllib3
, trytond
, werkzeug
}:
buildPythonPackage rec {
pname = "sentry-sdk";
version = "0.14.4";
src = fetchPypi {
inherit pname version;
sha256 = "0e5e947d0f7a969314aa23669a94a9712be5a688ff069ff7b9fc36c66adc160c";
};
checkInputs = [ django flask tornado bottle rq falcon sqlalchemy werkzeug trytond ]
++ stdenv.lib.optionals isPy3k [ celery pyramid sanic aiohttp ];
propagatedBuildInputs = [ urllib3 certifi ];
meta = with stdenv.lib; {
homepage = "https://github.com/getsentry/sentry-python";
description = "New Python SDK for Sentry.io";
license = licenses.bsd2;
maintainers = with maintainers; [ gebner ];
};
# The Sentry tests need access to `/etc/protocols` (the tests call
# `socket.getprotobyname('tcp')`, which reads from this file). Normally
# this path isn't available in the sandbox. Therefore, use libredirect
# to make on eavailable from `iana-etc`. This is a test-only operation.
preCheck = ''
export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols
export LD_PRELOAD=${libredirect}/lib/libredirect.so
'';
postCheck = "unset NIX_REDIRECTS LD_PRELOAD";
}