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
pyvips: init at 2.1.12 #98866
pyvips: init at 2.1.12 #98866
Conversation
{ buildPythonPackage, fetchPypi, python, pytestrunner, gcc, glib, cffi | ||
, python3Packages, pkgconfig, stdenv, vips, lib}: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using pythonXPackages
isn't allowed from python-modules
as this will mix interpreter versions for a given package. For example, if you were to do python37Packages.<mypkg>
, but the expression pulled from python3[8]Packages
. Python will be mis-importing several libraries, and this will likely cause issues at runtime.
Please refer to Python dependency handling on the best practices for handling dependencies within python-modules
. Namely, you should be importing each python package individually, and not refer to another python package set (E.g. python3Packages
).
If you're new to nixpkgs, you're free to view some of my videos on nixpkgs and python:
{ buildPythonPackage, fetchPypi, python, pytestrunner, gcc, glib, cffi | ||
, python3Packages, pkgconfig, stdenv, vips, lib}: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused and invalid packages
{ buildPythonPackage, fetchPypi, python, pytestrunner, gcc, glib, cffi | |
, python3Packages, pkgconfig, stdenv, vips, lib}: | |
{ buildPythonPackage, fetchPypi, pytestrunner, glib, cffi | |
, pkg-config, vips, lib}: |
@jonringer i've tried all of your suggestions and the package doesn't build anymore. My original recipe should see at compile time the pkgconfig files, now it says |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here's how I would package this:
python-packages.nix
pyvips = callPackage ../development/python-modules/pyvips {
inherit (pkgs) glib pkg-config vips;
};
pyvips/default.nix:
{ lib, buildPythonPackage, fetchPypi
, pytestrunner
, pytestCheckHook
, glib
, cffi
, pkgconfig
, pkg-config
, vips
}:
buildPythonPackage rec {
pname = "pyvips";
version = "2.1.12";
src = fetchPypi {
inherit pname version;
sha256 = "0pg0dxhxgi2m7bb5bi5wpx9hgnbi8ws1bz6w2dldbhi52pizghl4";
};
nativeBuildInputs = [
pkg-config # for pkg-config hook
pkgconfig # python package
pytestrunner
];
buildInputs = [
glib
vips
];
propagatedBuildInputs = [ cffi ];
# no tests in pypi tarball
doCheck = false;
checkInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "pyvips" ];
meta = with lib; {
description = "A python wrapper for libvips";
homepage = "https://github.com/libvips/pyvips";
license = licenses.mit;
maintainers = with maintainers; [ ccellado ];
};
}
one of my suggestions i forgot to include a closing |
Now it works and I hope its good! I'm new to the whole nix packaging thing - doing this one took me several months to complete in API mode. Thank you for the patience. |
At last: for some reason this bit won't work checkInputs = [ pytestCheckHook ]; It says : "error: undefined variable 'pytestCheckHook'" |
looks like I forgot to re-add it when i was reformatting the inputs, I adjusted the original comment |
Oh, so you have to add it explicitly. The manual says it's in the buildPythonPackage module... well that's that. Thanks again, I'll summarize the commits. |
Please follow CONTRIBUTING.md and manual#submitting-changes-making-patches and squash the fix-up commits. This can be done without
However, |
pyvips: init at 2.1.12 pyvips: init at 2.1.12 Update pkgs/development/python-modules/pyvips/default.nix Co-authored-by: Jon <jonringer@users.noreply.github.com> Update pkgs/development/python-modules/pyvips/default.nix Co-authored-by: Jon <jonringer@users.noreply.github.com> Update pkgs/development/python-modules/pyvips/default.nix Co-authored-by: Jon <jonringer@users.noreply.github.com> Update pkgs/development/python-modules/pyvips/default.nix Co-authored-by: Jon <jonringer@users.noreply.github.com> Update pkgs/development/python-modules/pyvips/default.nix Co-authored-by: Jon <jonringer@users.noreply.github.com> Update pkgs/top-level/python-packages.nix Co-authored-by: Jon <jonringer@users.noreply.github.com> Update pkgs/development/python-modules/pyvips/default.nix Co-authored-by: Jon <jonringer@users.noreply.github.com> pyvips: init at 2.1.12 Update pkgs/development/python-modules/pyvips/default.nix Co-authored-by: Jon <jonringer@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Result of nixpkgs-review pr 98866 1
3 packages built:
- python27Packages.pyvips
- python37Packages.pyvips
- python38Packages.pyvips
Motivation for this change
Add python bindings for libvips in API mode to nixpkgs rep.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)