nixpkgs/pkgs/development/python-modules/webtest/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

45 lines
915 B
Nix

{ lib, stdenv
, buildPythonPackage
, fetchPypi
, isPy27
, nose
, webob
, six
, beautifulsoup4
, waitress
, mock
, pyquery
, wsgiproxy2
, PasteDeploy
}:
buildPythonPackage rec {
version = "2.0.32";
pname = "webtest";
disabled = isPy27; # paste.deploy is not longer a valid import
src = fetchPypi {
pname = "WebTest";
inherit version;
sha256 = "4221020d502ff414c5fba83c1213985b83219cb1cc611fe58aa4feaf96b5e062";
};
preConfigure = ''
substituteInPlace setup.py --replace "nose<1.3.0" "nose"
'';
propagatedBuildInputs = [ webob six beautifulsoup4 waitress ];
checkInputs = [ nose mock PasteDeploy wsgiproxy2 pyquery ];
# Some of the tests use localhost networking.
__darwinAllowLocalNetworking = true;
meta = with lib; {
description = "Helper to test WSGI applications";
homepage = "https://webtest.readthedocs.org/en/latest/";
license = licenses.mit;
};
}