Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sasview: init at 4.1.2 #36852

Merged
merged 9 commits into from Apr 9, 2018
Merged

sasview: init at 4.1.2 #36852

merged 9 commits into from Apr 9, 2018

Conversation

rprospero
Copy link
Contributor

Motivation for this change

Sasview is a data fitting and analysis package for small angle scattering data.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

This package is a required dependency of SasView, which will be added
in a later commit.
This package is used by Sasview, which will be added in a later commit.
This package is required by SasView, which will be added in a later commit.
Sasmodels provides a library of small angle scattering calculations
that are needed by Sasview, which will be added in my next commit.
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.
Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Libraries that are in python-packages.nix should be used. If those versions are not compatible, then they can be overridden.

The licenses variable was being required by sasmoels, but licenses was
already a child of the lib parameter and was redundant.
xhtml2pdf now uses the main package html5lib with just an override to
pull the correct version number.
@rprospero
Copy link
Contributor Author

I'm now using html5lib from python-packages and merely overriding the version. This has also allowed me to move xhtml2pdf into the python-packages.nix, instead of making it part of sasview.

I've also done just a bit of cleanup as I was manually importing licenses into a couple of the packages for no good reason.

{lib, fetchgit, gcc, python}:

python.pkgs.buildPythonApplication rec {
name = "sasview-${version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name attribute is added by buildPython* and should therefore be removed. Instead use pname for just the name.

};

patches = [./pyparsing-fix.patch ./local_config.patch];
sandbox = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sandbox?

{ stdenv, buildPythonPackage, fetchPypi, six}:

buildPythonPackage rec {
name = "${pname}-${version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name attribute is added by buildPython* and should therefore be removed.

{lib, fetchgit, buildPythonPackage, pytest, numpy, scipy, matplotlib, docutils}:

buildPythonPackage rec {
name = "sasmodels-${version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name attribute is added by buildPython* and should therefore be removed.

name = "sasmodels-${version}";
version = "0.96";

propagatedBuildInputs = [docutils matplotlib numpy pytest scipy];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test dependencies should not be propagated


let
#xhtml2pdf specifically requires version "1.0b10" of html5lib
html5 = html5lib.overrideAttrs( oldAttrs: rec{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We permit only a single version within python-packages.nix, so no overriding here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering sasview is the only consumer of this package, I suggest moving the expression there.

@@ -12276,6 +12278,26 @@ in {
};
};

periodictable = buildPythonPackage rec{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are moving Python expressions out of pkgs/top-level/python-packages.nix into pkgs/development/python-modules/<module>/default.nix.

Please move the expression there, and call it from pkgs/top-level/python-packages.nix using callPackage ../development/python-modules/<package> { };.

@@ -12276,6 +12278,26 @@ in {
};
};

periodictable = buildPythonPackage rec{
name = "${pname}-${version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name attribute is added by buildPython* and should therefore be removed.

@@ -17329,6 +17353,29 @@ in {
};
};

unittest-xml-reporting = buildPythonPackage rec {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are moving Python expressions out of pkgs/top-level/python-packages.nix into pkgs/development/python-modules/<module>/default.nix.

Please move the expression there, and call it from pkgs/top-level/python-packages.nix using callPackage ../development/python-modules/<package> { };.

@@ -17329,6 +17353,29 @@ in {
};
};

unittest-xml-reporting = buildPythonPackage rec {
name = "${pname}-${version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name attribute is added by buildPython* and should therefore be removed.

@rprospero
Copy link
Contributor Author

I've made your suggested changes. Thank you for your patience with this. I probably should have chosen a less finicky package for my first submission.

@dotlambda
Copy link
Member

@matthewbauer This one created a conflict. I manually merged master into staging right now.

@matthewbauer
Copy link
Member

Ok thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants