From e1edb55792c6c63836402249596becd4469190a0 Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Fri, 9 Mar 2018 11:53:12 +0000 Subject: [PATCH 1/9] pythonPackages.periodictable: init at 1.5.0 This package is a required dependency of SasView, which will be added in a later commit. --- maintainers/maintainer-list.nix | 5 +++++ pkgs/top-level/python-packages.nix | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 134ec56788e..de7b638fe24 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -3015,6 +3015,11 @@ github = "rongcuid"; name = "Rongcui Dong"; }; + rprospero = { + email = "rprospero+nix@gmail.com"; + github = "rprospero"; + name = "Adam Washington"; + }; rszibele = { email = "richard@szibele.com"; github = "rszibele"; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 76fbeb202dc..cc525cb1c9f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12276,6 +12276,26 @@ 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 ]; + }; + }; + pg8000 = buildPythonPackage rec { name = "pg8000-1.10.1"; From db2e6b6e9a98b7432e29d57dbd3340124a0dc9bd Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Fri, 9 Mar 2018 11:54:42 +0000 Subject: [PATCH 2/9] pythonPackages.unittest-xml-reporting: init at 2.1.1 This package is used by Sasview, which will be added in a later commit. --- pkgs/top-level/python-packages.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index cc525cb1c9f..298c8145b0e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -17349,6 +17349,29 @@ in { }; }; + unittest-xml-reporting = buildPythonPackage rec { + name = "${pname}-${version}"; + pname = "unittest-xml-reporting"; + version = "2.1.1"; + + 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 { name = "uritemplate.py-${version}"; version = "0.3.0"; From 242e37800b2968380212211af62b1c18e2ad74c2 Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Fri, 9 Mar 2018 11:57:28 +0000 Subject: [PATCH 3/9] pythonPackage.bumps: init at 0.7.6 This package is required by SasView, which will be added in a later commit. --- .../python-modules/bumps/default.nix | 25 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 pkgs/development/python-modules/bumps/default.nix diff --git a/pkgs/development/python-modules/bumps/default.nix b/pkgs/development/python-modules/bumps/default.nix new file mode 100644 index 00000000000..f7ba5f3626c --- /dev/null +++ b/pkgs/development/python-modules/bumps/default.nix @@ -0,0 +1,25 @@ +{ stdenv, buildPythonPackage, fetchPypi, six}: + +buildPythonPackage rec { + name = "${pname}-${version}"; + pname = "bumps"; + version = "0.7.6"; + + propagatedBuildInputs = [six]; + + # Bumps does not provide its own tests.py, so the test + # always fails + doCheck = false; + + src = fetchPypi { + inherit pname version; + sha256 = "1ahzw8ls9wsz2ks668s15zskyykib52fhi07mg50hp7lw9avqb5k"; + }; + + meta = with stdenv.lib; { + homepage = http://www.reflectometry.org/danse/software.html; + description = "Data fitting with bayesian uncertainty analysis"; + maintainers = with maintainers; [ rprospero ]; + license = licenses.publicDomain; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 298c8145b0e..8759680e5e7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1321,6 +1321,8 @@ in { enablePython = true; }); + bumps = callPackage ../development/python-modules/bumps {}; + buttersink = buildPythonPackage rec { name = "buttersink-0.6.8"; From 27f14b5e7d06aa89a2c6533d62257b6db75bd0c3 Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Fri, 9 Mar 2018 12:00:24 +0000 Subject: [PATCH 4/9] pythonPackages.sasmodels: init at 0.96 Sasmodels provides a library of small angle scattering calculations that are needed by Sasview, which will be added in my next commit. --- .../python-modules/sasmodels/default.nix | 23 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 ++++ 2 files changed, 27 insertions(+) create mode 100644 pkgs/development/python-modules/sasmodels/default.nix diff --git a/pkgs/development/python-modules/sasmodels/default.nix b/pkgs/development/python-modules/sasmodels/default.nix new file mode 100644 index 00000000000..1360864cf03 --- /dev/null +++ b/pkgs/development/python-modules/sasmodels/default.nix @@ -0,0 +1,23 @@ +{lib, fetchgit, licenses, buildPythonPackage, pytest, numpy, scipy, matplotlib, docutils}: + +buildPythonPackage rec { + name = "sasmodels-${version}"; + version = "0.96"; + + propagatedBuildInputs = [docutils matplotlib numpy pytest scipy]; + + preCheck = ''export HOME=$(mktemp -d)''; + + src = fetchgit { + url = "https://github.com/SasView/sasmodels.git"; + rev = "v${version}"; + sha256 = "11qaaqdc23qzb75zs48fkypksmcb332vl0pkjqr5bijxxymgm7nw"; + }; + + meta = { + description = "Library of small angle scattering models"; + homepage = http://sasview.org; + license = licenses.bsd3; + maintainers = with lib.maintainers; [ rprospero ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8759680e5e7..4c4452e04e7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15321,6 +15321,10 @@ in { sampledata = callPackage ../development/python-modules/sampledata { }; + sasmodels = callPackage ../development/python-modules/sasmodels { + inherit licenses; + }; + scapy = callPackage ../development/python-modules/scapy { }; scipy = callPackage ../development/python-modules/scipy { }; From 73ed353d271f2f49dc258aa906a7e58321d196a2 Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Fri, 9 Mar 2018 12:08:34 +0000 Subject: [PATCH 5/9] sasview: init at 4.1.2 Sasview is a data fitting and analysis package for small angle scattering data. More information can be found at https://www.sasview.org. There is some unfortunate cruft to this commit. SasView uses the xhtml2pdf python package, which has a specific version of html5lib as a dependency. This module manually loads that version into sasview. I haven't made xhtml2pdf available as its own package due to these circumstances. --- .../science/misc/sasview/default.nix | 51 +++++++++++++++++++ .../science/misc/sasview/local_config.patch | 10 ++++ .../science/misc/sasview/myHtml5.nix | 20 ++++++++ .../science/misc/sasview/pyparsing-fix.patch | 8 +++ .../science/misc/sasview/xhtml2pdf.nix | 15 ++++++ pkgs/top-level/all-packages.nix | 2 + 6 files changed, 106 insertions(+) create mode 100644 pkgs/applications/science/misc/sasview/default.nix create mode 100644 pkgs/applications/science/misc/sasview/local_config.patch create mode 100644 pkgs/applications/science/misc/sasview/myHtml5.nix create mode 100644 pkgs/applications/science/misc/sasview/pyparsing-fix.patch create mode 100644 pkgs/applications/science/misc/sasview/xhtml2pdf.nix diff --git a/pkgs/applications/science/misc/sasview/default.nix b/pkgs/applications/science/misc/sasview/default.nix new file mode 100644 index 00000000000..45bdeef92bc --- /dev/null +++ b/pkgs/applications/science/misc/sasview/default.nix @@ -0,0 +1,51 @@ +{lib, fetchgit, gcc, python}: + +let + html5 = import ./myHtml5.nix {inherit python;}; + xhtml2pdf = import ./xhtml2pdf.nix {inherit python html5;}; +in + +python.pkgs.buildPythonApplication rec { + name = "sasview-${version}"; + version = "4.1.2"; + + propagatedBuildInputs = with python.pkgs; [ + bumps + gcc + h5py + html5 + libxslt + lxml + matplotlib + numpy + pyparsing + periodictable + pillow + pylint + pyopencl + pytest + reportlab + sasmodels + scipy + six + sphinx + unittest-xml-reporting + wxPython + xhtml2pdf]; + + src = fetchgit { + url = "https://github.com/SasView/sasview.git"; + rev = "v${version}"; + sha256 ="05la54wwzzlkhmj8vkr0bvzagyib6z6mgwqbddzjs5y1wd48vpcx"; + }; + + patches = [./pyparsing-fix.patch ./local_config.patch]; + sandbox = true; + + meta = { + homepage = https://www.sasview.org; + description = "Fitting and data analysis for small angle scattering data"; + maintainers = with lib.maintainers; [ rprospero ]; + license = lib.licenses.bsd3; + }; +} diff --git a/pkgs/applications/science/misc/sasview/local_config.patch b/pkgs/applications/science/misc/sasview/local_config.patch new file mode 100644 index 00000000000..91972a913bc --- /dev/null +++ b/pkgs/applications/science/misc/sasview/local_config.patch @@ -0,0 +1,10 @@ +--- a/src/sas/_config.py ++++ b/src/sas/_config.py +@@ -70,2 +70,2 @@ +- logger.critical("Error loading %s: %s", path, exc) +- sys.exit() ++ import sas.sasview.local_config ++ return sas.sasview.local_config +-- +2.15.0 + diff --git a/pkgs/applications/science/misc/sasview/myHtml5.nix b/pkgs/applications/science/misc/sasview/myHtml5.nix new file mode 100644 index 00000000000..17e6a6d52e2 --- /dev/null +++ b/pkgs/applications/science/misc/sasview/myHtml5.nix @@ -0,0 +1,20 @@ +{python}: + +python.pkgs.buildPythonPackage (rec{ + buildInputs = with python.pkgs; [ flake8 pytest pytest-expect mock ]; + propagatedBuildInputs = with python.pkgs; [ + six webencodings + ]; + + checkPhase = '' + py.test + ''; + pname = "html5lib"; + name = "html5lib-${version}"; + version = "1.0b10"; + src = python.pkgs.fetchPypi { + pname = "html5lib"; + inherit version; + sha256 = "1yd068a5c00wd0ajq0hqimv7fd82lhrw0w3s01vbhy9bbd6xapqd"; + }; +}) diff --git a/pkgs/applications/science/misc/sasview/pyparsing-fix.patch b/pkgs/applications/science/misc/sasview/pyparsing-fix.patch new file mode 100644 index 00000000000..7729292cb34 --- /dev/null +++ b/pkgs/applications/science/misc/sasview/pyparsing-fix.patch @@ -0,0 +1,8 @@ +--- a/setup.py ++++ b/setup.py +@@ -5,1 +5,1 @@ +- 'bumps>=0.7.5.9', 'periodictable>=1.5.0', 'pyparsing<2.0.0', ++ 'bumps>=0.7.5.9', 'periodictable>=1.5.0', +-- +2.15.0 + diff --git a/pkgs/applications/science/misc/sasview/xhtml2pdf.nix b/pkgs/applications/science/misc/sasview/xhtml2pdf.nix new file mode 100644 index 00000000000..9f2b8e01a27 --- /dev/null +++ b/pkgs/applications/science/misc/sasview/xhtml2pdf.nix @@ -0,0 +1,15 @@ +{python, html5}: + +python.pkgs.buildPythonPackage rec { + name = "${pname}-${version}"; + pname = "xhtml2pdf"; + version = "0.2.1"; + + buildInputs = [html5]; + propagatedBuildInputs = with python.pkgs; [httplib2 pillow pypdf2 reportlab html5]; + + src = python.pkgs.fetchPypi { + inherit pname version; + sha256 = "1n9r8zdk9gc2x539fq60bhszmd421ipj8g78zmsn3njvma1az9k1"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b83424eabba..ce5fb12c38f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4633,6 +4633,8 @@ with pkgs; samplicator = callPackage ../tools/networking/samplicator { }; + sasview = callPackage ../applications/science/misc/sasview {}; + scanbd = callPackage ../tools/graphics/scanbd { }; screen = callPackage ../tools/misc/screen { From 609374523c7dbb6c4a6d6834ade1a8ff90b1c354 Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Wed, 21 Mar 2018 13:32:30 +0000 Subject: [PATCH 6/9] Remove explicit licenses import from python package sasmodels The licenses variable was being required by sasmoels, but licenses was already a child of the lib parameter and was redundant. --- pkgs/development/python-modules/sasmodels/default.nix | 4 ++-- pkgs/top-level/python-packages.nix | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/sasmodels/default.nix b/pkgs/development/python-modules/sasmodels/default.nix index 1360864cf03..06e9adf197a 100644 --- a/pkgs/development/python-modules/sasmodels/default.nix +++ b/pkgs/development/python-modules/sasmodels/default.nix @@ -1,4 +1,4 @@ -{lib, fetchgit, licenses, buildPythonPackage, pytest, numpy, scipy, matplotlib, docutils}: +{lib, fetchgit, buildPythonPackage, pytest, numpy, scipy, matplotlib, docutils}: buildPythonPackage rec { name = "sasmodels-${version}"; @@ -17,7 +17,7 @@ buildPythonPackage rec { meta = { description = "Library of small angle scattering models"; homepage = http://sasview.org; - license = licenses.bsd3; + license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ rprospero ]; }; } diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4c4452e04e7..4acbdade3b6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15321,9 +15321,7 @@ in { sampledata = callPackage ../development/python-modules/sampledata { }; - sasmodels = callPackage ../development/python-modules/sasmodels { - inherit licenses; - }; + sasmodels = callPackage ../development/python-modules/sasmodels { }; scapy = callPackage ../development/python-modules/scapy { }; From 01c1385deca520ead374afcbc7591aed9e4e6ce8 Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Wed, 21 Mar 2018 13:46:17 +0000 Subject: [PATCH 7/9] Make xhtml2pdf its own package in python-packages xhtml2pdf now uses the main package html5lib with just an override to pull the correct version number. --- .../science/misc/sasview/default.nix | 6 ---- .../science/misc/sasview/myHtml5.nix | 20 ----------- .../science/misc/sasview/xhtml2pdf.nix | 15 --------- .../python-modules/xhtml2pdf/default.nix | 33 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 5 files changed, 35 insertions(+), 41 deletions(-) delete mode 100644 pkgs/applications/science/misc/sasview/myHtml5.nix delete mode 100644 pkgs/applications/science/misc/sasview/xhtml2pdf.nix create mode 100644 pkgs/development/python-modules/xhtml2pdf/default.nix diff --git a/pkgs/applications/science/misc/sasview/default.nix b/pkgs/applications/science/misc/sasview/default.nix index 45bdeef92bc..d45eae1ac1f 100644 --- a/pkgs/applications/science/misc/sasview/default.nix +++ b/pkgs/applications/science/misc/sasview/default.nix @@ -1,10 +1,5 @@ {lib, fetchgit, gcc, python}: -let - html5 = import ./myHtml5.nix {inherit python;}; - xhtml2pdf = import ./xhtml2pdf.nix {inherit python html5;}; -in - python.pkgs.buildPythonApplication rec { name = "sasview-${version}"; version = "4.1.2"; @@ -13,7 +8,6 @@ python.pkgs.buildPythonApplication rec { bumps gcc h5py - html5 libxslt lxml matplotlib diff --git a/pkgs/applications/science/misc/sasview/myHtml5.nix b/pkgs/applications/science/misc/sasview/myHtml5.nix deleted file mode 100644 index 17e6a6d52e2..00000000000 --- a/pkgs/applications/science/misc/sasview/myHtml5.nix +++ /dev/null @@ -1,20 +0,0 @@ -{python}: - -python.pkgs.buildPythonPackage (rec{ - buildInputs = with python.pkgs; [ flake8 pytest pytest-expect mock ]; - propagatedBuildInputs = with python.pkgs; [ - six webencodings - ]; - - checkPhase = '' - py.test - ''; - pname = "html5lib"; - name = "html5lib-${version}"; - version = "1.0b10"; - src = python.pkgs.fetchPypi { - pname = "html5lib"; - inherit version; - sha256 = "1yd068a5c00wd0ajq0hqimv7fd82lhrw0w3s01vbhy9bbd6xapqd"; - }; -}) diff --git a/pkgs/applications/science/misc/sasview/xhtml2pdf.nix b/pkgs/applications/science/misc/sasview/xhtml2pdf.nix deleted file mode 100644 index 9f2b8e01a27..00000000000 --- a/pkgs/applications/science/misc/sasview/xhtml2pdf.nix +++ /dev/null @@ -1,15 +0,0 @@ -{python, html5}: - -python.pkgs.buildPythonPackage rec { - name = "${pname}-${version}"; - pname = "xhtml2pdf"; - version = "0.2.1"; - - buildInputs = [html5]; - propagatedBuildInputs = with python.pkgs; [httplib2 pillow pypdf2 reportlab html5]; - - src = python.pkgs.fetchPypi { - inherit pname version; - sha256 = "1n9r8zdk9gc2x539fq60bhszmd421ipj8g78zmsn3njvma1az9k1"; - }; -} diff --git a/pkgs/development/python-modules/xhtml2pdf/default.nix b/pkgs/development/python-modules/xhtml2pdf/default.nix new file mode 100644 index 00000000000..2d1112fe02e --- /dev/null +++ b/pkgs/development/python-modules/xhtml2pdf/default.nix @@ -0,0 +1,33 @@ +{lib, fetchPypi, buildPythonPackage, html5lib, httplib2, nose, pillow, pypdf2, reportlab}: + +let + #xhtml2pdf specifically requires version "1.0b10" of html5lib + html5 = html5lib.overrideAttrs( oldAttrs: rec{ + version = "1.0b10"; + src = oldAttrs.src.override { + inherit version; + sha256 = "1yd068a5c00wd0ajq0hqimv7fd82lhrw0w3s01vbhy9bbd6xapqd"; + }; + }); +in + +buildPythonPackage rec { + name = "${pname}-${version}"; + pname = "xhtml2pdf"; + version = "0.2.1"; + + buildInputs = [html5]; + propagatedBuildInputs = [httplib2 nose pillow pypdf2 reportlab html5]; + + src = fetchPypi { + inherit pname version; + sha256 = "1n9r8zdk9gc2x539fq60bhszmd421ipj8g78zmsn3njvma1az9k1"; + }; + + meta = { + description = "A pdf converter for the ReportLab Toolkit"; + homepage = https://github.com/xhtml2pdf/xhtml2pdf; + license = lib.licenses.asl2; + maintainers = with lib.maintainers; [ rprospero ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4acbdade3b6..ba9e1ab88a1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -17902,6 +17902,8 @@ EOF propagatedBuildInputs = with self; [ eventlib application ]; }; + xhtml2pdf = callPackage ../development/python-modules/xhtml2pdf {}; + xlib = buildPythonPackage (rec { name = "xlib-${version}"; version = "0.17"; From 068d792fedbfb6f14b9f7bb52179a392e6886e52 Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Wed, 21 Mar 2018 14:43:47 +0000 Subject: [PATCH 8/9] Fix typo in license for xhtml2pdf python package --- pkgs/development/python-modules/xhtml2pdf/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/xhtml2pdf/default.nix b/pkgs/development/python-modules/xhtml2pdf/default.nix index 2d1112fe02e..51b00390dc2 100644 --- a/pkgs/development/python-modules/xhtml2pdf/default.nix +++ b/pkgs/development/python-modules/xhtml2pdf/default.nix @@ -27,7 +27,7 @@ buildPythonPackage rec { meta = { description = "A pdf converter for the ReportLab Toolkit"; homepage = https://github.com/xhtml2pdf/xhtml2pdf; - license = lib.licenses.asl2; + license = lib.licenses.asl20; maintainers = with lib.maintainers; [ rprospero ]; }; } From 392def733b61855e667c7ce7a777a6bdc397ef44 Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Thu, 22 Mar 2018 17:44:27 +0000 Subject: [PATCH 9/9] Remove lint from Sasview package --- .../science/misc/sasview/default.nix | 23 +++++++-- .../science/misc/sasview/xhtml2pdf.nix} | 1 - .../python-modules/bumps/default.nix | 1 - .../python-modules/periodictable/default.nix | 20 ++++++++ .../python-modules/sasmodels/default.nix | 5 +- .../unittest-xml-reporting/default.nix | 23 +++++++++ pkgs/top-level/python-packages.nix | 47 ++----------------- 7 files changed, 68 insertions(+), 52 deletions(-) rename pkgs/{development/python-modules/xhtml2pdf/default.nix => applications/science/misc/sasview/xhtml2pdf.nix} (96%) create mode 100644 pkgs/development/python-modules/periodictable/default.nix create mode 100644 pkgs/development/python-modules/unittest-xml-reporting/default.nix diff --git a/pkgs/applications/science/misc/sasview/default.nix b/pkgs/applications/science/misc/sasview/default.nix index d45eae1ac1f..d0a4f74924c 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 51b00390dc2..0b3d438843d 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 f7ba5f3626c..51d3d9e6833 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 00000000000..e77c281e2c4 --- /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 06e9adf197a..d33de9c2a73 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 00000000000..129ad0ded6c --- /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 ba9e1ab88a1..e2cd2743d52 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";