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.image-match: init at 1.1.2 #43723

Closed
wants to merge 1 commit into from

Conversation

CMCDragonkai
Copy link
Member

@CMCDragonkai CMCDragonkai commented Jul 18, 2018

Motivation for this change

Added image-match.

One problem with this is that image-match requires elasticsearch at below 6.0.0 according to setup.py. Since there is no elasticsearch below 6.0.0 in nixpkgs, I just ignored that dependency. I use image-match without touching the elasticsearch functionality.

I asked if they could bump up the version constraint anyway: rhsimplex/image-match#97

Furthermore the I could not use fetchPypi due to: #43721

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@CMCDragonkai CMCDragonkai requested a review from FRidh as a code owner July 18, 2018 08:04
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.

I use image-match without touching the elasticsearch functionality.

That's ok.

Meta is missing. Also, I like you to be maintainer of packages you add.

sha256 = "0vlmpidmhkpgdzw2k03x5layhijcrjpmyfd93yv2ls77ihz00ix5";
};

buildInputs = [ pytestrunner ];
Copy link
Member

Choose a reason for hiding this comment

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

checkInputs

Copy link
Member Author

Choose a reason for hiding this comment

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

The pytestrunner is part of the setup_requires, I thought that meant it was required regardless of tests.

Copy link
Member

Choose a reason for hiding this comment

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

You're correct, buildInputs it is.

Looking at their setup.py there seems to be no need for having it in setup_requires.


# ignore elasticsearch requirement due to version incompatibility
installFlags = [ "--no-deps" ];
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.

include motivation for disabling tests

@CMCDragonkai
Copy link
Member Author

Added everything.

@FRidh
Copy link
Member

FRidh commented Jul 18, 2018

@GrahamcOfBorg build pythonPackages.image-match python3Packages.image-match

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: pythonPackages.image-match, python3Packages.image-match

Partial log (click to expand)

Successfully installed image-match-1.1.2
/build/source
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/k6whvmybmf3ijnacgqbdldc56r9yakf5-python3.6-image-match-1.1.2
strip is /nix/store/90vmpr41dzsx350k5argycaf693hnl1l-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/k6whvmybmf3ijnacgqbdldc56r9yakf5-python3.6-image-match-1.1.2/lib
patching script interpreter paths in /nix/store/k6whvmybmf3ijnacgqbdldc56r9yakf5-python3.6-image-match-1.1.2
checking for references to /build in /nix/store/k6whvmybmf3ijnacgqbdldc56r9yakf5-python3.6-image-match-1.1.2...
/nix/store/4ymx0ysdvlpph3mh7zmx0p4j398q51b0-python2.7-image-match-1.1.2
/nix/store/k6whvmybmf3ijnacgqbdldc56r9yakf5-python3.6-image-match-1.1.2

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: pythonPackages.image-match, python3Packages.image-match

Partial log (click to expand)

Processing ./image_match-1.1.2-py3-none-any.whl
Installing collected packages: image-match
Successfully installed image-match-1.1.2
/private/tmp/nix-build-python3.6-image-match-1.1.2.drv-0/source
post-installation fixup
strip is /nix/store/8axizw5mf6dx7wip65nbkyrmlkhmjhc5-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/2v0s60m06qkgbm0iska585wcjrw9k6qy-python3.6-image-match-1.1.2/lib
patching script interpreter paths in /nix/store/2v0s60m06qkgbm0iska585wcjrw9k6qy-python3.6-image-match-1.1.2
/nix/store/kq70mhdmgqsqk3sq00s2bfb7idf4wbmg-python2.7-image-match-1.1.2
/nix/store/2v0s60m06qkgbm0iska585wcjrw9k6qy-python3.6-image-match-1.1.2

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: pythonPackages.image-match, python3Packages.image-match

Partial log (click to expand)

