From b9b954b53db6701ad4128d0765ce05510f9d5f25 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Thu, 14 Nov 2024 18:21:59 +0800 Subject: [PATCH 1/2] python3Packages.jenkins-job-builder: adopt (cherry picked from commit 8e327be3a81a229ab1a6526b358f39f1f75c720b) --- .../python-modules/jenkins-job-builder/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/jenkins-job-builder/default.nix b/pkgs/development/python-modules/jenkins-job-builder/default.nix index a1ac389acdee..3a3c68757486 100644 --- a/pkgs/development/python-modules/jenkins-job-builder/default.nix +++ b/pkgs/development/python-modules/jenkins-job-builder/default.nix @@ -38,11 +38,11 @@ buildPythonPackage rec { # Need to fix test deps, relies on stestr and a few other packages that aren't available on nixpkgs checkPhase = "$out/bin/jenkins-jobs --help"; - meta = with lib; { + meta = { description = "Jenkins Job Builder is a system for configuring Jenkins jobs using simple YAML files stored in Git"; mainProgram = "jenkins-jobs"; homepage = "https://jenkins-job-builder.readthedocs.io/en/latest/"; - license = licenses.asl20; - maintainers = [ ]; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ bot-wxt1221 ]; }; } From 66d85ba9784fb71f42dc7eb7a1032acd142c9af1 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Thu, 14 Nov 2024 18:41:16 +0800 Subject: [PATCH 2/2] python3Packages.jenkins-job-builder: fix build (cherry picked from commit aae6b971d686ff2a32cad9c27b35d5f7f0e5a46e) --- .../jenkins-job-builder/default.nix | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/jenkins-job-builder/default.nix b/pkgs/development/python-modules/jenkins-job-builder/default.nix index 3a3c68757486..479abaffd66f 100644 --- a/pkgs/development/python-modules/jenkins-job-builder/default.nix +++ b/pkgs/development/python-modules/jenkins-job-builder/default.nix @@ -9,23 +9,36 @@ pyyaml, six, stevedore, + pytestCheckHook, + setuptools, + fetchpatch, + testtools, + pytest-mock, }: buildPythonPackage rec { pname = "jenkins-job-builder"; version = "6.4.1"; - format = "setuptools"; + + build-system = [ setuptools ]; src = fetchPypi { inherit pname version; hash = "sha256-Re7rNAcm0cpSx1tmSzTjfDlW7y236lzFKFjVw0uUTmw="; }; + patches = [ + (fetchpatch { + url = "https://opendev.org/jjb/jenkins-job-builder/commit/7bf0dacd80d6da7b8562db05f9187140e42947c8.patch"; + hash = "sha256-2z7axGgVV5Z7A11JiQhlrjjXDKYe+X6NrJEuXd986Do="; + }) + ]; + postPatch = '' export HOME=$(mktemp -d) ''; - propagatedBuildInputs = [ + dependencies = [ pbr python-jenkins pyyaml @@ -35,8 +48,11 @@ buildPythonPackage rec { jinja2 ]; - # Need to fix test deps, relies on stestr and a few other packages that aren't available on nixpkgs - checkPhase = "$out/bin/jenkins-jobs --help"; + nativeCheckInputs = [ + pytestCheckHook + testtools + pytest-mock + ]; meta = { description = "Jenkins Job Builder is a system for configuring Jenkins jobs using simple YAML files stored in Git";