1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 numpy,
6 setuptools,
7 pytestCheckHook,
8}:
9
10buildPythonPackage rec {
11 pname = "pyquaternion";
12 version = "0.9.9";
13 pyproject = true;
14
15 src = fetchFromGitHub {
16 owner = "KieranWynn";
17 repo = "pyquaternion";
18 rev = "v${version}";
19 hash = "sha256-L0wT9DFUDRcmmN7OpmIDNvtQWQrM7iFnZt6R2xrJ+3A=";
20 };
21
22 patches = [
23 ./numpy2-repr.patch
24 ];
25
26 # The VERSION.txt file is required for setup.py
27 # See: https://github.com/KieranWynn/pyquaternion/blob/master/setup.py#L14-L15
28 postPatch = ''
29 echo "${version}" > VERSION.txt
30 '';
31
32 build-system = [ setuptools ];
33
34 dependencies = [ numpy ];
35
36 nativeCheckInputs = [ pytestCheckHook ];
37
38 enabledTestPaths = [ "pyquaternion/test/" ];
39
40 pythonImportsCheck = [ "pyquaternion" ];
41
42 meta = with lib; {
43 description = "Library for representing and using quaternions";
44 homepage = "http://kieranwynn.github.io/pyquaternion/";
45 license = licenses.mit;
46 maintainers = with maintainers; [ lucasew ];
47 };
48}