diff --git a/pkgs/development/python-modules/bitmath/default.nix b/pkgs/development/python-modules/bitmath/default.nix index 52213081e0f5..87c00c52e548 100644 --- a/pkgs/development/python-modules/bitmath/default.nix +++ b/pkgs/development/python-modules/bitmath/default.nix @@ -1,33 +1,35 @@ { lib, buildPythonPackage, - fetchPypi, - isPy3k, - progressbar231 ? null, - progressbar33, - mock, + fetchFromGitHub, + hatchling, + pytestCheckHook, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "bitmath"; - version = "1.3.3.1"; - format = "setuptools"; + version = "2.1.1"; + pyproject = true; - src = fetchPypi { - inherit pname version; - sha256 = "293325f01e65defe966853111df11d39215eb705a967cb115851da8c4cfa3eb8"; + src = fetchFromGitHub { + owner = "timlnx"; + repo = "bitmath"; + tag = "v${finalAttrs.version}"; + hash = "sha256-9hiwIpDIAU+N+LhlJ9qlKBZQibbrwwhGM77fvEnABRI="; }; - nativeCheckInputs = [ - (if isPy3k then progressbar33 else progressbar231) - mock - ]; + build-system = [ hatchling ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "bitmath" ]; meta = { description = "Module for representing and manipulating file sizes with different prefix"; - mainProgram = "bitmath"; - homepage = "https://github.com/tbielawa/bitmath"; + homepage = "https://github.com/timlnx/bitmath"; + changelog = "https://github.com/timlnx/bitmath/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ twey ]; + mainProgram = "bitmath"; }; -} +})