From 5f19e185d06974ad7518437eea17f4011ae3050a Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 8 Jul 2024 18:01:49 +0000 Subject: [PATCH 01/10] python312Packages.craft-providers: 1.24.0 -> 1.24.1 --- pkgs/development/python-modules/craft-providers/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/craft-providers/default.nix b/pkgs/development/python-modules/craft-providers/default.nix index 52954f8f0ddf..3269ff03a4de 100644 --- a/pkgs/development/python-modules/craft-providers/default.nix +++ b/pkgs/development/python-modules/craft-providers/default.nix @@ -22,7 +22,7 @@ buildPythonPackage rec { pname = "craft-providers"; - version = "1.24.0"; + version = "1.24.1"; pyproject = true; @@ -30,7 +30,7 @@ buildPythonPackage rec { owner = "canonical"; repo = "craft-providers"; rev = "refs/tags/${version}"; - hash = "sha256-CkaJ8taTsnBpCffe/Eu4/FGpMwKcg3yeLVAahCyEsII="; + hash = "sha256-l57Y+sdCD0/3sBK48N/3p3ns3o0LB4h9FQ35ha1AOV4="; }; patches = [ From 6b4f23015cff187c59d150b76e11b536a82d8c60 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Tue, 9 Jul 2024 12:47:34 +0200 Subject: [PATCH 02/10] python3Packages.keyring_24: init at 24.3.1 Version 25 of `keyring` introduced a breaking change by removing a compatibility API. Several packages, including craft-store, rely upon this API. This is a copy of the existing `keyring` package, pinned to the last version in the 24 series. --- .../python-modules/keyring_24/default.nix | 81 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 83 insertions(+) create mode 100644 pkgs/development/python-modules/keyring_24/default.nix diff --git a/pkgs/development/python-modules/keyring_24/default.nix b/pkgs/development/python-modules/keyring_24/default.nix new file mode 100644 index 000000000000..9739a6f7b20a --- /dev/null +++ b/pkgs/development/python-modules/keyring_24/default.nix @@ -0,0 +1,81 @@ +{ + lib, + stdenv, + buildPythonPackage, + fetchPypi, + pythonOlder, + installShellFiles, + setuptools, + setuptools-scm, + shtab, + importlib-metadata, + jaraco-classes, + jaraco-context, + jaraco-functools, + jeepney, + secretstorage, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "keyring_24"; + # nixpkgs-update: no auto update + version = "24.3.1"; + pyproject = true; + disabled = pythonOlder "3.8"; + + src = fetchPypi { + inherit version; + pname = "keyring"; + hash = "sha256-wzJ7b/r8DovvvbWXys20ko/+XBIS92RfGG5tmVeomNs="; + }; + + nativeBuildInputs = [ + installShellFiles + shtab + ]; + + build-system = [ + setuptools + setuptools-scm + ]; + + dependencies = + [ + jaraco-classes + jaraco-context + jaraco-functools + ] + ++ lib.optionals stdenv.isLinux [ + jeepney + secretstorage + ] + ++ lib.optionals (pythonOlder "3.12") [ importlib-metadata ]; + + postInstall = '' + installShellCompletion --cmd keyring \ + --bash <($out/bin/keyring --print-completion bash) \ + --zsh <($out/bin/keyring --print-completion zsh) + ''; + + pythonImportsCheck = [ + "keyring" + "keyring.backend" + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + disabledTestPaths = + [ "tests/backends/test_macOS.py" ] + # These tests fail when sandboxing is enabled because they are unable to get a password from keychain. + ++ lib.optional stdenv.isDarwin "tests/test_multiprocess.py"; + + meta = with lib; { + description = "Store and access your passwords safely"; + homepage = "https://github.com/jaraco/keyring"; + changelog = "https://github.com/jaraco/keyring/blob/v${version}/NEWS.rst"; + license = licenses.mit; + mainProgram = "keyring"; + maintainers = with maintainers; [ jnsgruk ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 39b8b28be828..8c07fff5d9a2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6483,6 +6483,8 @@ self: super: with self; { keyring = callPackage ../development/python-modules/keyring { }; + keyring_24 = callPackage ../development/python-modules/keyring_24 { }; + keyring-pass = callPackage ../development/python-modules/keyring-pass { }; keyrings-cryptfile = callPackage ../development/python-modules/keyrings-cryptfile { }; From 5cafa935fe2c3540d6ab5da35b299bd66cabdb45 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Tue, 9 Jul 2024 12:48:12 +0200 Subject: [PATCH 03/10] python3Packages.craft-store: use `keyring_24` instead of `keyring`. --- pkgs/development/python-modules/craft-store/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/craft-store/default.nix b/pkgs/development/python-modules/craft-store/default.nix index 853df850c02a..bf89b9c17cb5 100644 --- a/pkgs/development/python-modules/craft-store/default.nix +++ b/pkgs/development/python-modules/craft-store/default.nix @@ -10,7 +10,7 @@ pydantic_1, pyyaml, pytestCheckHook, - keyring, + keyring_24, macaroonbakery, overrides, pyxdg, @@ -42,7 +42,7 @@ buildPythonPackage rec { ]; propagatedBuildInputs = [ - keyring + keyring_24 macaroonbakery overrides pydantic_1 From ed36017f4999d94070b1785f6c4ea5ddaaab0d85 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Tue, 9 Jul 2024 12:48:35 +0200 Subject: [PATCH 04/10] python3Packages.craft-store: relax `macaroonbakery` dep version --- pkgs/development/python-modules/craft-store/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/craft-store/default.nix b/pkgs/development/python-modules/craft-store/default.nix index bf89b9c17cb5..4011b01d60d0 100644 --- a/pkgs/development/python-modules/craft-store/default.nix +++ b/pkgs/development/python-modules/craft-store/default.nix @@ -51,6 +51,8 @@ buildPythonPackage rec { requests-toolbelt ]; + pythonRelaxDeps = [ "macaroonbakery" ]; + pythonImportsCheck = [ "craft_store" ]; nativeCheckInputs = [ From 880e9225b60faae111c0b0523a12e899e274cd91 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Tue, 9 Jul 2024 13:09:39 +0200 Subject: [PATCH 05/10] rockcraft: use `setuptools.dist` rather than `distutils.util` --- pkgs/by-name/ro/rockcraft/package.nix | 34 ++++++++++++++++----------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/ro/rockcraft/package.nix b/pkgs/by-name/ro/rockcraft/package.nix index e1b29f50061b..2443a887a321 100644 --- a/pkgs/by-name/ro/rockcraft/package.nix +++ b/pkgs/by-name/ro/rockcraft/package.nix @@ -1,9 +1,10 @@ -{ lib -, python3Packages -, fetchFromGitHub -, dpkg -, nix-update-script -, python3 +{ + lib, + python3Packages, + fetchFromGitHub, + dpkg, + nix-update-script, + python3, }: python3Packages.buildPythonApplication rec { @@ -20,6 +21,9 @@ python3Packages.buildPythonApplication rec { postPatch = '' substituteInPlace rockcraft/__init__.py \ --replace-fail "dev" "${version}" + + substituteInPlace rockcraft/utils.py \ + --replace-fail "distutils.util" "setuptools.dist" ''; propagatedBuildInputs = with python3Packages; [ @@ -28,14 +32,16 @@ python3Packages.buildPythonApplication rec { spdx-lookup ]; - nativeCheckInputs = with python3Packages; [ - pytest-check - pytest-mock - pytest-subprocess - pytestCheckHook - ] ++ [ - dpkg - ]; + nativeCheckInputs = + with python3Packages; + [ + pytest-check + pytest-mock + pytest-subprocess + pytestCheckHook + setuptools + ] + ++ [ dpkg ]; preCheck = '' mkdir -p check-phase From 438d5c64ee577be8c3d4ffca4e79544385ed24fe Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Tue, 9 Jul 2024 13:12:53 +0200 Subject: [PATCH 06/10] charmcraft: use `setuptools.dist` rather than `distutils.util` --- pkgs/by-name/ch/charmcraft/package.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/by-name/ch/charmcraft/package.nix b/pkgs/by-name/ch/charmcraft/package.nix index 6c340102a502..471526aa603e 100644 --- a/pkgs/by-name/ch/charmcraft/package.nix +++ b/pkgs/by-name/ch/charmcraft/package.nix @@ -22,6 +22,9 @@ python3Packages.buildPythonApplication rec { postPatch = '' substituteInPlace setup.py \ --replace-fail 'version=determine_version()' 'version="${version}"' + + substituteInPlace charmcraft/env.py \ + --replace-fail "distutils.util" "setuptools.dist" ''; propagatedBuildInputs = with python3Packages; [ @@ -59,6 +62,7 @@ python3Packages.buildPythonApplication rec { pytest-subprocess pytestCheckHook responses + setuptools ] ++ [ git ]; preCheck = '' From f6ef3002177a83fe2268fcfcfcfecf1916acd393 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Tue, 9 Jul 2024 13:28:39 +0200 Subject: [PATCH 07/10] python3Packages.launchpadlib: use `keyring_24` dependency to avoid clashes --- pkgs/development/python-modules/launchpadlib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/launchpadlib/default.nix b/pkgs/development/python-modules/launchpadlib/default.nix index 7ac075625902..d9a6b3b1bd56 100644 --- a/pkgs/development/python-modules/launchpadlib/default.nix +++ b/pkgs/development/python-modules/launchpadlib/default.nix @@ -4,7 +4,7 @@ fetchPypi, isPy3k, httplib2, - keyring, + keyring_24, lazr-restfulclient, lazr-uri, setuptools, @@ -26,7 +26,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ httplib2 - keyring + keyring_24 lazr-restfulclient lazr-uri setuptools From 57cf148d2bf85622fa8375e2bed7734e19af7390 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Tue, 9 Jul 2024 13:42:12 +0200 Subject: [PATCH 08/10] snapcraft: 8.2.0 -> 8.2.12 --- pkgs/by-name/sn/snapcraft/os-platform.patch | 12 ++---------- pkgs/by-name/sn/snapcraft/package.nix | 8 ++++++-- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/sn/snapcraft/os-platform.patch b/pkgs/by-name/sn/snapcraft/os-platform.patch index 0b441ec8d4bc..d3c914e73c7b 100644 --- a/pkgs/by-name/sn/snapcraft/os-platform.patch +++ b/pkgs/by-name/sn/snapcraft/os-platform.patch @@ -1,16 +1,8 @@ diff --git a/snapcraft/utils.py b/snapcraft/utils.py -index 511effe2..4af5a029 100644 +index 999a64ec..4f38b4cd 100644 --- a/snapcraft/utils.py +++ b/snapcraft/utils.py -@@ -15,6 +15,7 @@ - # along with this program. If not, see . - - """Utilities for snapcraft.""" -+ - import multiprocessing - import os - import pathlib -@@ -91,7 +92,7 @@ def get_os_platform( +@@ -94,7 +94,7 @@ def get_os_platform( release = platform.release() machine = platform.machine() diff --git a/pkgs/by-name/sn/snapcraft/package.nix b/pkgs/by-name/sn/snapcraft/package.nix index 5fd0b80ce6ec..9baf72492601 100644 --- a/pkgs/by-name/sn/snapcraft/package.nix +++ b/pkgs/by-name/sn/snapcraft/package.nix @@ -11,7 +11,7 @@ }: python3Packages.buildPythonApplication rec { pname = "snapcraft"; - version = "8.2.5"; + version = "8.2.12"; pyproject = true; @@ -24,7 +24,7 @@ python3Packages.buildPythonApplication rec { owner = "canonical"; repo = "snapcraft"; rev = "refs/tags/${version}"; - hash = "sha256-+1Gzseuq402m5FvlRAGXl7Lsy2VnRmd1cXNXhkMDDDE="; + hash = "sha256-1PwIbMweeYGi+jLfhFB3LYThqaN2VW7zdyzjD1m57ow="; }; patches = [ @@ -67,6 +67,9 @@ python3Packages.buildPythonApplication rec { substituteInPlace snapcraft/elf/elf_utils.py \ --replace-fail 'arch_linker_path = Path(arch_config.dynamic_linker)' \ 'return str(Path("${glibc}/lib/ld-linux-x86-64.so.2"))' + + substituteInPlace snapcraft_legacy/internal/xattrs.py \ + --replace-fail 'distutils.util' 'setuptools.dist' ''; buildInputs = [ makeWrapper ]; @@ -126,6 +129,7 @@ python3Packages.buildPythonApplication rec { pytest-subprocess pytestCheckHook responses + setuptools ] ++ [ git squashfsTools From 646456a7f3da1d2d9dbd45e995e6320120b095d9 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Tue, 9 Jul 2024 13:46:08 +0200 Subject: [PATCH 09/10] snapcraft: run `nixfmt-rfc-style` --- pkgs/by-name/sn/snapcraft/package.nix | 37 +++++++++++++-------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/pkgs/by-name/sn/snapcraft/package.nix b/pkgs/by-name/sn/snapcraft/package.nix index 9baf72492601..a79e272ecd64 100644 --- a/pkgs/by-name/sn/snapcraft/package.nix +++ b/pkgs/by-name/sn/snapcraft/package.nix @@ -67,7 +67,7 @@ python3Packages.buildPythonApplication rec { substituteInPlace snapcraft/elf/elf_utils.py \ --replace-fail 'arch_linker_path = Path(arch_config.dynamic_linker)' \ 'return str(Path("${glibc}/lib/ld-linux-x86-64.so.2"))' - + substituteInPlace snapcraft_legacy/internal/xattrs.py \ --replace-fail 'distutils.util' 'setuptools.dist' ''; @@ -107,9 +107,7 @@ python3Packages.buildPythonApplication rec { tinydb ]; - nativeBuildInputs = with python3Packages; [ - setuptools - ]; + nativeBuildInputs = with python3Packages; [ setuptools ]; pythonRelaxDeps = [ "docutils" @@ -122,18 +120,21 @@ python3Packages.buildPythonApplication rec { wrapProgram $out/bin/snapcraft --prefix PATH : ${squashfsTools}/bin ''; - nativeCheckInputs = with python3Packages; [ - pytest-check - pytest-cov - pytest-mock - pytest-subprocess - pytestCheckHook - responses - setuptools - ] ++ [ - git - squashfsTools - ]; + nativeCheckInputs = + with python3Packages; + [ + pytest-check + pytest-cov + pytest-mock + pytest-subprocess + pytestCheckHook + responses + setuptools + ] + ++ [ + git + squashfsTools + ]; preCheck = '' mkdir -p check-phase @@ -164,9 +165,7 @@ python3Packages.buildPythonApplication rec { "test_snap_command_fallback" "test_validate_architectures_supported" "test_validate_architectures_unsupported" - ] ++ lib.optionals stdenv.isAarch64 [ - "test_load_project" - ]; + ] ++ lib.optionals stdenv.isAarch64 [ "test_load_project" ]; disabledTestPaths = [ "tests/unit/commands/test_remote.py" From de97b31f360833ad8739d856fb18175928beca6a Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Tue, 9 Jul 2024 13:47:37 +0200 Subject: [PATCH 10/10] charmcraft: run `nixfmt-rfc-style` --- pkgs/by-name/ch/charmcraft/package.nix | 29 +++++++++++++------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/pkgs/by-name/ch/charmcraft/package.nix b/pkgs/by-name/ch/charmcraft/package.nix index 471526aa603e..a2ea187240c8 100644 --- a/pkgs/by-name/ch/charmcraft/package.nix +++ b/pkgs/by-name/ch/charmcraft/package.nix @@ -47,23 +47,22 @@ python3Packages.buildPythonApplication rec { urllib3 ]; - nativeBuildInputs = with python3Packages; [ - setuptools - ]; + nativeBuildInputs = with python3Packages; [ setuptools ]; - pythonRelaxDeps = [ - "urllib3" - ]; + pythonRelaxDeps = [ "urllib3" ]; - nativeCheckInputs = with python3Packages; [ - pyfakefs - pytest-check - pytest-mock - pytest-subprocess - pytestCheckHook - responses - setuptools - ] ++ [ git ]; + nativeCheckInputs = + with python3Packages; + [ + pyfakefs + pytest-check + pytest-mock + pytest-subprocess + pytestCheckHook + responses + setuptools + ] + ++ [ git ]; preCheck = '' mkdir -p check-phase