summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/travispy/default.nix
blob: d8d6cbe96baa909906bb9144b463ba493aefccd4 (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  requests,
  pytestCheckHook,
  pytest-rerunfailures,
}:

buildPythonPackage rec {
  pname = "travispy";
  version = "0.3.5";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "menegazzo";
    repo = "travispy";
    tag = "v${version}";
    hash = "sha256-jYuRaKtoWaWq6QWinXnuBfqanTCMibouwwWHfcmioGo=";
  };

  postPatch = ''
    # Fix deprecated pytest configuration
    substituteInPlace setup.cfg \
      --replace-fail "[pytest]" "[tool:pytest]"
  '';

  build-system = [ setuptools ];

  dependencies = [ requests ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-rerunfailures
  ];

  tests = [
    "travispy/_tests/"
  ];

  # Skip tests that require network access
  disabledTests = [
    "test_not_authenticated"
  ];

  pythonImportsCheck = [ "travispy" ];

  meta = {
    description = "Python API for Travis CI";
    homepage = "https://github.com/menegazzo/travispy";
    changelog = "https://github.com/menegazzo/travispy/releases/tag/v${version}";
    license = lib.licenses.gpl3Only;
    maintainers = [ lib.maintainers.jamiemagee ];
  };
}