summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/naked/default.nix
blob: b169b2e0a649a267531a86d43136e1a8cd680b03 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
{
  buildPythonPackage,
  python,
  fetchFromGitHub,
  lib,
  requests,
  pyyaml,
  setuptools,
  wheel,
  nodejs,
  ruby,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "naked";
  version = "0.1.32";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "chrissimpkins";
    repo = "naked";
    rev = "v${version}";
    hash = "sha256-KhygnURFggvUTR9wwWtORtfQES8ANd5sIaCONvIhfRM=";
  };

  postPatch = ''
    # fix hardcoded absolute paths
    substituteInPlace tests/test_SYSTEM*.py \
      --replace-fail /Users/ces/Desktop/code/naked/tests/ "$PWD"/tests/
    substituteInPlace lib/Naked/toolshed/c/*.c \
      --replace-fail /Users/ces/Desktop/code/naked/lib/ $out/${python.sitePackages}/
  '';

  nativeBuildInputs = [
    wheel
    setuptools
  ];

  propagatedBuildInputs = [
    requests
    pyyaml
  ];

  nativeCheckInputs = [
    pytestCheckHook
    nodejs
    ruby
  ];

  preCheck = ''
    cd tests

    PATH=$PATH:$out/bin
  '';

  disabledTestPaths = [ "testfiles" ];

  disabledTests = [
    # test_NETWORK.py
    "test_http_get"
    "test_http_get_binary_file_absent"
    "test_http_get_binary_file_exists"
    "test_http_get_bin_type"
    "test_http_get_follow_redirects"
    "test_http_get_follow_redirects_false_content"
    "test_http_get_follow_redirects_false_on_nofollow_arg"
    "test_http_get_response_check_200"
    "test_http_get_response_check_301"
    "test_http_get_response_check_404"
    "test_http_get_response_obj_present"
    "test_http_get_ssl"
    "test_http_get_status_check_true"
    "test_http_get_status_ssl"
    "test_http_get_status_ssl_redirect"
    "test_http_get_text_absent"
    "test_http_get_text_exists_request_overwrite"
    "test_http_get_type"
    "test_http_post"
    "test_http_post_binary_file_absent"
    "test_http_post_binary_file_present"
    "test_http_post_binary_file_present_request_overwrite"
    "test_http_post_reponse_status_200"
    "test_http_post_response_status_200_ssl"
    "test_http_post_ssl"
    "test_http_post_status_check_true"
    "test_http_post_text_file_absent"
    "test_http_post_text_file_present_request_overwrite"
    "test_http_post_type"
    # test_SHELL.py
    "test_muterun_missing_option_exitcode"
    # test_SYSTEM.py
    "test_sys_list_all_files"
    "test_sys_list_all_files_cwd"
    "test_sys_list_all_files_emptydir"
    "test_sys_list_filter_files"
    "test_sys_match_files"
    "test_sys_match_files_fullpath"
    "test_sys_meta_file_mod"
    # test_TYPES.py
    "test_xdict_key_random"
    "test_xdict_key_random_sample"
  ];

  pythonImportsCheck = [ "Naked" ];

  meta = {
    description = "Python command line application framework";
    homepage = "https://github.com/chrissimpkins/naked";
    downloadPage = "https://github.com/chrissimpkins/naked/tags";
    license = lib.licenses.mit;
    maintainers = [ lib.maintainers.lucasew ];
  };
}