Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos, remaining code qa and typing issues resulting in breaking changes #178

Merged
merged 5 commits into from
Jul 30, 2024

Conversation

benoit74
Copy link
Collaborator

@benoit74 benoit74 commented Jul 10, 2024

Fix #131

It's time for this big overhaul of the codebase, it was too complex to include SVG support without proper typing in the "image" module.

Some remarks:

  • I also included the move to use IO[bytes] instead of io.BytesIO when possible since it is more generic
  • Regarding remainings N803, I decided it was preferable to stick to tag name and to stdlib getLogger name
  • In the same philosophy, there is one remaining FBT001 in creator.config_indexing to match argument orders of the libzim creator
  • Regarding video.encoding.reencode, I just fixed to return type since it was way more straightforward, including in term of usage. Returning tuple[bool, subprocess.CompletedProcess[str]] | bool seems preferable for the type checker rather than tuple[bool, subprocess.CompletedProcess[str] | None] (it looks like type checker prefer clearly to have two potentials real types rather than optionals)
  • NEW: Revisit creator methods manipulating metadata to accept only str | bytes after conversion (and add new explicit conversion method)

@benoit74 benoit74 self-assigned this Jul 10, 2024
Copy link

codecov bot commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (1eddabc) to head (dc57e64).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #178   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           32        32           
  Lines         1452      1475   +23     
  Branches       251       256    +5     
=========================================
+ Hits          1452      1475   +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benoit74 benoit74 force-pushed the v4_breaking_changes branch 4 times, most recently from ff5ce7d to 90d3eac Compare July 10, 2024 09:59
@benoit74 benoit74 marked this pull request as ready for review July 10, 2024 10:07
@benoit74 benoit74 requested a review from rgaudin July 10, 2024 10:07
@benoit74 benoit74 force-pushed the v4_breaking_changes branch from 90d3eac to 63bc653 Compare July 11, 2024 07:52
Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
I only have a few questions and suggestions but it's already OK IMO

CHANGELOG.md Show resolved Hide resolved
src/zimscraperlib/image/optimization.py Show resolved Hide resolved
src/zimscraperlib/image/probing.py Outdated Show resolved Hide resolved
src/zimscraperlib/image/transformation.py Outdated Show resolved Hide resolved
src/zimscraperlib/logging.py Show resolved Hide resolved
src/zimscraperlib/types.py Show resolved Hide resolved
src/zimscraperlib/zim/creator.py Outdated Show resolved Hide resolved
src/zimscraperlib/types.py Outdated Show resolved Hide resolved
src/zimscraperlib/zim/creator.py Outdated Show resolved Hide resolved
src/zimscraperlib/zim/filesystem.py Outdated Show resolved Hide resolved
@benoit74 benoit74 requested a review from rgaudin July 30, 2024 08:05
Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

src/zimscraperlib/zim/creator.py Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@benoit74 benoit74 force-pushed the v4_breaking_changes branch from 75eed4e to 2d2c547 Compare July 30, 2024 09:30
@benoit74 benoit74 merged commit fff2c10 into main Jul 30, 2024
2 of 8 checks passed
@benoit74 benoit74 deleted the v4_breaking_changes branch July 30, 2024 09:32
benoit74 added a commit that referenced this pull request Jul 30, 2024
benoit74 added a commit that referenced this pull request Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix remaining code qa and typing issues resulting in breaking changes
2 participants