1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 nix-update-script,
6 overrides,
7 setuptools,
8 pytest-check,
9 pytest-mock,
10 pytestCheckHook,
11 pydantic_1,
12 pyyaml,
13}:
14
15buildPythonPackage rec {
16 pname = "craft-grammar";
17 version = "1.2.0";
18
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "canonical";
23 repo = "craft-grammar";
24 rev = "refs/tags/${version}";
25 hash = "sha256-YQpxgdmUxYLkhAXDLlkLAK6VpjIEycLFY3nsE/M4o2g=";
26 };
27
28 nativeBuildInputs = [ setuptools ];
29
30 propagatedBuildInputs = [ overrides ];
31
32 pythonImportsCheck = [ "craft_grammar" ];
33
34 nativeCheckInputs = [
35 pydantic_1
36 pytestCheckHook
37 pyyaml
38 ];
39
40 pytestFlagsArray = [ "tests/unit" ];
41
42 passthru.updateScript = nix-update-script { };
43
44 meta = {
45 description = "Advanced grammar for Canonical's craft-parts library";
46 homepage = "https://github.com/canonical/craft-grammar";
47 changelog = "https://github.com/canonical/craft-grammar/releases/tag/${version}";
48 license = lib.licenses.lgpl3Only;
49 maintainers = with lib.maintainers; [ jnsgruk ];
50 platforms = lib.platforms.linux;
51 };
52}