Skip to content

make importlib_resources not mandatory with recent Python#1101

Closed
a-detiste wants to merge 1 commit into
pallets-eco:mainfrom
a-detiste:main
Closed

make importlib_resources not mandatory with recent Python#1101
a-detiste wants to merge 1 commit into
pallets-eco:mainfrom
a-detiste:main

Conversation

@a-detiste

Copy link
Copy Markdown

importlib.resources is now in the standard library

@codecov

codecov Bot commented May 11, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 98.48%. Comparing base (60e4c44) to head (4529a50).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
flask_security/babel.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1101      +/-   ##
==========================================
- Coverage   98.52%   98.48%   -0.04%     
==========================================
  Files          40       40              
  Lines        5012     5015       +3     
==========================================
+ Hits         4938     4939       +1     
- Misses         74       76       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jwag956

jwag956 commented May 15, 2025

Copy link
Copy Markdown
Collaborator

It looks to me that in fact starting in 3.9 we could always replace importlib_resources??

Note that in your PR - the new code wasn't actually tested since maybe some other package also required importlib_resources?

@a-detiste

Copy link
Copy Markdown
Author

Hi... I'm removing mandatory usage of these old backport everywhere https://wiki.debian.org/Python/Backports

importlib_resources was only seldomly used, it's already almost gone

@a-detiste

Copy link
Copy Markdown
Author

maybe some other package also required importlib_resources?

That would be a bug in the other package.

@jwag956

jwag956 commented May 18, 2025

Copy link
Copy Markdown
Collaborator

I think a better way would be to make using the stdlib the default - and if that fails - fall back. That would actually test that the stdlib works for our use-case.
A quick look seems to imply that we shouldn't need import_resources module at all (since minimum python version is 3.9).

@a-detiste

Copy link
Copy Markdown
Author

@jwag956

Hi, it's the pinning of importlib_resources>=5.10.0; that bothers me.

If I read the translation table that maps to Py3.12
https://pypi.org/project/importlib-resources/

If >= 5.10.0 is not truly needed that makes the whole thing simpler.

@jwag956

jwag956 commented Jul 4, 2025

Copy link
Copy Markdown
Collaborator

Thanks for the additional comments - I am going to try to remove it altogether- especially once support for 3.9 is removed

@jwag956

jwag956 commented Jul 6, 2025

Copy link
Copy Markdown
Collaborator

importlib_resources was removed in #1106

@jwag956 jwag956 closed this Jul 6, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants