From 4fe64451faf5ac4848a578ff8fc5c0cdd7b08c0b Mon Sep 17 00:00:00 2001 From: geisserml Date: Thu, 19 Dec 2024 19:31:13 +0100 Subject: [PATCH] Q&D adaption to bdist_wheel relocation (fixes #326) --- docs/devel/changelog_staging.md | 1 + setup.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/devel/changelog_staging.md b/docs/devel/changelog_staging.md index 80ec391fb..c4655431c 100644 --- a/docs/devel/changelog_staging.md +++ b/docs/devel/changelog_staging.md @@ -6,6 +6,7 @@ # Changelog for next release - `PdfPage.get_objects()`: Don't register pageobjects as children, because they don't need to be closed by the caller when part of a page. This avoids excessive caching of weakrefs that are not cleaned up with the object they refer to. - Fixed another dotted filepath blunder in the `extract-images` CLI. (The `PdfImage.extract()` API is not affected this time.) +- Adapted setup code to `bdist_wheel` relocation (moved from wheel to setuptools). - Fixed installation with reference bindings (`PDFIUM_BINDINGS=reference`) by adding a missing `mkdir` call and actually including them in the sdist. (In older versions, this can be worked around by cloning the repository and creating the missing directory manually before installation.) - Fixed sourcebuild on windows by syncing patches with pdfium-binaries. - Updated test expectations: due to changes in pdfium, some numbers are now slightly different. diff --git a/setup.py b/setup.py index 743da7385..ed12dfe0f 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,10 @@ import sys from pathlib import Path import setuptools -from wheel.bdist_wheel import bdist_wheel +try: + from setuptools.command.bdist_wheel import bdist_wheel +except ImportError: + from wheel.bdist_wheel import bdist_wheel from setuptools.command.build_py import build_py as build_py_orig sys.path.insert(0, str(Path(__file__).parent / "setupsrc"))