1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 nix-update-script,
6 overrides,
7 setuptools-scm,
8 pytestCheckHook,
9 pydantic,
10 pyyaml,
11}:
12
13buildPythonPackage rec {
14 pname = "craft-grammar";
15 version = "2.0.3";
16
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "canonical";
21 repo = "craft-grammar";
22 tag = version;
23 hash = "sha256-d7U4AAUikYcz26ZSXQwkTobSKN1PpaL20enfggHSKRM=";
24 };
25
26 build-system = [ setuptools-scm ];
27
28 dependencies = [
29 overrides
30 pydantic
31 ];
32
33 pythonImportsCheck = [ "craft_grammar" ];
34
35 nativeCheckInputs = [
36 pytestCheckHook
37 pyyaml
38 ];
39
40 enabledTestPaths = [ "tests/unit" ];
41
42 # Temp fix for test incompatibility with Python 3.13
43 disabledTests = [
44 "test_grammar_strlist_error[value2]"
45 ];
46
47 passthru.updateScript = nix-update-script { };
48
49 meta = {
50 description = "Advanced grammar for Canonical's craft-parts library";
51 homepage = "https://github.com/canonical/craft-grammar";
52 changelog = "https://github.com/canonical/craft-grammar/releases/tag/${version}";
53 license = lib.licenses.lgpl3Only;
54 maintainers = with lib.maintainers; [ jnsgruk ];
55 platforms = lib.platforms.linux;
56 };
57}