depot/third_party/nixpkgs/pkgs/development/python-modules/flask-compress/default.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

53 lines
1.2 KiB
Nix

{
lib,
fetchFromGitHub,
buildPythonPackage,
isPyPy,
setuptools,
setuptools-scm,
flask,
zstandard,
brotli,
brotlicffi,
pytestCheckHook,
}:
buildPythonPackage rec {
version = "1.15";
pname = "flask-compress";
pyproject = true;
src = fetchFromGitHub {
owner = "colour-science";
repo = "flask-compress";
rev = "refs/tags/v${version}";
hash = "sha256-J7d/OIUsDWM6DoXS0P4EOE3k6txXKm6m4Yq/EJk6FRE=";
};
build-system = [
setuptools
setuptools-scm
];
dependencies = [
flask
zstandard
] ++ lib.optionals (!isPyPy) [ brotli ] ++ lib.optionals isPyPy [ brotlicffi ];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "flask_compress" ];
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "setuptools_scm[toml]<8" "setuptools_scm"
'';
meta = {
description = "Compress responses in your Flask app with gzip, deflate or brotli";
homepage = "https://github.com/colour-science/flask-compress";
changelog = "https://github.com/colour-science/flask-compress/blob/v${version}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ nickcao ];
};
}