1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 nix-update-script,
6 setuptools,
7 setuptools-scm,
8 pytest-check,
9 pytest-httpx,
10 pytest-mock,
11 pyyaml,
12 pytestCheckHook,
13 annotated-types,
14 httpx,
15 jaraco-classes,
16 keyring,
17 macaroonbakery,
18 overrides,
19 pydantic,
20 pyxdg,
21 requests,
22 requests-toolbelt,
23 typing-extensions,
24}:
25
26buildPythonPackage rec {
27 pname = "craft-store";
28 version = "3.2.1";
29
30 pyproject = true;
31
32 src = fetchFromGitHub {
33 owner = "canonical";
34 repo = "craft-store";
35 tag = version;
36 hash = "sha256-rJ7FXHDrJ7w+dFPBs7MhT4iqN6KCWaqrmlCni5kUEKI=";
37 };
38
39 postPatch = ''
40 substituteInPlace pyproject.toml \
41 --replace-fail "setuptools==75.8.0" "setuptools"
42 '';
43
44 build-system = [
45 setuptools
46 setuptools-scm
47 ];
48
49 pythonRelaxDeps = [ "httpx" ];
50
51 dependencies = [
52 annotated-types
53 httpx
54 jaraco-classes
55 keyring
56 macaroonbakery
57 overrides
58 pydantic
59 pyxdg
60 requests
61 requests-toolbelt
62 typing-extensions
63 ];
64
65 pythonImportsCheck = [ "craft_store" ];
66
67 nativeCheckInputs = [
68 pytest-check
69 pytest-httpx
70 pytest-mock
71 pytestCheckHook
72 pyyaml
73 ];
74
75 pytestFlagsArray = [ "tests/unit" ];
76
77 passthru.updateScript = nix-update-script { };
78
79 meta = {
80 description = "Interfaces for communicating with Canonical Stores (e.g. Snap Store)";
81 homepage = "https://github.com/canonical/craft-store";
82 changelog = "https://github.com/canonical/craft-store/releases/tag/${version}";
83 license = lib.licenses.lgpl3Only;
84 maintainers = with lib.maintainers; [ jnsgruk ];
85 platforms = lib.platforms.linux;
86 };
87}