diff options
author | Jon Seager <jon@sgrs.uk> | 2024-04-11 14:58:30 +0100 |
---|---|---|
committer | Jon Seager <jon@sgrs.uk> | 2024-04-16 10:57:08 +0100 |
commit | f6e8d5fa8755d65b1f62606c28b519ad42774515 (patch) | |
tree | 54e88e427cf04d56d39d3ee1a51c0ff573ece9d5 /pkgs/by-name/ch | |
parent | 1877c3c0aa204e14d104342f4644ed40542de875 (diff) |
charmcraft: init at 2.6.0
Diffstat (limited to 'pkgs/by-name/ch')
-rw-r--r-- | pkgs/by-name/ch/charmcraft/package.nix | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/pkgs/by-name/ch/charmcraft/package.nix b/pkgs/by-name/ch/charmcraft/package.nix new file mode 100644 index 0000000000000..c837563a61c8b --- /dev/null +++ b/pkgs/by-name/ch/charmcraft/package.nix @@ -0,0 +1,88 @@ +{ + lib, + git, + python3Packages, + fetchFromGitHub, + nix-update-script, +}: + +python3Packages.buildPythonApplication rec { + pname = "charmcraft"; + version = "2.6.0"; + + pyproject = true; + + src = fetchFromGitHub { + owner = "canonical"; + repo = "charmcraft"; + rev = "refs/tags/${version}"; + hash = "sha256-B0ZcOORW6yaSIpisPLnq5/S/CcqqvHNTXcfP1sKW2KQ="; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace-fail 'version=determine_version()' 'version="${version}"' + ''; + + propagatedBuildInputs = with python3Packages; [ + craft-cli + craft-parts + craft-providers + craft-store + distro + humanize + jinja2 + jsonschema + pydantic_1 + python-dateutil + pyyaml + requests + requests-toolbelt + requests-unixsocket + snap-helpers + tabulate + urllib3 + ]; + + nativeBuildInputs = with python3Packages; [ + pythonRelaxDepsHook + setuptools + ]; + + pythonRelaxDeps = [ + "urllib3" + ]; + + nativeCheckInputs = with python3Packages; [ + pyfakefs + pytest-check + pytest-mock + pytest-subprocess + pytestCheckHook + responses + ] ++ [ git ]; + + 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; + }; +} |