From fb8a560724c02151869edf0e6d0da210c6f07932 Mon Sep 17 00:00:00 2001 From: geisserml Date: Thu, 19 Oct 2023 17:33:53 +0200 Subject: [PATCH] misc style improvements --- .github/workflows/build_packages.yaml | 14 ++++---------- setup.py | 4 +--- setupsrc/pypdfium2_setup/autorelease.py | 2 +- src/pypdfium2/version.py | 2 +- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build_packages.yaml b/.github/workflows/build_packages.yaml index 3ba1502f3..322c7484e 100644 --- a/.github/workflows/build_packages.yaml +++ b/.github/workflows/build_packages.yaml @@ -158,17 +158,11 @@ jobs: if: ${{ inputs.publish && !cancelled() && !contains(needs.*.result, 'failure') }} runs-on: ${{ inputs.runner }} - # `environment: release` is mandatory for our PyPI/TestPyPI upload via "trusted publishing". - # (On PyPI config time, restricting the environment is optional, but strongly encouraged. Once installed on PyPI, it must be set in the workflow. This applies here.) - # https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment - environment: release + environment: release # PyPI upload via "trusted publishing" permissions: - # `id-token: write` is mandatory for PyPI/TestPyPI upload via "trusted publishing". - id-token: write - # `contents: write` is required for the repository changes - contents: write - # `actions: write` is required for GH pages workflow-dispatch - actions: write + id-token: write # PyPI upload via "trusted publishing" + contents: write # autorelease repository changes + actions: write # GH pages workflow-dispatch steps: diff --git a/setup.py b/setup.py index 856cef495..ba3484deb 100644 --- a/setup.py +++ b/setup.py @@ -44,8 +44,6 @@ class pypdfium_build_py (build_py_orig): def run(self, *args, **kwargs): if self.editable_mode: - # TODO consider merging with data_source? - # TODO consider setting n_commits/hash to inf/editable due to high uncertainty? either here or in the receiver helpers_info = read_json(ModuleDir_Helpers/VersionFN) helpers_info["is_editable"] = True write_json(ModuleDir_Helpers/VersionFN, helpers_info) @@ -153,7 +151,7 @@ def main(): kwargs["license_files"] += LICENSES_SDIST elif pl_name == PlatTarget_System: # TODO generate bindings/version here according to some caller input? - assert (ModuleDir_Raw/BindingsFN).exists() and (ModuleDir_Raw/VersionFN).exists(), "Bindings and version currently must be prepared by caller for sys target." + assert (ModuleDir_Raw/BindingsFN).exists() and (ModuleDir_Raw/VersionFN).exists(), f"Bindings and version currently must be prepared by caller for {PlatTarget_System} target." kwargs["package_data"]["pypdfium2_raw"] = [BindingsFN, VersionFN] else: pl_name = get_pdfium(pl_name) diff --git a/setupsrc/pypdfium2_setup/autorelease.py b/setupsrc/pypdfium2_setup/autorelease.py index 24951d1ca..13142177a 100644 --- a/setupsrc/pypdfium2_setup/autorelease.py +++ b/setupsrc/pypdfium2_setup/autorelease.py @@ -215,7 +215,7 @@ def main(): if new_helpers != parsed_helpers: print( "Warning: Written and parsed helpers do not match. This should not happen in CI.\n" + - f"Symmetric difference: {set(new_helpers.items()) ^ set(parsed_helpers.items())}" + f"In: {new_helpers}\n" + f"Out: {parsed_helpers}" ) make_releasenotes(summary, record["pdfium"], new_pdfium, prev_tag, new_tag, c_updates) diff --git a/src/pypdfium2/version.py b/src/pypdfium2/version.py index c9f716de6..daf9906d0 100644 --- a/src/pypdfium2/version.py +++ b/src/pypdfium2/version.py @@ -215,7 +215,7 @@ def desc(self): The pdfium binary's origin. Possible values:\n - ``pdfium-binaries``: Compiled by bblanchon/pdfium-binaries, and bundled into pypdfium2. Chromium ciphers known. - ``sourcebuild``: Provided by the caller (commonly compiled using pypdfium2's integrated build script), and bundled into pypdfium2. Chromium ciphers unknown. - - ``sys``: Dynamically loaded from a standard system location using :func:`ctypes.util.find_library`. + - ``system``: Dynamically loaded from a standard system location using :func:`ctypes.util.find_library`. flags (tuple[str]): Tuple of pdfium feature flags. Empty for default build. (V8, XFA) for pdfium-binaries V8 build. """