Skip to content

Commit

Permalink
Merge pull request #169681 from SuperSandro2000/python-fixes
Browse files Browse the repository at this point in the history
Python fixes
  • Loading branch information
SuperSandro2000 authored Apr 24, 2022
2 parents 0722f32 + 646b9a7 commit 6cef3cd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
3 changes: 2 additions & 1 deletion pkgs/development/python-modules/ffcv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/python-modules/onnx/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ lib
, buildPythonPackage
, bash
, cmake
, fetchPypi
, isPy27
Expand Down Expand Up @@ -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')" ""
'';
Expand Down
8 changes: 5 additions & 3 deletions pkgs/development/python-modules/pycapnp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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/";
};
}
16 changes: 8 additions & 8 deletions pkgs/development/python-modules/pyvips/default.nix
Original file line number Diff line number Diff line change
@@ -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" ];
Expand Down

0 comments on commit 6cef3cd

Please sign in to comment.