cannot build derivation '/nix/store/kz0br1c8zpdwr5xwjqkgwgnyn2hhrwl8-python3.6-partd-0.3.8.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/1kp728zwsijrmvkym64f6666bj4rv4yr-python3.6-dask-0.18.0.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/bzd05rg6kwlf6bgvk2cxs9lfi1903dx6-python3.6-scikit-image-0.12.3.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/mjqvkpwwscfzw52mwxgv2644nzh408kz-python3.6-image-match-1.1.2.drv': 1 dependencies couldn't be built
building of '/nix/store/1hg80yzbpk5md5amqsmc7sq0psxj211r-python2.7-pandas-0.23.1.drv' timed out after 3600 seconds
cannot build derivation '/nix/store/zhn8hw8xpd7ksd860srga1s15m9qwiis-python2.7-partd-0.3.8.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/9505xb5zmxp025hk6dh4fbwjrbw45gav-python2.7-dask-0.18.0.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/w6wfw7a6wr58iy4g2qzzipxirwsdqk79-python2.7-scikit-image-0.12.3.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/7vc263sqm984gy4h7plyy7z4sj3lmwjf-python2.7-image-match-1.1.2.drv': 1 dependencies couldn't be built
error: build of '/nix/store/7vc263sqm984gy4h7plyy7z4sj3lmwjf-python2.7-image-match-1.1.2.drv', '/nix/store/mjqvkpwwscfzw52mwxgv2644nzh408kz-python3.6-image-match-1.1.2.drv' failed

@CMCDragonkai
Copy link
Member Author

Fixed license issue.

@CMCDragonkai
Copy link
Member Author

@FRidh For any derivation using this package as an *input. They also have to make sure to set:

      installFlags = [ "--no-deps" ];
      doCheck = false;

On their derivation as well, since the settings for this derivation don't appear to propagate.

This is not really nice. Maybe we should have elasticsearch 5.0.0 packaged as well in nixpkgs then?

];

# ignore elasticsearch requirement due to version incompatibility
installFlags = [ "--no-deps" ];
Copy link
Member

Choose a reason for hiding this comment

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

it's better to patch setup.py / requirements.txt / whatever file to remove the specific dependency.

@CMCDragonkai
Copy link
Member Author

Good idea. Which phase would that be? And do I use sed?

@FRidh
Copy link
Member

FRidh commented Jul 19, 2018 via email

@CMCDragonkai
Copy link
Member Author

@FRidh I have done that now by removing the elasticsearch requirement from the setup.py. Tests still will fail due to the lack of elasticsearch, but at least this is more robust.

Note that I noticed that I have to actually add in the dask dependency for some reason. I wonder if it is meant to be a propagated dependency or only a buildInput?

@CMCDragonkai
Copy link
Member Author

I added dask to buildInputs instead of propagatedBuildInputs. This works, and was based on how scikitimage derivation was done.

@CMCDragonkai
Copy link
Member Author

CMCDragonkai commented Jul 20, 2018

@FRidh Can you confirm that moving dask to buildInputs is the correct idea? The package does build without it, however while other packages can use image-match without the dask dependency, they cannot install it unless they also specify dask in their buildInputs. So maybe it's better that dask should be propagated, even if it isn't used.

Basically any subsequent derivation buildPythonPackage or buildPythonApplication will fail to install the dependency since it will try to build the setup.py which will try to install dask. If they put dask in their buildInputs it will work.

However it doesn't make much sense that whenever scikitimage is installed, it only works if dask is also brought in. If this keeps happening, then scikitimage should just have dask as well.

@FRidh
Copy link
Member

FRidh commented Jul 20, 2018

I've pushed 5fba38d. See that commit and previous ones on what I did with dask.

@FRidh FRidh closed this Jul 20, 2018
@CMCDragonkai
Copy link
Member Author

I see. However that means dask is no longer needed in the package function in default.nix. I think you forgot to remove it.

@CMCDragonkai CMCDragonkai deleted the image-match branch August 8, 2018 11:33
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

3 participants