Skip to content

Remove pkg_resources dependency on python 3#279

Merged
StykMartin merged 1 commit intobeaker-project:python-3from
StykMartin:wip/mstyk/drop-pkg-resources
Feb 17, 2026
Merged

Remove pkg_resources dependency on python 3#279
StykMartin merged 1 commit intobeaker-project:python-3from
StykMartin:wip/mstyk/drop-pkg-resources

Conversation

@StykMartin
Copy link
Contributor

Fixes #232

@StykMartin StykMartin requested a review from Copilot February 17, 2026 16:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes direct pkg_resources usage on Python 3 by introducing a small compatibility layer around importlib.resources / importlib.metadata, and updates call sites to use it.

Changes:

  • Added bkr.common.resources module providing resource_* helpers and iter_entry_points.
  • Updated schema parsing and client plugin discovery to use the new helpers instead of pkg_resources.
  • Added unit tests covering the new resources helpers.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Common/bkr/common/test_schema.py Switches schema loading from pkg_resources.resource_stream to the new resource_stream wrapper.
Common/bkr/common/test_resources.py Adds tests for new bkr.common.resources helpers.
Common/bkr/common/resources.py Introduces importlib.resources / importlib.metadata wrappers to replace pkg_resources on Python 3.
Common/bkr/init.py Adjusts namespace package handling to avoid pkg_resources on Python 3.
Client/src/bkr/client/main.py Switches entry point discovery from pkg_resources.iter_entry_points to wrapper.
Client/src/bkr/client/commands/cmd_job_submit.py Switches schema stream loading from pkg_resources to wrapper.
Client/src/bkr/client/init.py Switches resource filename resolution from pkg_resources to wrapper.
Client/src/bkr/init.py Adjusts namespace package handling to avoid pkg_resources on Python 3.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@StykMartin StykMartin force-pushed the wip/mstyk/drop-pkg-resources branch 2 times, most recently from 53f1113 to 675b9ae Compare February 17, 2026 17:02
@StykMartin StykMartin requested a review from Copilot February 17, 2026 17:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@StykMartin StykMartin force-pushed the wip/mstyk/drop-pkg-resources branch from 675b9ae to f4cf700 Compare February 17, 2026 18:01
Fixes beaker-project#232
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@StykMartin
Copy link
Contributor Author

λ ./docker/dev.sh bkr-py3 system-list --host-filter DISK__SIZE_MIN_10G
Nothing Matches
λ ./docker/dev.sh bkr-py3 system-list --host-filter FAKE_FILTER
Pre-defined host-filter does not exist: FAKE_FILTER
λ ./docker/dev.sh bkr system-list --host-filter DISK__SIZE_MIN_10G
Nothing Matches
λ ./docker/dev.sh bkr system-list --host-filter FAKE_FILTER
Pre-defined host-filter does not exist: FAKE_FILTER

@StykMartin StykMartin merged commit 9c8ddfa into beaker-project:python-3 Feb 17, 2026
33 checks passed
@StykMartin StykMartin deleted the wip/mstyk/drop-pkg-resources branch February 17, 2026 21:01
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.

Migrate from pkg_resources to importlib.resources/importlib.metadata

1 participant