summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/magic-filter/default.nix
blob: 1f61bd7b2a16027cbfb8b9e1be6cba971ec028d9 (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pytestCheckHook,
  hatchling,
}:

buildPythonPackage rec {
  pname = "magic-filter";
  version = "1.0.12";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "aiogram";
    repo = "magic-filter";
    tag = "v${version}";
    hash = "sha256-MSYIZ/bzngRu6mG3EGblUotSCA+6bi+l3EymFA8NRZA=";
  };

  postPatch = ''
    substituteInPlace magic_filter/__init__.py \
      --replace '"1"' '"${version}"'
  '';

  nativeBuildInputs = [ hatchling ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "magic_filter" ];

  meta = {
    description = "Magic filter based on dynamic attribute getter";
    homepage = "https://github.com/aiogram/magic-filter";
    changelog = "https://github.com/aiogram/magic-filter/releases/tag/v${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ sikmir ];
  };
}