2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
|
|
|
buildPythonPackage,
|
|
|
|
isPyPy,
|
|
|
|
setuptools,
|
|
|
|
setuptools-scm,
|
|
|
|
flask,
|
2024-09-19 14:19:46 +00:00
|
|
|
zstandard,
|
2024-06-05 15:53:02 +00:00
|
|
|
brotli,
|
|
|
|
brotlicffi,
|
|
|
|
pytestCheckHook,
|
2020-06-15 15:56:04 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "1.15";
|
|
|
|
pname = "flask-compress";
|
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "colour-science";
|
|
|
|
repo = "flask-compress";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-J7d/OIUsDWM6DoXS0P4EOE3k6txXKm6m4Yq/EJk6FRE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
build-system = [
|
2023-10-09 19:29:22 +00:00
|
|
|
setuptools
|
2022-04-15 01:41:22 +00:00
|
|
|
setuptools-scm
|
|
|
|
];
|
2021-07-03 03:11:41 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
dependencies = [
|
2022-04-15 01:41:22 +00:00
|
|
|
flask
|
2024-09-19 14:19:46 +00:00
|
|
|
zstandard
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals (!isPyPy) [ brotli ] ++ lib.optionals isPyPy [ brotlicffi ];
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "flask_compress" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace-fail "setuptools_scm[toml]<8" "setuptools_scm"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2023-10-09 19:29:22 +00:00
|
|
|
description = "Compress responses in your Flask app with gzip, deflate or brotli";
|
2022-04-15 01:41:22 +00:00
|
|
|
homepage = "https://github.com/colour-science/flask-compress";
|
|
|
|
changelog = "https://github.com/colour-science/flask-compress/blob/v${version}/CHANGELOG.md";
|
2024-09-19 14:19:46 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ nickcao ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|