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

Use newest Pillow methods if 9.2.0 is installed #21

Merged
merged 8 commits into from
Jul 3, 2023
Merged

Conversation

vertyco
Copy link
Contributor

@vertyco vertyco commented Sep 27, 2022

DeprecationWarning: LANCZOS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead.
Although it is not typehinted yet, Image.Resampling.LANCZOS needs to be used instead of Image.LANCZOS to avoid warning logs.

if pillow 9.2.0 or greater installed, use getlength, otherwise use getsize

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Sep 27, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 2.02%.

Quality metrics Before After Change
Complexity 7.80 ⭐ 8.96 🙂 1.16 👎
Method Length 75.00 🙂 77.12 🙂 2.12 👎
Working memory 11.44 😞 11.87 😞 0.43 👎
Quality 60.62% 🙂 58.60% 🙂 -2.02% 👎
Other metrics Before After Change
Lines 422 432 10
Changed files Quality Before Quality After Quality Change
pilmoji/core.py 58.77% 🙂 57.13% 🙂 -1.64% 👎
pilmoji/helpers.py 65.54% 🙂 62.46% 🙂 -3.08% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
pilmoji/core.py Pilmoji.text 21 😞 317 ⛔ 23 ⛔ 20.30% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
pilmoji/helpers.py getsize 11 🙂 119 🙂 15 😞 48.01% 😞 Extract out complex expressions
pilmoji/core.py Pilmoji.__init__ 4 ⭐ 130 😞 14 😞 54.57% 🙂 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@vertyco
Copy link
Contributor Author

vertyco commented Oct 4, 2022

@jay3332 any thoughts on this? i've been testing it locally with one of my projects for the past week and everything has been working

@vertyco
Copy link
Contributor Author

vertyco commented Oct 25, 2022

Any chance you could apply the hacktoberfest label to this? :)

@milena-kos
Copy link

this is now required as latest pillow drops deprecations

@annihilatorrrr
Copy link
Contributor

this is now required as latest pillow drops deprecations

yeah

@jay3332 jay3332 merged commit e866284 into jay3332:2.0 Jul 3, 2023
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.

None yet

4 participants