summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/py-key-value-shared/default.nix
blob: 0b348b0d31cff23a4fb1f56351b6b66061686b6c (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  uv-build,

  # dependencies
  beartype,
  typing-extensions,

  # tests
  pytestCheckHook,
  pytest-xdist,
  inline-snapshot,
  py-key-value-shared-test,
}:

buildPythonPackage (finalAttrs: {
  pname = "py-key-value-shared";
  version = "0.3.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "strawgate";
    repo = "py-key-value";
    tag = finalAttrs.version;
    hash = "sha256-4ji+GzJTv1QnC5n/OaL9vR65j8BQmJsVGGnjjuulDiU=";
  };

  sourceRoot = "${finalAttrs.src.name}/key-value/key-value-shared";

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail \
        "uv_build>=0.8.2,<0.9.0" \
        "uv_build"
  '';

  build-system = [
    uv-build
  ];

  dependencies = [
    beartype
    typing-extensions
  ];

  pythonImportsCheck = [ "key_value.shared" ];

  nativeCheckInputs = [
    inline-snapshot
    py-key-value-shared-test
    pytest-xdist
    pytestCheckHook
  ];

  meta = {
    description = "Shared code between key-value-aio and key-value-sync";
    homepage = "https://github.com/strawgate/py-key-value/tree/main/key-value/key-value-shared";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ GaetanLepage ];
  };
})