Merge pull request #169681 from SuperSandro2000/python-fixes

Python fixes
This commit is contained in:
Sandro 2022-04-24 03:54:24 +02:00 committed by GitHub
commit 6cef3cd816
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 14 deletions

View file

@ -35,7 +35,8 @@ buildPythonPackage rec {
--replace "'webdataset'," ""
'';
buildInputs = [ libjpeg pkgconfig ];
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ libjpeg ];
propagatedBuildInputs = [ opencv4 numba pandas pytorch-pfn-extras terminaltables tqdm ];
# `ffcv._libffcv*.so` cannot be loaded in the nix build environment for some

View file

@ -1,5 +1,6 @@
{ lib
, buildPythonPackage
, bash
, cmake
, fetchPypi
, isPy27
@ -43,8 +44,9 @@ buildPythonPackage rec {
postPatch = ''
chmod +x tools/protoc-gen-mypy.sh.in
patchShebangs tools/protoc-gen-mypy.sh.in tools/protoc-gen-mypy.py
patchShebangs tools/protoc-gen-mypy.py
substituteInPlace tools/protoc-gen-mypy.sh.in \
--replace "/bin/bash" "${bash}/bin/bash"
substituteInPlace setup.py \
--replace "setup_requires.append('pytest-runner')" ""
'';

View file

@ -20,16 +20,18 @@ buildPythonPackage rec {
sha256 = "1xi6df93ggkpmwckwbi356v7m32zv5qry8s45hvsps66dz438kmi";
};
buildInputs = [ capnproto cython pkgconfig ];
nativeBuildInputs = [ cython pkgconfig ];
# Tests disabled due to dependency on jinja and various other libraries.
buildInputs = [ capnproto ];
# Tests depend on schema_capnp which fails to generate
doCheck = false;
pythonImportsCheck = [ "capnp" ];
meta = with lib; {
homepage = "https://capnproto.github.io/pycapnp/";
maintainers = with maintainers; [ cstrahan lukeadams ];
license = licenses.bsd2;
homepage = "https://capnproto.github.io/pycapnp/";
};
}

View file

@ -1,23 +1,23 @@
{ buildPythonPackage, fetchPypi, pytest-runner, pytestCheckHook, glib, vips, cffi
, pkg-config, pkgconfig, lib }:
{ buildPythonPackage, fetchFromGitHub, pytestCheckHook, glib, vips, cffi
, pkgconfig, lib }:
buildPythonPackage rec {
pname = "pyvips";
version = "2.1.16";
src = fetchPypi {
inherit pname version;
sha256 = "654c03014a15f846786807a2ece6f525a8fec883d1c857742c8e37da149a81ed";
src = fetchFromGitHub {
owner = "libvips";
repo = "pyvips";
rev = "v${version}";
sha256 = "sha256-8CeQbx3f2i0lEU0wxPeUwHlUGtzOztzTOdFNjIDy8s0=";
};
nativeBuildInputs = [ pytest-runner pkgconfig pkg-config ];
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ glib vips ];
propagatedBuildInputs = [ cffi ];
# tests are not included in pypi tarball
doCheck = false;
checkInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "pyvips" ];