1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 nix-update-script,
6 launchpadlib,
7 lazr-restfulclient,
8 overrides,
9 pydantic_1,
10 setuptools,
11 setuptools-scm,
12 tabulate,
13 pytest-check,
14 pytest-mock,
15 pytestCheckHook,
16}:
17
18buildPythonPackage rec {
19 pname = "craft-archives";
20 version = "1.1.3";
21
22 pyproject = true;
23
24 src = fetchFromGitHub {
25 owner = "canonical";
26 repo = "craft-archives";
27 rev = "refs/tags/${version}";
28 hash = "sha256-ZUqMjbOsHwzZyn0NsSTlZTljzagYEirWKEGatXVL43g=";
29 };
30
31 postPatch = ''
32 substituteInPlace craft_archives/__init__.py \
33 --replace-fail "dev" "${version}"
34
35 substituteInPlace pyproject.toml \
36 --replace-fail "setuptools==67.7.2" "setuptools"
37 '';
38
39 nativeBuildInputs = [
40 setuptools
41 setuptools-scm
42 ];
43
44 propagatedBuildInputs = [
45 launchpadlib
46 lazr-restfulclient
47 overrides
48 pydantic_1
49 tabulate
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 = "A 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}