From 047b5cd12fe38b9fab7e8f427e2ff25a471b5d76 Mon Sep 17 00:00:00 2001 From: Guy Chronister Date: Tue, 22 Jul 2025 12:45:18 -0500 Subject: [PATCH] treewide: refactor git python package definitions --- pkgs/by-name/gi/git-archive-all/package.nix | 17 +++++++---------- pkgs/by-name/gi/git-imerge/package.nix | 10 +++++----- pkgs/by-name/gi/git-publish/package.nix | 6 +++--- pkgs/by-name/gi/git-repo-updater/package.nix | 19 ++++++++----------- pkgs/by-name/gi/git-review/package.nix | 19 ++++++++----------- 5 files changed, 31 insertions(+), 40 deletions(-) diff --git a/pkgs/by-name/gi/git-archive-all/package.nix b/pkgs/by-name/gi/git-archive-all/package.nix index 30bcbe8beb39..77f9259099a7 100644 --- a/pkgs/by-name/gi/git-archive-all/package.nix +++ b/pkgs/by-name/gi/git-archive-all/package.nix @@ -1,14 +1,11 @@ { lib, - buildPythonApplication, + python3Packages, fetchFromGitHub, git, - pytestCheckHook, - pytest-cov-stub, - pytest-mock, }: -buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "git-archive-all"; version = "1.23.1"; format = "setuptools"; @@ -16,7 +13,7 @@ buildPythonApplication rec { src = fetchFromGitHub { owner = "Kentzo"; repo = "git-archive-all"; - rev = version; + tag = version; hash = "sha256-fIPjggOx+CEorj1bazz8s81ZdppkTL0OlA5tRqCYZyc="; }; @@ -40,7 +37,7 @@ buildPythonApplication rec { git ]; - checkInputs = [ + checkInputs = with python3Packages; [ pytestCheckHook pytest-cov-stub pytest-mock @@ -52,15 +49,15 @@ buildPythonApplication rec { export HOME="$(mktemp -d)" ''; - meta = with lib; { + meta = { description = "Archive a repository with all its submodules"; longDescription = '' A python script wrapper for git-archive that archives a git superproject and its submodules, if it has any. Takes into account .gitattributes ''; homepage = "https://github.com/Kentzo/git-archive-all"; - license = licenses.mit; - maintainers = with maintainers; [ fgaz ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fgaz ]; mainProgram = "git-archive-all"; }; } diff --git a/pkgs/by-name/gi/git-imerge/package.nix b/pkgs/by-name/gi/git-imerge/package.nix index c096a472f2dc..d55e9113f138 100644 --- a/pkgs/by-name/gi/git-imerge/package.nix +++ b/pkgs/by-name/gi/git-imerge/package.nix @@ -1,11 +1,11 @@ { lib, - buildPythonApplication, + python3Packages, fetchPypi, installShellFiles, }: -buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "git-imerge"; version = "1.2.0"; format = "setuptools"; @@ -21,11 +21,11 @@ buildPythonApplication rec { installShellCompletion --bash completions/git-imerge ''; - meta = with lib; { + meta = { homepage = "https://github.com/mhagger/git-imerge"; description = "Perform a merge between two branches incrementally"; - license = licenses.gpl2Plus; - maintainers = [ ]; + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ ]; mainProgram = "git-imerge"; }; } diff --git a/pkgs/by-name/gi/git-publish/package.nix b/pkgs/by-name/gi/git-publish/package.nix index 6596fbeddf3e..cc8908ebbbc5 100644 --- a/pkgs/by-name/gi/git-publish/package.nix +++ b/pkgs/by-name/gi/git-publish/package.nix @@ -6,14 +6,14 @@ fetchFromGitHub, installShellFiles, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "git-publish"; version = "1.8.2"; src = fetchFromGitHub { owner = "stefanha"; repo = "git-publish"; - rev = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-jjpbr+ZqG4U8/z0PurnXR+IUKQkG3QB8YqhDkH8uu2Y="; }; @@ -40,4 +40,4 @@ stdenv.mkDerivation rec { homepage = "https://github.com/stefanha/git-publish"; mainProgram = "git-publish"; }; -} +}) diff --git a/pkgs/by-name/gi/git-repo-updater/package.nix b/pkgs/by-name/gi/git-repo-updater/package.nix index a5bfb4b845e4..1b8dbb952815 100644 --- a/pkgs/by-name/gi/git-repo-updater/package.nix +++ b/pkgs/by-name/gi/git-repo-updater/package.nix @@ -1,24 +1,21 @@ { lib, - buildPythonApplication, - hatchling, - colorama, + python3Packages, fetchPypi, - gitpython, }: -buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "gitup"; version = "0.5.2"; pyproject = true; src = fetchPypi { inherit pname version; - sha256 = "sha256-51DWPJ9JOMrRdWGaiiL4qzo4VFFeT1rG5yyI6Ej+ZRw="; + hash = "sha256-51DWPJ9JOMrRdWGaiiL4qzo4VFFeT1rG5yyI6Ej+ZRw="; }; - build-system = [ hatchling ]; - propagatedBuildInputs = [ + build-system = with python3Packages; [ hatchling ]; + dependencies = with python3Packages; [ colorama gitpython ]; @@ -26,11 +23,11 @@ buildPythonApplication rec { # no tests doCheck = false; - meta = with lib; { + meta = { description = "Easily update multiple Git repositories at once"; homepage = "https://github.com/earwig/git-repo-updater"; - license = licenses.mit; - maintainers = with maintainers; [ + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ bdesham artturin ]; diff --git a/pkgs/by-name/gi/git-review/package.nix b/pkgs/by-name/gi/git-review/package.nix index 783a2525f2a8..cfc25a73c5ff 100644 --- a/pkgs/by-name/gi/git-review/package.nix +++ b/pkgs/by-name/gi/git-review/package.nix @@ -1,19 +1,16 @@ { lib, - buildPythonApplication, + python3Packages, fetchgit, - pbr, - requests, - setuptools, gitUpdater, }: -buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "git-review"; version = "2.5.0"; format = "setuptools"; - # Manually set version because prb wants to get it from the git + # Manually set version because pbr wants to get it from the git # upstream repository (and we are installing from tarball instead) PBR_VERSION = version; @@ -29,11 +26,11 @@ buildPythonApplication rec { "man" ]; - nativeBuildInputs = [ + nativeBuildInputs = with python3Packages; [ pbr ]; - propagatedBuildInputs = [ + dependencies = with python3Packages; [ requests setuptools # implicit dependency, used to get package version through pkg_resources ]; @@ -47,12 +44,12 @@ buildPythonApplication rec { passthru.updateScript = gitUpdater { }; - meta = with lib; { + meta = { description = "Tool to submit code to Gerrit"; homepage = "https://opendev.org/opendev/git-review"; changelog = "https://docs.opendev.org/opendev/git-review/latest/releasenotes.html#relnotes-${version}"; - license = licenses.asl20; - maintainers = with maintainers; [ kira-bruneau ]; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ kira-bruneau ]; mainProgram = "git-review"; }; }