1{
2 stdenv,
3 lib,
4 pythonOlder,
5 buildPythonPackage,
6 fetchFromGitHub,
7 numpy,
8 scipy,
9 pandas,
10 matplotlib,
11 nbval,
12 pyvisa,
13 networkx,
14 ipython,
15 ipykernel,
16 ipywidgets,
17 jupyter-client,
18 sphinx-rtd-theme,
19 sphinx,
20 nbsphinx,
21 openpyxl,
22 setuptools,
23 pytestCheckHook,
24 pytest-cov-stub,
25 pytest-mock,
26}:
27
28buildPythonPackage rec {
29 pname = "scikit-rf";
30 version = "1.8.0";
31 pyproject = true;
32
33 disabled = pythonOlder "3.8";
34
35 src = fetchFromGitHub {
36 owner = "scikit-rf";
37 repo = "scikit-rf";
38 tag = "v${version}";
39 hash = "sha256-wQOphwG5/4Bfa+re3S0d7lS4CJlKRjrRqnFZKaTG70M=";
40 };
41
42 build-system = [ setuptools ];
43
44 dependencies = [
45 numpy
46 scipy
47 pandas
48 ];
49
50 optional-dependencies = {
51 plot = [ matplotlib ];
52 xlsx = [ openpyxl ];
53 netw = [ networkx ];
54 visa = [ pyvisa ];
55 docs = [
56 ipython
57 ipykernel
58 ipywidgets
59 jupyter-client
60 sphinx-rtd-theme
61 sphinx
62 nbsphinx
63 openpyxl
64 nbval
65 ];
66 };
67
68 env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { MPLBACKEND = "Agg"; };
69
70 nativeCheckInputs = [
71 pytest-mock
72 matplotlib
73 pyvisa
74 openpyxl
75 networkx
76 pytestCheckHook
77 pytest-cov-stub
78 ];
79
80 # test_calibration.py generates a divide by zero error on darwin
81 # and fails on Linux after updates of dependenceis
82 # https://github.com/scikit-rf/scikit-rf/issues/972
83 disabledTestPaths = [
84 "skrf/calibration/tests/test_calibration.py"
85 ];
86
87 pythonImportsCheck = [ "skrf" ];
88
89 meta = with lib; {
90 description = "Python library for RF/Microwave engineering";
91 homepage = "https://scikit-rf.org/";
92 changelog = "https://github.com/scikit-rf/scikit-rf/releases/tag/${src.tag}";
93 license = licenses.bsd3;
94 maintainers = with maintainers; [ lugarun ];
95 };
96}