4a7f99d55d
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
44 lines
955 B
Nix
44 lines
955 B
Nix
{ lib, stdenv
|
|
, buildPythonPackage
|
|
, fetchFromGitHub
|
|
, mock
|
|
, nose
|
|
, pamqp
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
version = "2.0.1";
|
|
pname = "rabbitpy";
|
|
|
|
# No tests in the pypi tarball, so we directly fetch from git
|
|
src = fetchFromGitHub {
|
|
owner = "gmr";
|
|
repo = pname;
|
|
rev = version;
|
|
sha256 = "0m5z3i3d5adrz1wh6y35xjlls3cq6p4y9p1mzghw3k7hdvg26cck";
|
|
};
|
|
|
|
propagatedBuildInputs = [ pamqp ];
|
|
checkInputs = [ mock nose ];
|
|
|
|
checkPhase = ''
|
|
runHook preCheck
|
|
rm tests/integration_tests.py # Impure tests requiring network
|
|
nosetests tests
|
|
runHook postCheck
|
|
'';
|
|
|
|
postPatch = ''
|
|
# See: https://github.com/gmr/rabbitpy/issues/118
|
|
substituteInPlace setup.py \
|
|
--replace 'pamqp>=2,<3' 'pamqp'
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "A pure python, thread-safe, minimalistic and pythonic RabbitMQ client library";
|
|
homepage = "https://pypi.python.org/pypi/rabbitpy";
|
|
license = licenses.bsd3;
|
|
};
|
|
|
|
}
|