2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2022-01-07 04:07:37 +00:00
|
|
|
, fetchpatch
|
|
|
|
, poetry-core
|
2021-02-05 17:12:51 +00:00
|
|
|
, pytest-flakes
|
|
|
|
, pytest-mock
|
|
|
|
, pytest-socket
|
|
|
|
, pytestCheckHook
|
|
|
|
, six
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "url-normalize";
|
|
|
|
version = "1.4.3";
|
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "niksite";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-01-07 04:07:37 +00:00
|
|
|
hash = "sha256-WE3MM9B/voI23taFbLp2FYhl0uxOfuUWsaCTBG1hyiY=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
six
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest-flakes
|
|
|
|
pytest-mock
|
|
|
|
pytest-socket
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
patches = [
|
|
|
|
# Switch to poetry-core, https://github.com/niksite/url-normalize/pull/28
|
|
|
|
(fetchpatch {
|
|
|
|
name = "switch-to-poetry-core.patch";
|
|
|
|
url = "https://github.com/niksite/url-normalize/commit/b8557b10c977b191cc9d37e6337afe874a24ad08.patch";
|
|
|
|
sha256 = "sha256-SVCQATV9V6HbLmjOHs7V7eBagO0PuqZLubIJghBYfQQ=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i "/--cov/d" tox.ini
|
|
|
|
sed -i "/--flakes/d" tox.ini
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"url_normalize"
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "URL normalization for Python";
|
|
|
|
homepage = "https://github.com/niksite/url-normalize";
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|