Skip to content

Add functional API - #303

Merged
jaraco merged 6 commits into
python:mainfrom
encukou:functional
Mar 21, 2024
Merged

jaraco merged 6 commits into
python:mainfrom
encukou:functional

Conversation

@encukou

@encukou encukou commented Mar 21, 2024

Copy link
Copy Markdown
Member

This adds functional API, proposed for CPython here: python/cpython#116608

I tested locally using tox, which probably doesn't match the CI checks.

@encukou

encukou commented Mar 21, 2024 •

Copy link
Copy Markdown
Member Author

“Collateral” tests fail with:

importlib_resources/functional.py (62.5%): Missing lines 3,5,8,11,16,23,28,35,40,48,63,78
importlib_resources/tests/test_functional.py (98.2%): Missing lines 7,9

These are top-level statements (mostly def), and an alternate import for old Python versions. I'm not familiar with the coverage tooling, and would appreciate a hint on how to fix this. (Or feel free to push a fix directly to the PR.)

@jaraco

jaraco commented Mar 21, 2024

Copy link
Copy Markdown
Member

The diffcov tests can be ignored. I've opened #304 to track.

@jaraco
jaraco merged commit c593cd9 into python:main Mar 21, 2024

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should this module be private or should importing from importlib_resources.functional be allowed?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

(I don't recall if it was public before.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good call. Private is probably better.

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.

3 participants