1{ lib, buildPythonPackage, fetchFromGitHub, six, hypothesis, mock
2, python-Levenshtein, pytest, termcolor, isPy27, enum34 }:
3
4buildPythonPackage rec {
5 pname = "fire";
6 version = "0.4.0";
7
8 src = fetchFromGitHub {
9 owner = "google";
10 repo = "python-fire";
11 rev = "v${version}";
12 sha256 = "1caz6j2kdhj0kccrnqri6b4g2d6wzkkx8y9vxyvm7axvrwkv2vyn";
13 };
14
15 propagatedBuildInputs = [ six termcolor ] ++ lib.optional isPy27 enum34;
16
17 checkInputs = [ hypothesis mock python-Levenshtein pytest ];
18
19 # ignore test which asserts exact usage statement, default behavior
20 # changed in python3.8. This can likely be remove >=0.3.1
21 checkPhase = ''
22 py.test -k 'not testInitRequiresFlag'
23 '';
24
25 meta = with lib; {
26 description = "A library for automatically generating command line interfaces";
27 longDescription = ''
28 Python Fire is a library for automatically generating command line
29 interfaces (CLIs) from absolutely any Python object.
30
31 * Python Fire is a simple way to create a CLI in Python.
32
33 * Python Fire is a helpful tool for developing and debugging
34 Python code.
35
36 * Python Fire helps with exploring existing code or turning other
37 people's code into a CLI.
38
39 * Python Fire makes transitioning between Bash and Python easier.
40
41 * Python Fire makes using a Python REPL easier by setting up the
42 REPL with the modules and variables you'll need already imported
43 and created.
44 '';
45 license = licenses.asl20;
46 maintainers = with maintainers; [ leenaars ];
47 };
48}