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

pythonPackage.ovirt-engine-sdk: init at 4.3.3 #73389

Closed
wants to merge 2 commits into from

Conversation

jficz
Copy link
Contributor

@jficz jficz commented Nov 14, 2019

Motivation for this change

Ansible ovirt_* modules require this lib

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

sha256 = "0hz7rcz7l391n8ixcwvqw3iq5bx26fk9l5c6xxymv036zm3r9pnh";
};

doCheck = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

no tests are located in the pypi tarball, please use fetchFromGitHub and pull down the source so that tests are included.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Github sources is a Java-based code generator which does not directly contain any tests other than those included in the build/generate process therefore it is safe to assume that the product (i.e. the PyPi lib) is already tested. This is also supported by the fact that what is on PyPi is actually a tagged release.

What's the point of more tests, especially when they're not directly provided by upstream in the first place?

There are many PyPi packages in nixpkgs with no tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

sure, but bumps in libxml2Python, pycurl or any of their dependencies may break this package.

The tests are to verify that the package is usable beyond a, "think so"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough. Though I have no idea how to build the package from the upstream source. This may take some time.

Copy link
Contributor

Choose a reason for hiding this comment

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

you should just need to do a:

sourceRoot = "source/sdk";

and everything else should be fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doesn't look like it, mvn package still must be somehow ran before the actual python build because some of the code in sdk/ must be first generated by that Maven build. At least that's my current level of understanding this.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, really? hmm..

pycurl
six
libxml2Python
];
Copy link
Contributor

Choose a reason for hiding this comment

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

fix python2 build

Suggested change
];
] ++ lib.optionals isPy27 [ enum34 ];

@@ -0,0 +1,37 @@
{
lib,
buildPythonPackage,
Copy link
Contributor

Choose a reason for hiding this comment

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

most common style is to have the comma at the beginning, so whole lines can be added or more removed with out affecting other lines on diffs.

Suggested change
buildPythonPackage,
, buildPythonPackage

@jonringer
Copy link
Contributor

bump, author

going to close if there's no activity in a week

@jficz
Copy link
Contributor Author

jficz commented Jan 15, 2020

Unless the testing part can be left out and PyPi can be used as upstream source (like it is in a case of some other Python packages) then you can close this PR since the knowledge necessary to pull this of using the upstream source and build process is beyond me :/

@jonringer
Copy link
Contributor

I spent some time getting this to work. 2 things stood out to me, why isn't the version just checked in? and they refer to internal modules incorrectly (E.g from ovirtsdk4 import readers -> from .readers import *)

here's the expression I wrote before I found out upstream is broken:

{ lib, buildPythonPackage,fetchFromGitHub
, pycurl
, six
, nose
, libxml2
}:

buildPythonPackage rec {
  pname = "ovirt-engine-sdk-python";
  version = "4.4.0";

  src = fetchFromGitHub {
    owner = "ovirt";
    repo = "ovirt-engine-sdk";
    rev = version;
    sha256 = "059y1wf723gk3gslb684fpsfjw76cx3lm3y71frhan1l8w4p2c88";
  };

  sourceRoot = "source/sdk";

  preBuild = ''
    echo "VERSION = '${version}'" > lib/ovirtsdk4/version.py
  '';

  propagatedBuildInputs = [
    pycurl
    six
    libxml2
  ];

  checkInputs = [ nose ];
  checkPhase = ''
    rm -r lib
    nosetests
  '';

  prePatch = ''
    substituteInPlace setup.py --replace "/usr/include/libxml2" "${lib.getDev libxml2}/include/libxml2"
    substituteInPlace lib/ovirtsdk4/__init__.py --replace "from ovirtsdk4 import readers" "from .reader import *"
  '';

  meta = with lib; {
    homepage = https://github.com/oVirt/ovirt-engine-sdk/;
    description = "The oVirt Python-SDK is a software development kit for the oVirt engine API";
    license = licenses.asl20;
    maintainers = with maintainers; [ cptMikky ];
  };
}

@jonringer
Copy link
Contributor

I made an issue upstream: oVirt/ovirt-engine-sdk#21

This is why tests are important. This package would have been unusable even if the build succeeded.

@jficz
Copy link
Contributor Author

jficz commented Jan 15, 2020

ok, so what now? We wait until upstream fixes the issue?

@jonringer
Copy link
Contributor

yep, until they do a patch release, this package isn't usable if installed in sitepackages

@stale
Copy link

stale bot commented Jul 14, 2020

Hello, I'm a bot and I thank you in the name of the community for your contributions.

Nixpkgs is a busy repository, and unfortunately sometimes PRs get left behind for too long. Nevertheless, we'd like to help committers reach the PRs that are still important. This PR has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

If this is still important to you and you'd like to remove the stale label, we ask that you leave a comment. Your comment can be as simple as "still important to me". But there's a bit more you can do:

If you received an approval by an unpriviledged maintainer and you are just waiting for a merge, you can @ mention someone with merge permissions and ask them to help. You might be able to find someone relevant by using Git blame on the relevant files, or via GitHub's web interface. You can see if someone's a member of the nixpkgs-committers team, by hovering with the mouse over their username on the web interface, or by searching them directly on the list.

If your PR wasn't reviewed at all, it might help to find someone who's perhaps a user of the package or module you are changing, or alternatively, ask once more for a review by the maintainer of the package/module this is about. If you don't know any, you can use Git blame on the relevant files, or GitHub's web interface to find someone who touched the relevant files in the past.

If your PR has had reviews and nevertheless got stale, make sure you've responded to all of the reviewer's requests / questions. Usually when PR authors show responsibility and dedication, reviewers (privileged or not) show dedication as well. If you've pushed a change, it's possible the reviewer wasn't notified about your push via email, so you can always officially request them for a review, or just @ mention them and say you've addressed their comments.

Lastly, you can always ask for help at our Discourse Forum, or more specifically, at this thread or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 14, 2020
@@ -834,6 +834,10 @@ in {

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

ovirt-engine-sdk = callPackage ../development/python-modules/ovirt-engine-sdk {
inherit (pkgs) libxml2Python;
Copy link
Contributor

Choose a reason for hiding this comment

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

this is probably not what we want, looks like libxml2Python is built with python2

  libxml2Python = let
    libxml2 = python2Packages.libxml2;
  in pkgs.buildEnv { # slightly hacky
    name = "libxml2+py-${res.libxml2.version}";
    paths = with libxml2; [ dev bin py ];
    inherit (libxml2) passthru;
    # the hook to find catalogs is hidden by buildEnv
    postBuild = ''
      mkdir "$out/nix-support"
      cp '${libxml2.dev}/nix-support/propagated-build-inputs' "$out/nix-support/"
    '';
  };

Copy link
Contributor

Choose a reason for hiding this comment

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

however, it looks like it takes the propagated build inputs from the libxml2.dev derivation, so it might be okay. Just not sure how libxml2 is used in this package

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 16, 2020
@stale
Copy link

stale bot commented Jun 6, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 6, 2021
@SuperSandro2000
Copy link
Member

Closing due to being very stale

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

4 participants