Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / spyse-python / default.nix
blob0064454a1eaf8abe7fc26f6c1362f4a5e467bcec
1 { lib
2 , buildPythonPackage
3 , dataclasses-json
4 , fetchFromGitHub
5 , fetchpatch
6 , limiter
7 , pythonOlder
8 , requests
9 , responses
12 buildPythonPackage rec {
13   pname = "spyse-python";
14   version = "2.2.3";
15   format = "setuptools";
17   disabled = pythonOlder "3.8";
19   src = fetchFromGitHub {
20     owner = "spyse-com";
21     repo = pname;
22     rev = "v${version}";
23     sha256 = "041k0037anwaxp2mh7mdk8rdsw9hdr3arigyyqfxfn35x8j41c3k";
24   };
26   propagatedBuildInputs = [
27     requests
28     dataclasses-json
29     responses
30     limiter
31   ];
33   # Tests requires an API token
34   doCheck = false;
36   patches = [
37     # Update limiter import and rate limit, https://github.com/spyse-com/spyse-python/pull/11
38     (fetchpatch {
39       name = "support-later-limiter.patch";
40       url = "https://github.com/spyse-com/spyse-python/commit/ff68164c514dfb28ab77d8690b3a5153962dbe8c.patch";
41       hash = "sha256-PoWPJCK/Scsh4P7lr97u4JpVHXNlY0C9rJgY4TDYmv0=";
42     })
43   ];
45   postPatch = ''
46     substituteInPlace setup.py \
47       --replace "'dataclasses~=0.6'," "" \
48       --replace "responses~=0.13.3" "responses>=0.13.3" \
49       --replace "limiter~=0.1.2" "limiter>=0.1.2" \
50       --replace "requests~=2.26.0" "requests>=2.26.0"
51   '';
53   pythonImportsCheck = [
54     "spyse"
55   ];
57   meta = with lib; {
58     description = "Python module for spyse.com API";
59     homepage = "https://github.com/spyse-com/spyse-python";
60     license = with licenses; [ mit ];
61     maintainers = with maintainers; [ fab ];
62   };