nixpkgs/pkgs/development/python-modules/sentry-sdk/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

68 lines
1.5 KiB
Nix

{ aiohttp
, blinker
, botocore
, bottle
, buildPythonPackage
, celery
, certifi
, chalice
, django
, falcon
, fetchPypi
, flask
, iana-etc
, isPy3k
, libredirect
, pyramid
, rq
, sanic
, sqlalchemy
, lib, stdenv
, tornado
, urllib3
, trytond
, werkzeug
, executing
, pure-eval
, asttokens
}:
buildPythonPackage rec {
pname = "sentry-sdk";
version = "0.19.4";
src = fetchPypi {
inherit pname version;
sha256 = "1052f0ed084e532f66cb3e4ba617960d820152aee8b93fc6c05bd53861768c1c";
};
checkInputs = [ blinker botocore chalice django flask tornado bottle rq falcon sqlalchemy werkzeug trytond
executing pure-eval asttokens ]
++ stdenv.lib.optionals isPy3k [ celery pyramid sanic aiohttp ];
propagatedBuildInputs = [ urllib3 certifi ];
# 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";
# no tests
doCheck = false;
pythonImportsCheck = [ "sentry_sdk" ];
meta = with lib; {
homepage = "https://github.com/getsentry/sentry-python";
description = "New Python SDK for Sentry.io";
license = licenses.bsd2;
maintainers = with maintainers; [ gebner ];
};
}