1{
2 buildPythonPackage,
3 fetchPypi,
4 isPy27,
5 lib,
6 setuptools,
7 simpy,
8 tkinter,
9 # GUI-based visualization of the simulation is optional
10 enableVisualization ? true,
11}:
12
13buildPythonPackage rec {
14 pname = "wsnsimpy";
15 version = "0.2.5";
16 format = "setuptools";
17 disabled = isPy27;
18
19 src = fetchPypi {
20 inherit pname version;
21 sha256 = "1b7fdqwc2v9alfwf2fr0aqr8rf2pb5lpm4anpilmvrh2lhjar4i2";
22 };
23
24 propagatedBuildInputs = [
25 setuptools
26 simpy
27 ] ++ lib.optional enableVisualization tkinter;
28
29 # No test cases are included, thus unittest tries to run the examples, which
30 # fail because no DISPLAYs are available.
31 doCheck = false;
32
33 pythonImportsCheck = [ "wsnsimpy" ] ++ lib.optional enableVisualization "wsnsimpy.wsnsimpy_tk";
34
35 meta = with lib; {
36 description = "SimPy-based WSN Simulator";
37 homepage = "https://pypi.org/project/wsnsimpy/";
38 license = licenses.bsd2;
39 maintainers = with maintainers; [ dmrauh ];
40 };
41}