about summary refs log tree commit diff
path: root/pkgs/by-name/ht/httpy-cli/package.nix
blob: 2b59b54ef2136134b5d7068aff3c03a884767f2c (plain) (blame)
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
{ lib
, python3Packages
, fetchPypi
, curl
 }:

python3Packages.buildPythonPackage rec {
  pname = "httpy-cli";
  version = "1.1.0";
  pyproject = true;

  src = fetchPypi {
    inherit version;
    pname = "httpy-cli";
    hash = "sha256-uhF/jF4buHMDiXOuuqjskynioz4qVBevQhdcUbH+91Q=";
  };

  propagatedBuildInputs = with python3Packages; [
    colorama
    pygments
    requests
    urllib3
  ];

  build-system = with python3Packages; [
      setuptools
  ];

  pythonImportsCheck = [
    "httpy"
  ];

  nativeCheckInputs = [
      python3Packages.pytest
      curl
    ];

  checkPhase = ''
    runHook preCheck
    echo "line1\nline2\nline3" > tests/test_file.txt
    # ignore the test_args according to pytest.ini in the repo
    pytest tests/ --ignore=tests/test_args.py
    runHook postCheck
  '';

  meta = with lib; {
    description = "Modern, user-friendly, programmable command-line HTTP client for the API";
    homepage = "https://github.com/knid/httpy";
    license = licenses.mit;
    mainProgram = "httpy";
    maintainers = with maintainers; [ eymeric ];
  };
}