summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pytomlpp/default.nix
blob: 4866d8469ee59610aa4066035fc6425d89b16ae3 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pybind11,
  pytestCheckHook,
  python-dateutil,
  doxygen,
  python,
  pelican,
  matplotlib,
}:

buildPythonPackage rec {
  pname = "pytomlpp";
  version = "1.1.0";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "bobfang1992";
    repo = "pytomlpp";
    rev = "v${version}";
    fetchSubmodules = true;
    hash = "sha256-RRsjnZK0FJiSkpWxurs9vJFyo2SUAKyFKXoJ8bcsHKI=";
  };

  # The latest setuptools has deprecated `setup_requires` and will attempt to automatically invoke `pip` to install dependencies during the build.
  patches = [ ./0001-remove-setup_requires.patch ];

  buildInputs = [ pybind11 ];

  nativeCheckInputs = [
    pytestCheckHook

    python-dateutil
    doxygen
    python
    pelican
    matplotlib
  ];

  doCheck = true;

  disabledTests = [
    # incompatible with pytest7
    # https://github.com/bobfang1992/pytomlpp/issues/66
    "test_loads_valid_toml_files"
    "test_round_trip_for_valid_toml_files"
    "test_decode_encode_binary"
  ];

  preCheck = ''
    cd tests
  '';

  pythonImportsCheck = [ "pytomlpp" ];

  meta = {
    description = "Python wrapper for tomlplusplus";
    homepage = "https://github.com/bobfang1992/pytomlpp";
    license = lib.licenses.mit;
    maintainers = [ ];
  };
}