1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 nix-update-script, 6 platformdirs, 7 jinja2, 8 overrides, 9 pyyaml, 10 setuptools-scm, 11 pytest-check, 12 pytest-mock, 13 pytestCheckHook, 14 writableTmpDirAsHomeHook, 15}: 16 17buildPythonPackage rec { 18 pname = "craft-cli"; 19 version = "3.0.0"; 20 21 pyproject = true; 22 23 src = fetchFromGitHub { 24 owner = "canonical"; 25 repo = "craft-cli"; 26 tag = version; 27 hash = "sha256-RAnvx5519iXZnJm8jtY635e0DEL7jnIgZtTCindqMTY="; 28 }; 29 30 postPatch = '' 31 substituteInPlace pyproject.toml \ 32 --replace-fail "setuptools==75.2.0" "setuptools" 33 ''; 34 35 build-system = [ setuptools-scm ]; 36 37 dependencies = [ 38 jinja2 39 overrides 40 platformdirs 41 pyyaml 42 ]; 43 44 pythonImportsCheck = [ "craft_cli" ]; 45 46 nativeCheckInputs = [ 47 pytest-check 48 pytest-mock 49 pytestCheckHook 50 writableTmpDirAsHomeHook 51 ]; 52 53 pytestFlagsArray = [ "tests/unit" ]; 54 55 passthru.updateScript = nix-update-script { }; 56 57 meta = { 58 description = "CLI builder for Canonical's CLI Guidelines"; 59 homepage = "https://github.com/canonical/craft-cli"; 60 changelog = "https://github.com/canonical/craft-cli/releases/tag/${version}"; 61 license = lib.licenses.lgpl3Only; 62 maintainers = with lib.maintainers; [ jnsgruk ]; 63 platforms = lib.platforms.linux; 64 }; 65}