2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-12-06 16:07:01 +00:00
|
|
|
, fetchPypi
|
2023-07-15 17:15:38 +00:00
|
|
|
, fetchpatch
|
2023-01-20 10:41:00 +00:00
|
|
|
, pythonAtLeast
|
2020-09-25 04:45:31 +00:00
|
|
|
, pythonOlder
|
2021-12-06 16:07:01 +00:00
|
|
|
, idna
|
2020-04-24 23:36:52 +00:00
|
|
|
, multidict
|
2020-09-25 04:45:31 +00:00
|
|
|
, typing-extensions
|
2021-12-06 16:07:01 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "yarl";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "1.8.2";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-01-20 10:41:00 +00:00
|
|
|
hash = "sha256-SdQ0AsbjATrQl4YCv2v1MoU1xI0ZIwS5G5ejxnkLFWI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/aio-libs/yarl/issues/876
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/aio-libs/yarl/commit/0a94c6e4948e00fff072c0cf367afbf4ac36f906.patch";
|
|
|
|
hash = "sha256-bqT46OLZLkBef8FQ1L95ITD70mC3+WIkr3+h2ekKrvE=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i '/^addopts/d' setup.cfg
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
idna
|
|
|
|
multidict
|
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# don't import yarl from ./ so the C extension is available
|
|
|
|
pushd tests
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
disabledTests = lib.optionals (pythonAtLeast "3.11") [
|
|
|
|
"test_not_a_scheme2"
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postCheck = ''
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "yarl" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-01-20 10:41:00 +00:00
|
|
|
changelog = "https://github.com/aio-libs/yarl/blob/v${version}/CHANGES.rst";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Yet another URL library";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://github.com/aio-libs/yarl";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|