python312Packages.flask-allowed-hosts: 1.1.2 -> 1.2.0 (#361132)
[NixPkgs.git] / pkgs / development / python-modules / flask-compress / default.nix
blobc0239f2a6c86ddf8f33ce1b5c0bbb72cfc856433
2   lib,
3   fetchFromGitHub,
4   buildPythonPackage,
5   isPyPy,
6   setuptools,
7   setuptools-scm,
8   flask,
9   flask-caching,
10   zstandard,
11   brotli,
12   brotlicffi,
13   pytestCheckHook,
16 buildPythonPackage rec {
17   version = "1.17";
18   pname = "flask-compress";
19   pyproject = true;
21   src = fetchFromGitHub {
22     owner = "colour-science";
23     repo = "flask-compress";
24     rev = "refs/tags/v${version}";
25     hash = "sha256-87fjJxaS7eJbOkSUljnhqFIeahoS4L2tAOhmv4ryVUM=";
26   };
28   build-system = [
29     setuptools
30     setuptools-scm
31   ];
33   dependencies = [
34     flask
35     zstandard
36   ] ++ lib.optionals (!isPyPy) [ brotli ] ++ lib.optionals isPyPy [ brotlicffi ];
38   nativeCheckInputs = [
39     pytestCheckHook
40     flask-caching
41   ];
43   pythonImportsCheck = [ "flask_compress" ];
45   postPatch = ''
46     substituteInPlace pyproject.toml \
47       --replace-fail "setuptools_scm[toml]<8" "setuptools_scm"
48   '';
50   meta = {
51     description = "Compress responses in your Flask app with gzip, deflate or brotli";
52     homepage = "https://github.com/colour-science/flask-compress";
53     changelog = "https://github.com/colour-science/flask-compress/blob/v${version}/CHANGELOG.md";
54     license = lib.licenses.mit;
55     maintainers = with lib.maintainers; [ nickcao ];
56   };