2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
dataclasses-json,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
limiter,
|
|
|
|
pythonOlder,
|
|
|
|
requests,
|
|
|
|
responses,
|
|
|
|
setuptools,
|
2021-10-11 16:52:03 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "spyse-python";
|
|
|
|
version = "2.2.3";
|
2024-01-25 14:12:00 +00:00
|
|
|
pyproject = true;
|
2021-10-11 16:52:03 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "spyse-com";
|
2024-01-25 14:12:00 +00:00
|
|
|
repo = "spyse-python";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-c7BAJOplWNcd9v7FrEZuMHHdMpqtHljF7YpbdQYAMxA=";
|
2021-10-11 16:52:03 +00:00
|
|
|
};
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
patches = [
|
|
|
|
# Update limiter import and rate limit, https://github.com/spyse-com/spyse-python/pull/11
|
|
|
|
(fetchpatch {
|
|
|
|
name = "support-later-limiter.patch";
|
|
|
|
url = "https://github.com/spyse-com/spyse-python/commit/ff68164c514dfb28ab77d8690b3a5153962dbe8c.patch";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-PoWPJCK/Scsh4P7lr97u4JpVHXNlY0C9rJgY4TDYmv0=";
|
2022-02-20 05:27:41 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
pythonRemoveDeps = [ "dataclasses" ];
|
|
|
|
|
2021-10-11 16:52:03 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
2024-09-19 14:19:46 +00:00
|
|
|
--replace-fail "dataclasses-json~=0.5.4" "dataclasses-json>=0.5.4" \
|
|
|
|
--replace-fail "responses~=0.13.3" "responses>=0.13.3" \
|
|
|
|
--replace-fail "limiter~=0.1.2" "limiter>=0.1.2" \
|
|
|
|
--replace-fail "requests~=2.26.0" "requests>=2.26.0"
|
2021-10-11 16:52:03 +00:00
|
|
|
'';
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
build-system = [ setuptools ];
|
2024-01-25 14:12:00 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
dependencies = [
|
2024-01-25 14:12:00 +00:00
|
|
|
requests
|
|
|
|
dataclasses-json
|
|
|
|
responses
|
|
|
|
limiter
|
|
|
|
];
|
|
|
|
|
|
|
|
# Tests requires an API token
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "spyse" ];
|
2021-10-11 16:52:03 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python module for spyse.com API";
|
|
|
|
homepage = "https://github.com/spyse-com/spyse-python";
|
2024-01-25 14:12:00 +00:00
|
|
|
changelog = "https://github.com/spyse-com/spyse-python/releases/tag/v${version}";
|
2021-10-11 16:52:03 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|