Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / url-normalize / default.nix
blobb851eccbe26fd1105bfac8c66c0233df2a91a05e
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , fetchpatch
5 , poetry-core
6 , pytest-flakes
7 , pytest-mock
8 , pytest-socket
9 , pytestCheckHook
10 , six
13 buildPythonPackage rec {
14   pname = "url-normalize";
15   version = "1.4.3";
16   format = "pyproject";
18   src = fetchFromGitHub {
19     owner = "niksite";
20     repo = pname;
21     rev = version;
22     hash = "sha256-WE3MM9B/voI23taFbLp2FYhl0uxOfuUWsaCTBG1hyiY=";
23   };
25   nativeBuildInputs = [
26     poetry-core
27   ];
29   propagatedBuildInputs = [
30     six
31   ];
33   nativeCheckInputs = [
34     pytest-flakes
35     pytest-mock
36     pytest-socket
37     pytestCheckHook
38   ];
40   patches = [
41     # Switch to poetry-core, https://github.com/niksite/url-normalize/pull/28
42     (fetchpatch {
43       name = "switch-to-poetry-core.patch";
44       url = "https://github.com/niksite/url-normalize/commit/b8557b10c977b191cc9d37e6337afe874a24ad08.patch";
45       hash = "sha256-SVCQATV9V6HbLmjOHs7V7eBagO0PuqZLubIJghBYfQQ=";
46     })
47   ];
49   postPatch = ''
50     sed -i "/--cov/d" tox.ini
51     sed -i "/--flakes/d" tox.ini
52   '';
54   pythonImportsCheck = [
55     "url_normalize"
56   ];
58   meta = with lib; {
59     description = "URL normalization for Python";
60     homepage = "https://github.com/niksite/url-normalize";
61     license = with licenses; [ mit ];
62     maintainers = with maintainers; [ fab ];
63   };