depot/third_party/nixpkgs/pkgs/development/python-modules/craft-cli/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

68 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
nix-update-script,
platformdirs,
pydantic_1,
pyyaml,
setuptools,
setuptools-scm,
pytest-check,
pytest-mock,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "craft-cli";
version = "2.5.1";
pyproject = true;
src = fetchFromGitHub {
owner = "canonical";
repo = "craft-cli";
rev = "refs/tags/${version}";
hash = "sha256-yEKF04OPu4paRrghAP78r9hu6cqkUy6z/V7cHNys82I=";
};
postPatch = ''
substituteInPlace craft_cli/__init__.py \
--replace-fail "dev" "${version}"
substituteInPlace pyproject.toml \
--replace-fail "setuptools==67.7.2" "setuptools"
'';
nativeBuildInputs = [
setuptools
setuptools-scm
];
propagatedBuildInputs = [
platformdirs
pydantic_1
pyyaml
];
pythonImportsCheck = [ "craft_cli" ];
nativeCheckInputs = [
pytest-check
pytest-mock
pytestCheckHook
];
pytestFlagsArray = [ "tests/unit" ];
passthru.updateScript = nix-update-script { };
meta = {
description = "CLI builder for Canonical's CLI Guidelines";
homepage = "https://github.com/canonical/craft-cli";
changelog = "https://github.com/canonical/craft-cli/releases/tag/${version}";
license = lib.licenses.lgpl3Only;
maintainers = with lib.maintainers; [ jnsgruk ];
platforms = lib.platforms.linux;
};
}