diff --git a/pkgs/applications/science/misc/sasview/default.nix b/pkgs/applications/science/misc/sasview/default.nix index d45eae1ac1f5..d0a4f74924c5 100644 --- a/pkgs/applications/science/misc/sasview/default.nix +++ b/pkgs/applications/science/misc/sasview/default.nix @@ -1,9 +1,27 @@ {lib, fetchgit, gcc, python}: +let + xhtml2pdf = import ./xhtml2pdf.nix { inherit lib; + fetchPypi = python.pkgs.fetchPypi; + buildPythonPackage = python.pkgs.buildPythonPackage; + html5lib = python.pkgs.html5lib; + httplib2 = python.pkgs.httplib2; + nose = python.pkgs.nose; + pillow = python.pkgs.pillow; + pypdf2 = python.pkgs.pypdf2; + reportlab = python.pkgs.reportlab; +}; + +in + python.pkgs.buildPythonApplication rec { - name = "sasview-${version}"; + pname = "sasview"; version = "4.1.2"; + buildInputs = with python.pkgs; [ + pytest + unittest-xml-reporting]; + propagatedBuildInputs = with python.pkgs; [ bumps gcc @@ -17,13 +35,11 @@ python.pkgs.buildPythonApplication rec { pillow pylint pyopencl - pytest reportlab sasmodels scipy six sphinx - unittest-xml-reporting wxPython xhtml2pdf]; @@ -34,7 +50,6 @@ python.pkgs.buildPythonApplication rec { }; patches = [./pyparsing-fix.patch ./local_config.patch]; - sandbox = true; meta = { homepage = https://www.sasview.org; diff --git a/pkgs/development/python-modules/xhtml2pdf/default.nix b/pkgs/applications/science/misc/sasview/xhtml2pdf.nix similarity index 96% rename from pkgs/development/python-modules/xhtml2pdf/default.nix rename to pkgs/applications/science/misc/sasview/xhtml2pdf.nix index 51b00390dc27..0b3d438843da 100644 --- a/pkgs/development/python-modules/xhtml2pdf/default.nix +++ b/pkgs/applications/science/misc/sasview/xhtml2pdf.nix @@ -12,7 +12,6 @@ let in buildPythonPackage rec { - name = "${pname}-${version}"; pname = "xhtml2pdf"; version = "0.2.1"; diff --git a/pkgs/development/python-modules/bumps/default.nix b/pkgs/development/python-modules/bumps/default.nix index f7ba5f3626c1..51d3d9e6833e 100644 --- a/pkgs/development/python-modules/bumps/default.nix +++ b/pkgs/development/python-modules/bumps/default.nix @@ -1,7 +1,6 @@ { stdenv, buildPythonPackage, fetchPypi, six}: buildPythonPackage rec { - name = "${pname}-${version}"; pname = "bumps"; version = "0.7.6"; diff --git a/pkgs/development/python-modules/periodictable/default.nix b/pkgs/development/python-modules/periodictable/default.nix new file mode 100644 index 000000000000..e77c281e2c49 --- /dev/null +++ b/pkgs/development/python-modules/periodictable/default.nix @@ -0,0 +1,20 @@ +{lib, fetchPypi, buildPythonPackage, numpy, pyparsing}: + +buildPythonPackage rec{ + pname = "periodictable"; + version = "1.5.0"; + + propagatedBuildInputs = [numpy pyparsing]; + + src = fetchPypi { + inherit pname version; + sha256 = "1cjk6aqcz41nxm4fpriz01vqdafd6g57cjk0wh1iklk5cx6c085h"; + }; + + meta = { + homepage = http://www.reflectometry.org/danse/software.html; + description = "an extensible periodic table of the elements prepopulated with data important to neutron and x-ray scattering experiments"; + license = lib.licenses.publicDomain; + maintainers = with lib.maintainers; [ rprospero ]; + }; +} diff --git a/pkgs/development/python-modules/sasmodels/default.nix b/pkgs/development/python-modules/sasmodels/default.nix index 06e9adf197a9..d33de9c2a73a 100644 --- a/pkgs/development/python-modules/sasmodels/default.nix +++ b/pkgs/development/python-modules/sasmodels/default.nix @@ -1,10 +1,11 @@ {lib, fetchgit, buildPythonPackage, pytest, numpy, scipy, matplotlib, docutils}: buildPythonPackage rec { - name = "sasmodels-${version}"; + pname = "sasmodels"; version = "0.96"; - propagatedBuildInputs = [docutils matplotlib numpy pytest scipy]; + buildInputs = [pytest]; + propagatedBuildInputs = [docutils matplotlib numpy scipy]; preCheck = ''export HOME=$(mktemp -d)''; diff --git a/pkgs/development/python-modules/unittest-xml-reporting/default.nix b/pkgs/development/python-modules/unittest-xml-reporting/default.nix new file mode 100644 index 000000000000..129ad0ded6c7 --- /dev/null +++ b/pkgs/development/python-modules/unittest-xml-reporting/default.nix @@ -0,0 +1,23 @@ +{lib, fetchPypi, buildPythonPackage, six}: + +buildPythonPackage rec { + name = "${pname}-${version}"; + pname = "unittest-xml-reporting"; + version = "2.1.1"; + + propagatedBuildInputs = [six]; + + # The tarball from Pypi doesn't actually contain the unit tests + doCheck = false; + + src = fetchPypi { + inherit pname version; + sha256 = "1jwkqx5gfphkymp3xwqvlb94ng22gpbqh36vbbnsrpk1a0mammm6"; + }; + meta = with lib; { + homepage = https://github.com/xmlrunner/unittest-xml-reporting/tree/master/; + description = "A unittest runner that can save test results to XML files"; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ rprospero ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ba9e1ab88a14..e2cd2743d523 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12278,25 +12278,7 @@ in { }; }; - periodictable = buildPythonPackage rec{ - name = "${pname}-${version}"; - pname = "periodictable"; - version = "1.5.0"; - - propagatedBuildInputs = with self; [numpy pyparsing]; - - src = fetchPypi { - inherit pname version; - sha256 = "1cjk6aqcz41nxm4fpriz01vqdafd6g57cjk0wh1iklk5cx6c085h"; - }; - - meta = { - homepage = http://www.reflectometry.org/danse/software.html; - description = "an extensible periodic table of the elements prepopulated with data important to neutron and x-ray scattering experiments"; - license = licenses.publicDomain; - maintainers = with maintainers; [ rprospero ]; - }; - }; + periodictable = callPackage ../development/python-modules/periodictable { }; pg8000 = buildPythonPackage rec { name = "pg8000-1.10.1"; @@ -17353,30 +17335,9 @@ in { }; }; - unittest-xml-reporting = buildPythonPackage rec { - name = "${pname}-${version}"; - pname = "unittest-xml-reporting"; - version = "2.1.1"; + unittest-xml-reporting = callPackage ../development/python-modules/unittest-xml-reporting { }; - propagatedBuildInputs = with self; [six]; - - # The tarball from Pypi doesn't actually contain the unit tests - doCheck = false; - - src = fetchPypi { - inherit pname version; - sha256 = "1jwkqx5gfphkymp3xwqvlb94ng22gpbqh36vbbnsrpk1a0mammm6"; - }; - meta = with stdenv.lib; { - homepage = https://github.com/xmlrunner/unittest-xml-reporting/tree/master/; - description = "A unittest runner that can save test results to XML files"; - license = licenses.bsd2; - maintainers = with maintainers; [ rprospero ]; - }; - }; - - - uritemplate_py = buildPythonPackage rec { + uritemplate_py = buildPythonPackage rec { name = "uritemplate.py-${version}"; version = "0.3.0"; @@ -17902,8 +17863,6 @@ EOF propagatedBuildInputs = with self; [ eventlib application ]; }; - xhtml2pdf = callPackage ../development/python-modules/xhtml2pdf {}; - xlib = buildPythonPackage (rec { name = "xlib-${version}"; version = "0.17";