mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-03-08 08:24:10 +01:00
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:
pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
for f in $(find -name '*.nix'); do
grep -q "$pattern" "$f" || continue
sed -i "/$pattern/d" "$f"
if [ $(grep -c pythonOlder "$f") == 1 ]; then
sed -i '/^\s*pythonOlder,\s*$/d' "$f"
fi
nixfmt "$f"
done
65 lines
1.6 KiB
Nix
65 lines
1.6 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
dataclasses-json,
|
|
fetchFromGitHub,
|
|
fetchpatch,
|
|
limiter,
|
|
requests,
|
|
responses,
|
|
setuptools,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "spyse-python";
|
|
version = "2.2.3";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "spyse-com";
|
|
repo = "spyse-python";
|
|
tag = "v${version}";
|
|
hash = "sha256-c7BAJOplWNcd9v7FrEZuMHHdMpqtHljF7YpbdQYAMxA=";
|
|
};
|
|
|
|
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";
|
|
hash = "sha256-PoWPJCK/Scsh4P7lr97u4JpVHXNlY0C9rJgY4TDYmv0=";
|
|
})
|
|
];
|
|
|
|
pythonRemoveDeps = [ "dataclasses" ];
|
|
|
|
postPatch = ''
|
|
substituteInPlace setup.py \
|
|
--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"
|
|
'';
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
dependencies = [
|
|
requests
|
|
dataclasses-json
|
|
responses
|
|
limiter
|
|
];
|
|
|
|
# Tests requires an API token
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "spyse" ];
|
|
|
|
meta = {
|
|
description = "Python module for spyse.com API";
|
|
homepage = "https://github.com/spyse-com/spyse-python";
|
|
changelog = "https://github.com/spyse-com/spyse-python/releases/tag/v${version}";
|
|
license = with lib.licenses; [ mit ];
|
|
maintainers = with lib.maintainers; [ fab ];
|
|
};
|
|
}
|