1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 six,
7 hypothesis,
8 mock,
9 levenshtein,
10 pytestCheckHook,
11 termcolor,
12 pythonOlder,
13}:
14
15buildPythonPackage rec {
16 pname = "fire";
17 version = "0.5.0";
18 format = "setuptools";
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "google";
24 repo = "python-fire";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-cwY1RRNtpAn6LnBASQLTNf4XXSPnfhOa1WgglGEM2/s=";
27 };
28
29 patches = [
30 # https://github.com/google/python-fire/pull/440
31 (fetchpatch {
32 name = "remove-asyncio-coroutine.patch";
33 url = "https://github.com/google/python-fire/pull/440/commits/30b775a7b36ce7fbc04656c7eec4809f99d3e178.patch";
34 hash = "sha256-GDAAlvZKbJl3OhajsEO0SZvWIXcPDi3eNKKVgbwSNKk=";
35 })
36 ];
37
38 propagatedBuildInputs = [
39 six
40 termcolor
41 ];
42
43 nativeCheckInputs = [
44 hypothesis
45 mock
46 levenshtein
47 pytestCheckHook
48 ];
49
50 pythonImportsCheck = [ "fire" ];
51
52 meta = with lib; {
53 description = "A library for automatically generating command line interfaces";
54 longDescription = ''
55 Python Fire is a library for automatically generating command line
56 interfaces (CLIs) from absolutely any Python object.
57
58 * Python Fire is a simple way to create a CLI in Python.
59
60 * Python Fire is a helpful tool for developing and debugging
61 Python code.
62
63 * Python Fire helps with exploring existing code or turning other
64 people's code into a CLI.
65
66 * Python Fire makes transitioning between Bash and Python easier.
67
68 * Python Fire makes using a Python REPL easier by setting up the
69 REPL with the modules and variables you'll need already imported
70 and created.
71 '';
72 homepage = "https://github.com/google/python-fire";
73 changelog = "https://github.com/google/python-fire/releases/tag/v${version}";
74 license = licenses.asl20;
75 maintainers = with maintainers; [ leenaars ];
76 };
77}