depot/third_party/nixpkgs/pkgs/development/python-modules/awesomeversion/default.nix
Default email ca5ab3a501 Project import generated by Copybara.
GitOrigin-RevId: 4a01ca36d6bfc133bc617e661916a81327c9bbc8
2022-07-14 08:49:19 -04:00

47 lines
915 B
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, poetry-core
, pytestCheckHook
, pythonOlder
}:
buildPythonPackage rec {
pname = "awesomeversion";
version = "22.6.0";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "ludeeus";
repo = pname;
rev = version;
sha256 = "sha256-osAJzJr9PtGH8wcHam1BolIBTD8QDBWg3mI/z4JW0JE=";
};
nativeBuildInputs = [
poetry-core
];
checkInputs = [
pytestCheckHook
];
postPatch = ''
# Upstream doesn't set a version
substituteInPlace pyproject.toml \
--replace 'version = "0"' 'version = "${version}"'
'';
pythonImportsCheck = [
"awesomeversion"
];
meta = with lib; {
description = "Python module to deal with versions";
homepage = "https://github.com/ludeeus/awesomeversion";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}