Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update deprecated pkg_resources api in edge._ops#13513

Merged
zingo merged 1 commit into
pytorch:mainfrom
Erik-Lundell:pkg_resources
Sep 1, 2025
Merged

Update deprecated pkg_resources api in edge._ops#13513
zingo merged 1 commit into
pytorch:mainfrom
Erik-Lundell:pkg_resources

Conversation

@Erik-Lundell

@Erik-Lundell Erik-Lundell commented Aug 19, 2025

Copy link
Copy Markdown
Collaborator

pkg_resources is deprecated and set to be removed from setuptools as early as end of 2025. Since ET doesn't have an upper bound on the setuptools dependency this could be an issue. Additionally, this outputs a warning message everytime an executor_runner is built.

This change updates the pkg_resrouces api to the more modern importlib.resources

Test plan:
Build linux wheels using ci.
Download python 3.10 and wheel and install in new venv
run

from executorch.exir.dialects._ops import ops as exir_ops
from executorch.backends.apple.mps import serialization
from executorch.backends.vulkan import serialization
from executorch.backends.xnnpack import serialization
from executorch.devtools.bundled_program import serialize
from executorch.devtools.etdump import serialize
from executorch.examples.models import checkpoint
checkpoint.get_default_model_resource_dir("examples/models/llama")
from executorch.exir.serde import schema_check
from executorch.extension.flat_tensor.serialize import serialize

in a fresh python interpreter for every import
The imports should not crash (due to importlib), and should not generate the warning message that it currently does

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218

@Erik-Lundell Erik-Lundell added the partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm label Aug 19, 2025
@Erik-Lundell Erik-Lundell added ciflow/trunk release notes: none Do not include this in the release notes labels Aug 19, 2025
@pytorch-bot

pytorch-bot Bot commented Aug 19, 2025

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/13513

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 1 New Failure, 9 Unrelated Failures

As of commit 7fca037 with merge base 2a58471 (image):

NEW FAILURE - The following job has failed:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 19, 2025
@zingo zingo added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm and removed partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm labels Aug 19, 2025
@zingo

zingo commented Aug 19, 2025

Copy link
Copy Markdown
Collaborator

@digantdesai This one is not in Arm folders, so we let someone at Meta review it.

@digantdesai

Copy link
Copy Markdown
Contributor

I guess this is OK. Couple of points,

  • make sure this also works with wheels (editable or otherwise)
  • moving to importlib is OK, but I still see many uses of pkg_resources in, do you want to take a stab at those too? 🙏
  • And ofc make sure CI is green (as green as it can be w/ unrelated failures :()

@Erik-Lundell

Erik-Lundell commented Aug 20, 2025

Copy link
Copy Markdown
Collaborator Author

I guess this is OK. Couple of points,

* make sure this also works with wheels (editable or otherwise)

* moving to importlib is OK, but I still see many uses of pkg_resources in, do you want to take a stab at those too? 🙏

* And ofc make sure CI is green (as green as it can be w/ unrelated failures :()

Working on updating all occurrences. What's the best way to test that it works with wheels?

@digantdesai

Copy link
Copy Markdown
Contributor

What's the best way to test that it works with wheels?

We have a CI job https://github.com/pytorch/executorch/actions/runs/17097212094/job/48484358746 which builds wheels.

You can either do same steps locally or by manually triggering the build job on this PR and then downloading the wheel and testing locally.

@Erik-Lundell

Copy link
Copy Markdown
Collaborator Author

Testing Linux wheels here
https://github.com/pytorch/executorch/actions/runs/17266659354

@Erik-Lundell

Copy link
Copy Markdown
Collaborator Author

I have tested according to the testplan and it was ok, what do you think @digantdesai

@zingo zingo added module: arm Issues related to arm backend partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm and removed partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm labels Aug 29, 2025
@digantdesai

Copy link
Copy Markdown
Contributor

Thanks LGTM, make sure the ci is clean.

pkg_resources is deprecated and set to be removed from setuptools
as early as end of 2025. Since ET doesn't have an upper bound
on the setuptools dependency this could be an issue. Additionally,
this outputs a warning message everytime an executor_runner is built.

This change updates the pkg_resrouces api to the more modern
importlib.resources

Signed-off-by: Erik Lundell <[email protected]>
Change-Id: Id6cdc8b5e4e67e3d59cc85ec3c07ee521cc1fc69
@Erik-Lundell

Copy link
Copy Markdown
Collaborator Author

New failed macos job ran successfully here: https://github.com/pytorch/executorch/actions/runs/17371877730/job/49323743831.

@zingo zingo merged commit 8cb191e into pytorch:main Sep 1, 2025
361 of 381 checks passed
@Erik-Lundell Erik-Lundell deleted the pkg_resources branch September 10, 2025 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: arm Issues related to arm backend partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants