Skip to content

Conversation

@tavallaie
Copy link

@tavallaie tavallaie commented Oct 8, 2025

Fix deprecation warning by replacing pkg_resources.resource_filename with importlib.resources.files(), ensuring compatibility with future setuptools versions.
Python < 3.10 is EOL as of October 2025, so this change safely replaces pkg_resources with the standard importlib.resources.
This PR fix #10

Replace resource_filename with importlib.resources.files()
@tavallaie
Copy link
Author

@ZohaibAhmed @TediPapajorgji
knock knock, is there anybody who can review and merge the PR?

@tavallaie
Copy link
Author

@ZohaibAhmed @TediPapajorgji
knock knock, is there anybody who can check the PR?

@johnmeade
Copy link
Collaborator

Hey, sorry for the delay, and thanks for submitting! Your change almost works, you just need to move the lines around, because PerthImplicitWatermarker attempts to import PREPACKAGED_MODELS_DIR.

ie this works:

from importlib.resources import files
PREPACKAGED_MODELS_DIR = files(__name__).joinpath("pretrained")
from .perth_net_implicit.perth_watermarker import PerthImplicitWatermarker

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.

Fix pkg_resources Deprecated Warning needed

2 participants