From 3c145a2c80d8c8d41b03294ab4d5c2fb8c663d12 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Wed, 13 Mar 2024 16:36:57 +0000 Subject: [PATCH] python3Packages.craft-archives: init at 1.1.3 --- .../python-modules/craft-archives/default.nix | 74 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 76 insertions(+) create mode 100644 pkgs/development/python-modules/craft-archives/default.nix diff --git a/pkgs/development/python-modules/craft-archives/default.nix b/pkgs/development/python-modules/craft-archives/default.nix new file mode 100644 index 000000000000..3fb3b0e9f0fa --- /dev/null +++ b/pkgs/development/python-modules/craft-archives/default.nix @@ -0,0 +1,74 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, nix-update-script +, launchpadlib +, lazr-restfulclient +, overrides +, pydantic_1 +, setuptools +, setuptools-scm +, tabulate +, pytest-check +, pytest-mock +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "craft-archives"; + version = "1.1.3"; + + pyproject = true; + + src = fetchFromGitHub { + owner = "canonical"; + repo = "craft-archives"; + rev = "refs/tags/${version}"; + hash = "sha256-ZUqMjbOsHwzZyn0NsSTlZTljzagYEirWKEGatXVL43g="; + }; + + postPatch = '' + substituteInPlace craft_archives/__init__.py \ + --replace-fail "dev" "${version}" + + substituteInPlace pyproject.toml \ + --replace-fail "setuptools==67.7.2" "setuptools" + ''; + + nativeBuildInputs = [ + setuptools + setuptools-scm + ]; + + propagatedBuildInputs = [ + launchpadlib + lazr-restfulclient + overrides + pydantic_1 + tabulate + ]; + + pythonImportsCheck = [ + "craft_archives" + ]; + + nativeCheckInputs = [ + pytest-check + pytest-mock + pytestCheckHook + ]; + + pytestFlagsArray = [ "tests/unit" ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "A 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; + }; +} + diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2adc3761d49b..4b2eb09940ef 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2447,6 +2447,8 @@ self: super: with self; { cpyparsing = callPackage ../development/python-modules/cpyparsing { }; + craft-archives = callPackage ../development/python-modules/craft-archives { }; + craft-cli = callPackage ../development/python-modules/craft-cli { }; craft-grammar = callPackage ../development/python-modules/craft-grammar { };