1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 requests,
7 pytestCheckHook,
8 pytest-rerunfailures,
9}:
10
11buildPythonPackage rec {
12 pname = "travispy";
13 version = "0.3.5";
14 pyproject = true;
15
16 src = fetchFromGitHub {
17 owner = "menegazzo";
18 repo = "travispy";
19 tag = "v${version}";
20 hash = "sha256-jYuRaKtoWaWq6QWinXnuBfqanTCMibouwwWHfcmioGo=";
21 };
22
23 postPatch = ''
24 # Fix deprecated pytest configuration
25 substituteInPlace setup.cfg \
26 --replace-fail "[pytest]" "[tool:pytest]"
27 '';
28
29 build-system = [ setuptools ];
30
31 dependencies = [ requests ];
32
33 nativeCheckInputs = [
34 pytestCheckHook
35 pytest-rerunfailures
36 ];
37
38 tests = [
39 "travispy/_tests/"
40 ];
41
42 # Skip tests that require network access
43 disabledTests = [
44 "test_not_authenticated"
45 ];
46
47 pythonImportsCheck = [ "travispy" ];
48
49 meta = {
50 description = "Python API for Travis CI";
51 homepage = "https://github.com/menegazzo/travispy";
52 changelog = "https://github.com/menegazzo/travispy/releases/tag/v${version}";
53 license = lib.licenses.gpl3Only;
54 maintainers = [ lib.maintainers.jamiemagee ];
55 };
56}