diff options
Diffstat (limited to 'pkgs/by-name/ch/charmcraft/package.nix')
-rw-r--r-- | pkgs/by-name/ch/charmcraft/package.nix | 66 |
1 files changed, 47 insertions, 19 deletions
diff --git a/pkgs/by-name/ch/charmcraft/package.nix b/pkgs/by-name/ch/charmcraft/package.nix index 6c340102a502f..fc5ef145d1bc1 100644 --- a/pkgs/by-name/ch/charmcraft/package.nix +++ b/pkgs/by-name/ch/charmcraft/package.nix @@ -1,14 +1,36 @@ { lib, git, - python3Packages, + python3, fetchFromGitHub, nix-update-script, }: -python3Packages.buildPythonApplication rec { +let + python = python3.override { + packageOverrides = self: super: { + pydantic-yaml = super.pydantic-yaml.overridePythonAttrs (old: rec { + version = "0.11.2"; + src = fetchFromGitHub { + owner = "NowanIlfideme"; + repo = "pydantic-yaml"; + rev = "refs/tags/v${version}"; + hash = "sha256-AeUyVav0/k4Fz69Qizn4hcJKoi/CDR9eUan/nJhWsDY="; + }; + dependencies = with self; [ + deprecated + importlib-metadata + pydantic_1 + ruamel-yaml + types-deprecated + ]; + }); + }; + }; +in +python.pkgs.buildPythonApplication rec { pname = "charmcraft"; - version = "2.7.0"; + version = "3.1.1"; pyproject = true; @@ -16,20 +38,22 @@ python3Packages.buildPythonApplication rec { owner = "canonical"; repo = "charmcraft"; rev = "refs/tags/${version}"; - hash = "sha256-yMcGXi7OxEtfOv3zLEUlnZrR90TkFc0y9RB9jS34ZWs="; + hash = "sha256-oxNbAIf7ltdDYkGJj29zvNDNXT6vt1jWaIqHJoMr7gU="; }; postPatch = '' - substituteInPlace setup.py \ - --replace-fail 'version=determine_version()' 'version="${version}"' + substituteInPlace charmcraft/__init__.py --replace-fail "dev" "${version}" ''; - propagatedBuildInputs = with python3Packages; [ + dependencies = with python.pkgs; [ + craft-application craft-cli craft-parts + craft-platforms craft-providers craft-store distro + docker humanize jinja2 jsonschema @@ -44,22 +68,26 @@ python3Packages.buildPythonApplication rec { urllib3 ]; - nativeBuildInputs = with python3Packages; [ + build-system = with python.pkgs; [ setuptools + setuptools-scm ]; - pythonRelaxDeps = [ - "urllib3" - ]; + pythonRelaxDeps = [ "urllib3" ]; - nativeCheckInputs = with python3Packages; [ - pyfakefs - pytest-check - pytest-mock - pytest-subprocess - pytestCheckHook - responses - ] ++ [ git ]; + nativeCheckInputs = + with python.pkgs; + [ + hypothesis + pyfakefs + pytest-check + pytest-mock + pytest-subprocess + pytestCheckHook + responses + setuptools + ] + ++ [ git ]; preCheck = '' mkdir -p check-phase |