summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/flask-gravatar/default.nix
blob: bf5deaa0218609c169e92d7442916bd651a35a2f (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
  lib,
  buildPythonPackage,
  fetchPypi,
  fetchpatch,

  # build-system
  setuptools,

  # dependencies
  flask,

  # tests
  pytestCheckHook,
  pytest-cov-stub,
  pygments,
}:

buildPythonPackage rec {
  pname = "flask-gravatar";
  version = "0.5.0";
  pyproject = true;

  src = fetchPypi {
    pname = "Flask-Gravatar";
    inherit version;
    sha256 = "YGZfMcLGEokdto/4Aek+06CIHGyOw0arxk0qmSP1YuE=";
  };

  patches = [
    (fetchpatch {
      # flask 3.0 compat
      url = "https://github.com/zzzsochi/Flask-Gravatar/commit/d74d70d9695c464b602c96c2383d391b38ed51ac.patch";
      hash = "sha256-tCKkA2io/jhvrh6RhTeEw4AKnIZc9hsqTf2qItUsdjo=";
    })
  ];

  postPatch = ''
    sed -i setup.py \
     -e "s|tests_require=tests_require,||g" \
     -e "s|extras_require=extras_require,||g" \
     -e "s|setup_requires=setup_requires,||g"
    # pep8 is deprecated
    substituteInPlace pytest.ini \
     --replace-fail "--pep8" ""
  '';

  build-system = [ setuptools ];

  dependencies = [ flask ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-cov-stub
    pygments
  ];

  pythonImportsCheck = [ "flask_gravatar" ];

  meta = {
    homepage = "https://github.com/zzzsochi/Flask-Gravatar";
    description = "Small and simple integration of gravatar into flask";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ gador ];
  };
}