1{ stdenv, buildPythonPackage, fetchFromGitHub, fetchpatch, six, hypothesis, mock
2, python-Levenshtein, pytest }:
3
4buildPythonPackage rec {
5 pname = "fire";
6 version = "0.1.3";
7
8 src = fetchFromGitHub {
9 owner = "google";
10 repo = "python-fire";
11 rev = "v${version}";
12 sha256 = "0kdcmzr3sgzjsw5fmvdylgrn8akqjbs433jbgqzp498njl9cc6qx";
13 };
14
15 propagatedBuildInputs = [ six ];
16
17 checkInputs = [ hypothesis mock python-Levenshtein pytest ];
18
19 checkPhase = ''
20 py.test
21 '';
22
23 patches = [
24 # Add Python 3.7 support. Remove with the next release
25 (fetchpatch {
26 url = "https://github.com/google/python-fire/commit/668007ae41391f5964870b4597e41493a936a11e.patch";
27 sha256 = "0rf7yzv9qx66zfmdggfz478z37fi4rwx4hlh3dk1065sx5rfksi0";
28 })
29 ];
30
31 meta = with stdenv.lib; {
32 description = "A library for automatically generating command line interfaces";
33 longDescription = ''
34 Python Fire is a library for automatically generating command line
35 interfaces (CLIs) from absolutely any Python object.
36
37 * Python Fire is a simple way to create a CLI in Python.
38
39 * Python Fire is a helpful tool for developing and debugging
40 Python code.
41
42 * Python Fire helps with exploring existing code or turning other
43 people's code into a CLI.
44
45 * Python Fire makes transitioning between Bash and Python easier.
46
47 * Python Fire makes using a Python REPL easier by setting up the
48 REPL with the modules and variables you'll need already imported
49 and created.
50 '';
51 license = licenses.asl20;
52 maintainers = with maintainers; [ leenaars ];
53 };
54}