From f516196fd1ecdbfa84b0e78a6c66cf7b770abc76 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 3 Aug 2024 00:20:04 +0200 Subject: [PATCH] python312Packages.vector: clean and fix --- .../python-modules/vector/default.nix | 49 +++++++++++++------ 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/vector/default.nix b/pkgs/development/python-modules/vector/default.nix index f0ebd1f62128..ad5efb0c8105 100644 --- a/pkgs/development/python-modules/vector/default.nix +++ b/pkgs/development/python-modules/vector/default.nix @@ -1,58 +1,77 @@ { lib, - awkward, buildPythonPackage, - fetchPypi, + pythonOlder, + fetchFromGitHub, + + # build-system hatch-vcs, hatchling, - numba, + + # dependencies numpy, - notebook, packaging, + + # checks + awkward, + dask-awkward, + notebook, + numba, papermill, pytestCheckHook, - pythonOlder, + sympy, + + stdenv, }: buildPythonPackage rec { pname = "vector"; version = "1.4.1"; - format = "pyproject"; + pyproject = true; disabled = pythonOlder "3.8"; - src = fetchPypi { - inherit pname version; - hash = "sha256-Fa74kRVg2x6j/6nb1UFNDsV1pQSiw/I+pFFwoYmURm4="; + src = fetchFromGitHub { + owner = "scikit-hep"; + repo = "vector"; + rev = "refs/tags/v${version}"; + hash = "sha256-ckwJgh5aWFTwoEBVmKukdk+cmQeOuecLiYD2EcuELGw="; }; - nativeBuildInputs = [ + build-system = [ hatch-vcs hatchling ]; - propagatedBuildInputs = [ + dependencies = [ numpy packaging ]; - checkInputs = [ + nativeCheckInputs = [ awkward + dask-awkward notebook numba papermill pytestCheckHook + sympy ]; pythonImportsCheck = [ "vector" ]; __darwinAllowLocalNetworking = true; - meta = with lib; { + disabledTests = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ + # AssertionError: assert 2.1073424255447017e-08 == 0.0 + "test_issue_463" + ]; + + meta = { description = "Library for 2D, 3D, and Lorentz vectors, especially arrays of vectors, to solve common physics problems in a NumPy-like way"; homepage = "https://github.com/scikit-hep/vector"; changelog = "https://github.com/scikit-hep/vector/releases/tag/v${version}"; - license = with licenses; [ bsd3 ]; - maintainers = with maintainers; [ veprbl ]; + license = with lib.licenses; [ bsd3 ]; + maintainers = with lib.maintainers; [ veprbl ]; }; }