Skip to content

Fix #571 support py 3.12#585

Merged
robnagler merged 9 commits intomasterfrom
571-py3.9
Jul 23, 2025
Merged

Fix #571 support py 3.12#585
robnagler merged 9 commits intomasterfrom
571-py3.9

Conversation

@robnagler
Copy link
Member

@robnagler robnagler requested a review from Copilot July 22, 2025 21:39
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

This PR migrates from the deprecated pkg_resources module to the modern importlib.metadata and importlib.resources APIs to support Python 3.12 compatibility. The changes replace legacy package resource handling with the standard library equivalents that are recommended for newer Python versions.

  • Replace pkg_resources.get_distribution().version with importlib.metadata.version()
  • Replace pkg_resources.resource_filename() with importlib.resources.files()
  • Update exception handling from DistributionNotFound to PackageNotFoundError

Reviewed Changes

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

Show a summary per file
File Description
tests/pkcli/projex2_data/xyzzy1.in/xyzzy1/init.py Update test data package to use importlib.metadata for version retrieval
tests/pkcli/projex2_data/private.in/private/init.py Update test data package to use importlib.metadata for version retrieval
pykern/pkresource.py Replace pkg_resources.resource_filename with importlib.resources.files for resource path resolution
pykern/pkcli/test.py Add raw string prefix to regex pattern
pykern/package_data/projex/projex/init.py.jinja Update package template to use importlib.metadata for version retrieval

@robnagler robnagler merged commit 02a7894 into master Jul 23, 2025
3 checks passed
@robnagler robnagler deleted the 571-py3.9 branch July 23, 2025 22:16
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.

Replace pkg_resources with importlib

2 participants