1{
2 lib,
3 buildPythonPackage,
4 annotated-types,
5 distro,
6 fetchFromGitHub,
7 nix-update-script,
8 pytest-check,
9 pytestCheckHook,
10 pythonOlder,
11 setuptools,
12 setuptools-scm,
13}:
14
15buildPythonPackage rec {
16 pname = "craft-platforms";
17 version = "0.1.1";
18 pyproject = true;
19
20 disabled = pythonOlder "3.10";
21
22 src = fetchFromGitHub {
23 owner = "canonical";
24 repo = "craft-platforms";
25 rev = "refs/tags/${version}";
26 hash = "sha256-KzskmSw7NsH1CAYjPf2281Ob71Jd6AhWxtp5tR3IqyU=";
27 };
28
29 postPatch = ''
30 substituteInPlace craft_platforms/__init__.py --replace-fail "dev" "${version}"
31 '';
32
33 build-system = [
34 setuptools
35 setuptools-scm
36 ];
37
38 dependencies = [
39 annotated-types
40 distro
41 ];
42
43 nativeCheckInputs = [
44 pytestCheckHook
45 pytest-check
46 ];
47
48 pythonImportsCheck = [ "craft_platforms" ];
49
50 pytestFlagsArray = [ "tests/unit" ];
51
52 passthru.updateScript = nix-update-script { };
53
54 meta = {
55 description = "Manage platforms and architectures for charm applications";
56 homepage = "https://github.com/canonical/craft-platforms";
57 changelog = "https://github.com/canonical/craft-platforms/releases/tag/${version}";
58 license = lib.licenses.lgpl3Only;
59 maintainers = with lib.maintainers; [ jnsgruk ];
60 platforms = lib.platforms.linux;
61 };
62}