From 1215ea96c55576e55a40fa32374fe427987faa2a Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 15 Feb 2025 22:28:47 -0500 Subject: [PATCH] python312Packages.numericalunits: fix build --- .../python-modules/numericalunits/default.nix | 35 +++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/numericalunits/default.nix b/pkgs/development/python-modules/numericalunits/default.nix index 5fc21a89e878..5f62372502f6 100644 --- a/pkgs/development/python-modules/numericalunits/default.nix +++ b/pkgs/development/python-modules/numericalunits/default.nix @@ -1,26 +1,39 @@ { lib, buildPythonPackage, - fetchPypi, - isPy3k, + fetchFromGitHub, + setuptools, + pytestCheckHook, }: buildPythonPackage rec { - version = "1.26"; - format = "setuptools"; pname = "numericalunits"; + version = "1.26"; + pyproject = true; - src = fetchPypi { - inherit pname version; - sha256 = "sha256-igtplF3WXqz27vjIaLzTKY10OfWIL1B7tgYOwgxyPhI="; + src = fetchFromGitHub { + owner = "sbyrnes321"; + repo = "numericalunits"; + tag = "numericalunits-${version}"; + hash = "sha256-vPB1r+j+p9n+YLnBjHuk2t+QSr+adEOjyC45QSbeb4M="; }; - disabled = !isPy3k; + build-system = [ + setuptools + ]; - meta = with lib; { + nativeCheckInputs = [ + pytestCheckHook + ]; + + pytestFlagsArray = [ + "tests/tests.py" + ]; + + meta = { homepage = "http://pypi.python.org/pypi/numericalunits"; description = "Package that lets you define quantities with unit"; - license = licenses.mit; - maintainers = [ ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ nickcao ]; }; }