From f1439163adbdfea0b1294126aa9ad377b3f7fc85 Mon Sep 17 00:00:00 2001 From: geisserml Date: Mon, 2 Oct 2023 20:17:50 +0200 Subject: [PATCH] nit: code comments --- setupsrc/pypdfium2_setup/packaging_base.py | 1 - setupsrc/pypdfium2_setup/setup_base.py | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/setupsrc/pypdfium2_setup/packaging_base.py b/setupsrc/pypdfium2_setup/packaging_base.py index 61d2b9f70..1bdb1ea1b 100644 --- a/setupsrc/pypdfium2_setup/packaging_base.py +++ b/setupsrc/pypdfium2_setup/packaging_base.py @@ -118,7 +118,6 @@ def __init__(self): # Get information about the host platform (system and machine name) # For the machine name, the platform module just passes through information provided by the OS (The uname command on Unix, or an equivalent implementation on other systems like Windows), so we can determine the relevant names from Python's source code, system specs or information available online (e. g. https://en.wikipedia.org/wiki/Uname) - # There is also sysconfig.get_platform() which we used before, but its behavior did not fully match our needs (esp. on macOS) self._system_name = platform.system().lower() self._machine_name = platform.machine().lower() diff --git a/setupsrc/pypdfium2_setup/setup_base.py b/setupsrc/pypdfium2_setup/setup_base.py index 51c751616..9ebcd406b 100644 --- a/setupsrc/pypdfium2_setup/setup_base.py +++ b/setupsrc/pypdfium2_setup/setup_base.py @@ -17,6 +17,7 @@ class pypdfium_bdist (bdist_wheel): def finalize_options(self, *args, **kws): bdist_wheel.finalize_options(self, *args, **kws) + # root_is_pure: redundant, covered by BinaryDistribution below - TODO consider removal self.root_is_pure = False def get_tag(self, *args, **kws): @@ -25,15 +26,16 @@ def get_tag(self, *args, **kws): return pypdfium_bdist -# Use a custom distclass declaring we have a binary extension, to prevent modules from being nested in a purelib/ subdirectory in wheels +# Use a custom distclass declaring we have a binary extension, to prevent modules from being nested in a purelib/ subdirectory in wheels. This also sets `Root-Is-Purelib: false` in the WHEEL file. class BinaryDistribution (setuptools.Distribution): def has_ext_modules(self): return True -# NOTE handle python_requires dynamically so we could adjust it depending on which modules are included def get_setup_kws(modnames): + # NOTE Handle python_requires dynamically so we could adjust it depending on which modules are included + if set(modnames) == set(ModulesAll): moddirs = {"": "src"} else: @@ -48,6 +50,8 @@ def get_setup_kws(modnames): def mkwheel(pl_name, setup_kws): + # NOTE This will not be called for helpers-only installs + emplace_platfiles(pl_name) system = plat_to_system(pl_name) libname = LibnameForSystem[system]