Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / birch / default.nix
blob1dd4848427e52a6ab534d5b3db634ac550b9c2f1
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , fetchpatch
5 , setuptools
6 , strct
7 , pytestCheckHook
8 , pyyaml
9 }:
11 buildPythonPackage rec {
12   pname = "birch";
13   version = "0.0.35";
14   pyproject = true;
16   src = fetchFromGitHub {
17     owner = "shaypal5";
18     repo = "birch";
19     rev = "v${version}";
20     hash = "sha256-KdQZzQJvJ+logpcLQfaqqEEZJ/9VmNTQX/a4v0oBC98=";
21   };
23   patches = [
24     # https://github.com/shaypal5/birch/pull/4
25     (fetchpatch {
26       name = "fix-versioneer-on-python312.patch";
27       url = "https://github.com/shaypal5/birch/commit/84d597b2251ebb76fb15fb70fc86c83baa19dc0b.patch";
28       hash = "sha256-xXADCSIhq1ARny2twzrhR1J8LkMFWFl6tmGxrM8RvkU=";
29     })
30   ];
32   postPatch = ''
33     substituteInPlace pytest.ini \
34       --replace  \
35         "--cov" \
36         "#--cov"
38     # configure correct version, which fails due to missing .git
39     substituteInPlace versioneer.py birch/_version.py \
40       --replace '"0+unknown"' '"${version}"'
41   '';
43   nativeBuildInputs = [
44     setuptools
45   ];
47   propagatedBuildInputs = [
48     strct
49   ];
51   pythonImportsCheck = [
52     "birch"
53     "birch.casters"
54     "birch.exceptions"
55     "birch.paths"
56   ];
58   nativeCheckInputs = [
59     pytestCheckHook
60     pyyaml
61   ];
63   preCheck = ''
64     export HOME="$(mktemp -d)"
65   '';
68   meta = with lib; {
69     description = "Simple hierarchical configuration for Python packages";
70     homepage = "https://github.com/shaypal5/birch";
71     license = licenses.mit;
72     maintainers = with maintainers; [ pbsds ];
73   };