nixpkgs/pkgs/development/python-modules/httpx/default.nix

71 lines
1 KiB
Nix
Raw Normal View History

2019-12-29 18:05:45 +00:00
{ lib
, buildPythonPackage
, fetchFromGitHub
, certifi
, hstspreload
, chardet
, h11
, h2
, idna
, rfc3986
, sniffio
, isPy27
, pytest
, pytestcov
, trustme
, uvicorn
, trio
, brotli
2020-04-02 07:23:48 +00:00
, urllib3
2019-12-29 18:05:45 +00:00
}:
buildPythonPackage rec {
pname = "httpx";
2020-04-02 07:23:48 +00:00
version = "0.12.1";
2019-12-29 18:05:45 +00:00
disabled = isPy27;
src = fetchFromGitHub {
owner = "encode";
repo = pname;
rev = version;
2020-04-02 07:23:48 +00:00
sha256 = "1nrp4h1ppb5vll81fzxmks82p0hxcil9f3mja3dgya511kc703h6";
2019-12-29 18:05:45 +00:00
};
propagatedBuildInputs = [
certifi
hstspreload
chardet
h11
h2
idna
rfc3986
sniffio
2020-04-02 07:23:48 +00:00
urllib3
2019-12-29 18:05:45 +00:00
];
checkInputs = [
pytest
pytestcov
trustme
uvicorn
trio
brotli
];
postPatch = ''
substituteInPlace setup.py \
--replace "h11==0.8.*" "h11"
'';
checkPhase = ''
PYTHONPATH=.:$PYTHONPATH pytest
'';
meta = with lib; {
description = "The next generation HTTP client";
homepage = "https://github.com/encode/httpx";
2019-12-29 18:05:45 +00:00
license = licenses.bsd3;
maintainers = [ maintainers.costrouc ];
};
}