depot/third_party/nixpkgs/pkgs/development/python-modules/craft-platforms/default.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

60 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
annotated-types,
distro,
fetchFromGitHub,
nix-update-script,
hypothesis,
pytest-check,
pytestCheckHook,
pythonOlder,
setuptools-scm,
}:
buildPythonPackage rec {
pname = "craft-platforms";
version = "0.3.1";
pyproject = true;
disabled = pythonOlder "3.10";
src = fetchFromGitHub {
owner = "canonical";
repo = "craft-platforms";
rev = "refs/tags/${version}";
hash = "sha256-VDSwvBWoGHcjGCEA4RDVwRzQGNVaphwZu/iaktAweb0=";
};
postPatch = ''
substituteInPlace craft_platforms/__init__.py --replace-fail "dev" "${version}"
'';
build-system = [ setuptools-scm ];
dependencies = [
annotated-types
distro
];
nativeCheckInputs = [
hypothesis
pytestCheckHook
pytest-check
];
pythonImportsCheck = [ "craft_platforms" ];
pytestFlagsArray = [ "tests/unit" ];
passthru.updateScript = nix-update-script { };
meta = {
description = "Manage platforms and architectures for charm applications";
homepage = "https://github.com/canonical/craft-platforms";
changelog = "https://github.com/canonical/craft-platforms/releases/tag/${version}";
license = lib.licenses.lgpl3Only;
maintainers = with lib.maintainers; [ jnsgruk ];
platforms = lib.platforms.linux;
};
}