Skip to content

Commit

Permalink
misc style improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mara004 committed Oct 19, 2023
1 parent 7b08870 commit fb8a560
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/build_packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion setupsrc/pypdfium2_setup/autorelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/pypdfium2/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down

0 comments on commit fb8a560

Please sign in to comment.