nixpkgs/pkgs/by-name/ch/charmcraft/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

94 lines
1.8 KiB
Nix
Raw Normal View History

2024-04-11 13:58:30 +00:00
{
lib,
git,
2024-10-04 10:30:56 +00:00
python3Packages,
2024-04-11 13:58:30 +00:00
fetchFromGitHub,
nix-update-script,
}:
2024-10-04 10:30:56 +00:00
python3Packages.buildPythonApplication rec {
2024-04-11 13:58:30 +00:00
pname = "charmcraft";
2024-10-23 03:10:05 +00:00
version = "3.2.2";
2024-04-11 13:58:30 +00:00
pyproject = true;
src = fetchFromGitHub {
owner = "canonical";
repo = "charmcraft";
rev = "refs/tags/${version}";
2024-10-23 03:10:05 +00:00
hash = "sha256-2MI2cbAohfTgbilxZcFvmxt/iVjR6zJ2o0gequB//hg=";
2024-04-11 13:58:30 +00:00
};
postPatch = ''
2024-07-25 08:01:36 +00:00
substituteInPlace charmcraft/__init__.py --replace-fail "dev" "${version}"
2024-04-11 13:58:30 +00:00
'';
2024-10-04 10:30:56 +00:00
dependencies = with python3Packages; [
2024-07-25 08:01:36 +00:00
craft-application
2024-04-11 13:58:30 +00:00
craft-cli
craft-parts
2024-07-25 08:01:36 +00:00
craft-platforms
2024-04-11 13:58:30 +00:00
craft-providers
craft-store
distro
2024-07-25 08:01:36 +00:00
docker
2024-04-11 13:58:30 +00:00
humanize
jinja2
jsonschema
2024-10-04 10:30:56 +00:00
pydantic
2024-04-11 13:58:30 +00:00
python-dateutil
pyyaml
requests
requests-toolbelt
requests-unixsocket
snap-helpers
tabulate
urllib3
];
2024-10-04 10:30:56 +00:00
build-system = with python3Packages; [ setuptools-scm ];
2024-04-11 13:58:30 +00:00
2024-10-04 10:30:56 +00:00
pythonRelaxDeps = [
"urllib3"
"craft-application"
];
2024-04-11 13:58:30 +00:00
2024-07-09 11:47:37 +00:00
nativeCheckInputs =
2024-10-04 10:30:56 +00:00
with python3Packages;
2024-07-09 11:47:37 +00:00
[
2024-07-25 08:01:36 +00:00
hypothesis
2024-07-09 11:47:37 +00:00
pyfakefs
pytest-check
pytest-mock
pytest-subprocess
pytestCheckHook
responses
setuptools
]
++ [ git ];
2024-04-11 13:58:30 +00:00
preCheck = ''
mkdir -p check-phase
export HOME="$(pwd)/check-phase"
'';
pytestFlagsArray = [ "tests/unit" ];
disabledTests = [
# Relies upon the `charm` tool being installed
"test_validate_missing_charm"
];
passthru.updateScript = nix-update-script { };
meta = {
mainProgram = "charmcraft";
description = "Build and publish Charmed Operators for deployment with Juju";
homepage = "https://github.com/canonical/charmcraft";
changelog = "https://github.com/canonical/charmcraft/releases/tag/${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ jnsgruk ];
platforms = lib.platforms.linux;
};
}