about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pydantic-settings/default.nix
blob: c27bb5f275766793b8ced1b7cbb4234ebea33732 (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
48
49
50
51
52
{ lib
, buildPythonPackage
, fetchFromGitHub
, hatchling
, pydantic
, python-dotenv
, pytestCheckHook
, pytest-examples
, pytest-mock
}:

buildPythonPackage rec {
  pname = "pydantic-settings";
  version = "2.0.3";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "pydantic";
    repo = "pydantic-settings";
    rev = "v${version}";
    hash = "sha256-3V6daCibvVr8RKo2o+vHC++QgIYKAOyRg11ATrCzM5Y=";
  };

  nativeBuildInputs = [
    hatchling
  ];

  propagatedBuildInputs = [
    pydantic
    python-dotenv
  ];

  pythonImportsCheck = [ "pydantic_settings" ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-examples
    pytest-mock
  ];

  preCheck = ''
    export HOME=$TMPDIR
  '';

  meta = with lib; {
    description = "Settings management using pydantic";
    homepage = "https://github.com/pydantic/pydantic-settings";
    license = licenses.mit;
    broken = lib.versionOlder pydantic.version "2.0.0";
    maintainers = with maintainers; [ ];
  };
}