Loading pkgs/development/python-modules/pymupdf/conftest-dont-pip-install.patch 0 → 100644 +12 −0 Original line number Diff line number Diff line diff --git a/tests/conftest.py b/tests/conftest.py index 8b9bd31b..472f57b8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -29,7 +29,6 @@ def install_required_packages(): print(f'{__file__}:install_required_packages)(): Running: {command}', flush=1) subprocess.run(command, shell=1, check=1) -install_required_packages() # Need to import pymupdf only after we've installed pymupdf-fonts above, # because pymupdf imports pymupdf_fonts, and copes with import failure. pkgs/development/python-modules/pymupdf/default.nix +23 −13 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ lib, stdenv, buildPythonPackage, pythonOlder, fetchFromGitHub, python, toPythonModule, Loading Loading @@ -45,31 +44,45 @@ let in buildPythonPackage rec { pname = "pymupdf"; version = "1.26.4"; version = "1.26.6"; pyproject = true; disabled = pythonOlder "3.9"; src = fetchFromGitHub { owner = "pymupdf"; repo = "PyMuPDF"; tag = version; hash = "sha256-bzyScV7vznuBQNP8nTjHL2exIs/rVmJBH+soyuAwIGI="; hash = "sha256-CYDgMhsOqqm9AscJxVcjU72P63gpJafj+2cj03RFGaw="; }; patches = [ # `conftest.py` tries to run `pip install` to install test dependencies. ./conftest-dont-pip-install.patch ]; # swig is not wrapped as Python package postPatch = '' substituteInPlace setup.py \ --replace-fail "ret.append('swig')" "pass" \ --replace-fail "ret.append('swig==4.3.1')" "pass" ''; nativeBuildInputs = [ # `build_extension` passes arguments to `$LD` that are meant for `c++`. # When `LD` is not set, `build_extension` falls back to using `c++` in `PATH`. # See https://github.com/pymupdf/PyMuPDF/blob/1.26.6/pipcl.py#L1998 for details. preConfigure = '' unset LD ''; build-system = [ libclang swig psutil setuptools ]; dependencies = [ mupdf-cxx-lib ]; buildInputs = [ freetype harfbuzz Loading @@ -79,8 +92,6 @@ buildPythonPackage rec { gumbo ]; propagatedBuildInputs = [ mupdf-cxx-lib ]; env = { # force using system MuPDF (must be defined in environment and empty) PYMUPDF_SETUP_MUPDF_BUILD = ""; Loading @@ -100,11 +111,9 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; checkInputs = [ fonttools pillow psutil pymupdf-fonts ]; Loading @@ -123,6 +132,7 @@ buildPythonPackage rec { "test_4457" "test_4445" "test_4533" "test_4702" # Not a git repository, so git ls-files fails "test_open2" ]; Loading Loading
pkgs/development/python-modules/pymupdf/conftest-dont-pip-install.patch 0 → 100644 +12 −0 Original line number Diff line number Diff line diff --git a/tests/conftest.py b/tests/conftest.py index 8b9bd31b..472f57b8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -29,7 +29,6 @@ def install_required_packages(): print(f'{__file__}:install_required_packages)(): Running: {command}', flush=1) subprocess.run(command, shell=1, check=1) -install_required_packages() # Need to import pymupdf only after we've installed pymupdf-fonts above, # because pymupdf imports pymupdf_fonts, and copes with import failure.
pkgs/development/python-modules/pymupdf/default.nix +23 −13 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ lib, stdenv, buildPythonPackage, pythonOlder, fetchFromGitHub, python, toPythonModule, Loading Loading @@ -45,31 +44,45 @@ let in buildPythonPackage rec { pname = "pymupdf"; version = "1.26.4"; version = "1.26.6"; pyproject = true; disabled = pythonOlder "3.9"; src = fetchFromGitHub { owner = "pymupdf"; repo = "PyMuPDF"; tag = version; hash = "sha256-bzyScV7vznuBQNP8nTjHL2exIs/rVmJBH+soyuAwIGI="; hash = "sha256-CYDgMhsOqqm9AscJxVcjU72P63gpJafj+2cj03RFGaw="; }; patches = [ # `conftest.py` tries to run `pip install` to install test dependencies. ./conftest-dont-pip-install.patch ]; # swig is not wrapped as Python package postPatch = '' substituteInPlace setup.py \ --replace-fail "ret.append('swig')" "pass" \ --replace-fail "ret.append('swig==4.3.1')" "pass" ''; nativeBuildInputs = [ # `build_extension` passes arguments to `$LD` that are meant for `c++`. # When `LD` is not set, `build_extension` falls back to using `c++` in `PATH`. # See https://github.com/pymupdf/PyMuPDF/blob/1.26.6/pipcl.py#L1998 for details. preConfigure = '' unset LD ''; build-system = [ libclang swig psutil setuptools ]; dependencies = [ mupdf-cxx-lib ]; buildInputs = [ freetype harfbuzz Loading @@ -79,8 +92,6 @@ buildPythonPackage rec { gumbo ]; propagatedBuildInputs = [ mupdf-cxx-lib ]; env = { # force using system MuPDF (must be defined in environment and empty) PYMUPDF_SETUP_MUPDF_BUILD = ""; Loading @@ -100,11 +111,9 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; checkInputs = [ fonttools pillow psutil pymupdf-fonts ]; Loading @@ -123,6 +132,7 @@ buildPythonPackage rec { "test_4457" "test_4445" "test_4533" "test_4702" # Not a git repository, so git ls-files fails "test_open2" ]; Loading