1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 nix-update-script,
6 launchpadlib,
7 lazr-restfulclient,
8 lazr-uri,
9 overrides,
10 pydantic,
11 python-debian,
12 distro,
13 setuptools-scm,
14 pytest-check,
15 pytest-mock,
16 pytestCheckHook,
17}:
18
19buildPythonPackage rec {
20 pname = "craft-archives";
21 version = "2.0.2";
22
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "canonical";
27 repo = "craft-archives";
28 rev = "refs/tags/${version}";
29 hash = "sha256-1HEz4d1WLQDDHga7X+V/37n8E7JK/k0z+UDeNEiLOHs=";
30 };
31
32 postPatch = ''
33 substituteInPlace craft_archives/__init__.py \
34 --replace-fail "dev" "${version}"
35
36 substituteInPlace pyproject.toml \
37 --replace-fail "setuptools==67.7.2" "setuptools"
38 '';
39
40 build-system = [ setuptools-scm ];
41
42 dependencies = [
43 distro
44 launchpadlib
45 lazr-restfulclient
46 lazr-uri
47 overrides
48 pydantic
49 python-debian
50 ];
51
52 pythonImportsCheck = [ "craft_archives" ];
53
54 nativeCheckInputs = [
55 pytest-check
56 pytest-mock
57 pytestCheckHook
58 ];
59
60 pytestFlagsArray = [ "tests/unit" ];
61
62 passthru.updateScript = nix-update-script { };
63
64 meta = {
65 description = "Library for handling archives/repositories in Canonical craft applications";
66 homepage = "https://github.com/canonical/craft-archives";
67 changelog = "https://github.com/canonical/craft-archives/releases/tag/${version}";
68 license = lib.licenses.lgpl3Only;
69 maintainers = with lib.maintainers; [ jnsgruk ];
70 platforms = lib.platforms.linux;
71 };
72}