Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / craft-cli / default.nix
blob17537a0c99672d3d3b7fadbe1be7646905c04792
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , nix-update-script
5 , platformdirs
6 , pydantic_1
7 , pyyaml
8 , setuptools
9 , setuptools-scm
10 , pytest-check
11 , pytest-mock
12 , pytestCheckHook
15 buildPythonPackage rec {
16   pname = "craft-cli";
17   version = "2.5.1";
19   pyproject = true;
21   src = fetchFromGitHub {
22     owner = "canonical";
23     repo = "craft-cli";
24     rev = "refs/tags/${version}";
25     hash = "sha256-yEKF04OPu4paRrghAP78r9hu6cqkUy6z/V7cHNys82I=";
26   };
28   postPatch = ''
29     substituteInPlace craft_cli/__init__.py \
30       --replace-fail "dev" "${version}"
32     substituteInPlace pyproject.toml \
33       --replace-fail "setuptools==67.7.2" "setuptools"
34   '';
36   nativeBuildInputs = [
37     setuptools
38     setuptools-scm
39   ];
41   propagatedBuildInputs = [
42     platformdirs
43     pydantic_1
44     pyyaml
45   ];
47   pythonImportsCheck = [
48     "craft_cli"
49   ];
51   nativeCheckInputs = [
52     pytest-check
53     pytest-mock
54     pytestCheckHook
55   ];
57   pytestFlagsArray = [ "tests/unit" ];
59   passthru.updateScript = nix-update-script { };
61   meta = {
62     description = "A CLI builder for Canonical's CLI Guidelines";
63     homepage = "https://github.com/canonical/craft-cli";
64     changelog = "https://github.com/canonical/craft-cli/releases/tag/${version}";
65     license = lib.licenses.lgpl3Only;
66     maintainers = with lib.maintainers; [ jnsgruk ];
67     platforms = lib.platforms.linux;
68   };