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

69 lines
1.4 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
nix-update-script,
launchpadlib,
lazr-restfulclient,
overrides,
pydantic,
setuptools,
setuptools-scm,
tabulate,
pytest-check,
pytest-mock,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "craft-archives";
version = "2.0.0";
pyproject = true;
src = fetchFromGitHub {
owner = "canonical";
repo = "craft-archives";
rev = "refs/tags/${version}";
hash = "sha256-BrKyOdfbwt9qU5Bt/kX/+GgxH7LCFmmFg4mevBWVp2I=";
};
postPatch = ''
substituteInPlace craft_archives/__init__.py \
--replace-fail "dev" "${version}"
substituteInPlace pyproject.toml \
--replace-fail "setuptools==67.7.2" "setuptools"
'';
build-system = [ setuptools-scm ];
dependencies = [
launchpadlib
lazr-restfulclient
overrides
pydantic
tabulate
];
pythonImportsCheck = [ "craft_archives" ];
nativeCheckInputs = [
pytest-check
pytest-mock
pytestCheckHook
];
pytestFlagsArray = [ "tests/unit" ];
passthru.updateScript = nix-update-script { };
meta = {
description = "Library for handling archives/repositories in Canonical craft applications";
homepage = "https://github.com/canonical/craft-archives";
changelog = "https://github.com/canonical/craft-archives/releases/tag/${version}";
license = lib.licenses.lgpl3Only;
maintainers = with lib.maintainers; [ jnsgruk ];
platforms = lib.platforms.linux;
};
}