summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pyquaternion/default.nix
blob: 510678422607c22379b877fcfc8b79372257fe82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  numpy,
  setuptools,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "pyquaternion";
  version = "0.9.9";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "KieranWynn";
    repo = "pyquaternion";
    rev = "v${version}";
    hash = "sha256-L0wT9DFUDRcmmN7OpmIDNvtQWQrM7iFnZt6R2xrJ+3A=";
  };

  patches = [
    ./numpy2-repr.patch
  ];

  # The VERSION.txt file is required for setup.py
  # See: https://github.com/KieranWynn/pyquaternion/blob/master/setup.py#L14-L15
  postPatch = ''
    echo "${version}" > VERSION.txt
  '';

  build-system = [ setuptools ];

  dependencies = [ numpy ];

  nativeCheckInputs = [ pytestCheckHook ];

  enabledTestPaths = [ "pyquaternion/test/" ];

  pythonImportsCheck = [ "pyquaternion" ];

  meta = {
    description = "Library for representing and using quaternions";
    homepage = "http://kieranwynn.github.io/pyquaternion/";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ lucasew ];
  };
}