3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/dunamai/default.nix
2022-04-05 18:07:58 +00:00

53 lines
979 B
Nix

{ lib
, poetry-core
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, importlib-metadata
, packaging
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "dunamai";
version = "1.11.1";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "mtkennerly";
repo = "dunamai";
rev = "v${version}";
sha256 = "sha256-nkE9QBziCQA/aN+Z0OuqJlf5FJ4fidE7u5Gt25zjX0c=";
};
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
packaging
] ++ lib.optionals (pythonOlder "3.8") [
importlib-metadata
];
# needs to be able to run dunami from PATH
preCheck = ''
export PATH=$PATH:$out/bin
'';
checkInputs = [
pytestCheckHook
];
pythonImportsCheck = [ "dunamai" ];
meta = with lib; {
description = "Dynamic version generation";
homepage = "https://github.com/mtkennerly/dunamai";
license = licenses.mit;
maintainers = with maintainers; [ jmgilman ];
};
}