about summary refs log tree commit diff
path: root/pkgs/development/python-modules/flask-assets/default.nix
blob: 46e225783493f42c1a5385aa236f075b1f71b77b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
  lib,
  buildPythonPackage,
  fetchPypi,
  setuptools,
  flask,
  webassets,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "flask-assets";
  version = "2.1.0";
  pyproject = true;

  src = fetchPypi {
    pname = "Flask-Assets";
    inherit version;
    hash = "sha256-+E1lMv/lnJ/zUoheh0D/TaJcC8+s2AXwqAaBXkQ1SBM=";
  };

  patchPhase = ''
    substituteInPlace tests/test_integration.py --replace 'static_path=' 'static_url_path='
    substituteInPlace tests/test_integration.py --replace "static_folder = '/'" "static_folder = '/x'"
    substituteInPlace tests/test_integration.py --replace "'/foo'" "'/x/foo'"
  '';

  nativeBuildInputs = [ setuptools ];

  propagatedBuildInputs = [
    flask
    webassets
  ];

  doCheck = false; # tests are broken with webassets 2.0

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "flask_assets" ];

  meta = with lib; {
    homepage = "https://github.com/miracle2k/flask-assets";
    description = "Asset management for Flask, to compress and merge CSS and Javascript files";
    license = licenses.bsd2;
    maintainers = with maintainers; [ abbradar ];
  };
}