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

pythonPackages.Pyomo: init at 5.4.3 #37372

Closed
wants to merge 2 commits into from

Conversation

ericsagnes
Copy link
Contributor

Motivation for this change

Add pyomo to nixpkgs, also add PyUtilib as a dependency.

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.

framework.
'';
license = licenses.bsdOriginal;
maintainers = with maintainers; [ ericsagnes ];
Copy link
Member

Choose a reason for hiding this comment

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

I think if you don't set platforms hydra won't build it

Copy link
Member

Choose a reason for hiding this comment

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

No need to set platforms when using buildPython*. It is set to the appropriate platforms by default.

framework.
'';
license = licenses.bsdOriginal;
maintainers = with maintainers; [ ericsagnes ];
Copy link
Member

Choose a reason for hiding this comment

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

No need to set platforms when using buildPython*. It is set to the appropriate platforms by default.

The PyUtilib project supports a collection of Python utilities, including
a well-developed component architecture and extensions to the PyUnit testing
framework.
'';
Copy link
Member

Choose a reason for hiding this comment

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

description should be a single line. There is also longDescription, which is optional however.
See https://nixos.org/nixpkgs/manual/#sec-standard-meta-attributes.


buildPythonPackage rec {
pname = "PyUtilib";
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.

no name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean?

Copy link
Member

Choose a reason for hiding this comment

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

You can leave the line out because name is automatically set to ${pname}-${version} by buildPython*.

sha256 = "17rynkkq728b7iy65m2rz9gcycipk0r8xiplfb5lvg5l27zm52gv";
};

doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because tests are failing:

writing manifest file 'PyUtilib.egg-info/SOURCES.txt'
running build_ext
error: [Errno 2] No such file or directory: 'test/config1.out'
builder for '/nix/store/sknnjb4x0fcyszrwpspzy6axjdhlmzkc-python3.6-PyUtilib-5.6.2.drv' failed with exit code 1
error: build of '/nix/store/sknnjb4x0fcyszrwpspzy6axjdhlmzkc-python3.6-PyUtilib-5.6.2.drv' failed

Copy link
Member

Choose a reason for hiding this comment

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

Then you need to set an appropriate checkPhase, something like test.pyutilib --cat=all: https://github.com/PyUtilib/pyutilib/blob/master/.travis.yml

name = "${pname}-${version}";
version = "5.6.2";

propagatedBuildInputs = [ nose six ];
Copy link
Member

Choose a reason for hiding this comment

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

nose should go into checkInputs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moving nose to checkInputs make the build fail:

Collecting nose (from PyUtilib==5.6.2)
  Could not find a version that satisfies the requirement nose (from PyUtilib==5.6.2) (from versions: )
No matching distribution found for nose (from PyUtilib==5.6.2)
builder for '/nix/store/z2b5nxy01cdns11kk8dhp1idraars3lc-python3.6-PyUtilib-5.6.2.drv' failed with exit code 1
error: build of '/nix/store/z2b5nxy01cdns11kk8dhp1idraars3lc-python3.6-PyUtilib-5.6.2.drv' failed

Copy link
Member

@dotlambda dotlambda Mar 19, 2018

Choose a reason for hiding this comment

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

Indeed, that's a mistake on their side probably: https://github.com/PyUtilib/pyutilib/blob/master/setup.py#L42
Please also note the additional requirements for Python 2. I just saw that's only for python<2.7 which isn't available in Nixpkgs. So no additional dependencies.

sha256 = "08hgpf8fs8n8zlpmv3zlcgdw6306ymq1m9ma92v3x5nqnkhqfa3j";
};

doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

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

Why?

description = ''
Pyomo is a Python-based, open-source optimization modeling language
with a diverse set of optimization capabilities.
'';
Copy link
Member

Choose a reason for hiding this comment

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

doCheck = false;

meta = with lib; {
homepage = "http://www.pyomo.org/";
Copy link
Member

Choose a reason for hiding this comment

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

no quotes

doCheck = false;

meta = with lib; {
homepage = "https://github.com/PyUtilib/pyutilib";
Copy link
Member

Choose a reason for hiding this comment

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

no quotes

pyomo = callPackage ../development/python-modules/pyomo { };

pyutilib = callPackage ../development/python-modules/pyutilib { };

pyproj = callPackage ../development/python-modules/pyproj {
Copy link
Member

Choose a reason for hiding this comment

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

pyproj definitely belongs above pyutilib. The attributes should be ordered alphabetically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right... but well python-packages.nix is a mess.
Even if pyutillib goes after pyproj, there are for example repoze_who and vobject before pyproj, and kaa-base and mmpython after pyproj.
That make it quite tricky to find the right position.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but we can still try

@dotlambda
Copy link
Member

Please prefix your commit messages with pythonPackages.

@ericsagnes
Copy link
Contributor Author

Thanks for the review, I pushed changes that should address most of the concerns.

@ericsagnes ericsagnes changed the title Pyomo: init at 5.4.3 pythonPackages.Pyomo: init at 5.4.3 Mar 20, 2018
sha256 = "08hgpf8fs8n8zlpmv3zlcgdw6306ymq1m9ma92v3x5nqnkhqfa3j";
};

# Tests try to install packages
Copy link
Member

Choose a reason for hiding this comment

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

This probably means you have to add them to checkInputs.


meta = with lib; {
homepage = https://github.com/PyUtilib/pyutilib;
description = "collection of Python utilities";
Copy link
Member

Choose a reason for hiding this comment

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

Capitalize

};

# Tests requires text files that are not included in the pypi package
doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

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

You could try to use fetchFromGitHub then, but it's up to you.

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