Skip to content

Replace deprecated pkg_resources with importlib#393

Merged
endrebak merged 2 commits into
pyranges:masterfrom
semenko:master
Mar 6, 2025
Merged

Replace deprecated pkg_resources with importlib#393
endrebak merged 2 commits into
pyranges:masterfrom
semenko:master

Conversation

@semenko

@semenko semenko commented Jan 31, 2025

Copy link
Copy Markdown
Contributor

setuptools recently deprecated pkg_resources, and instead recommends importlib (available since Python 3.8).

Without this update, tests and packages relying on pyranges break (in part because setuptools is not declared as a dependency).

I think this approach is preferrable over #390, since pkg_resources is deprecated: https://setuptools.pypa.io/en/latest/pkg_resources.html

image

@endrebak

endrebak commented Feb 2, 2025

Copy link
Copy Markdown
Collaborator

I will likely have time to have look at your PRs the 14/02. Thanks

@endrebak

endrebak commented Feb 2, 2025

Copy link
Copy Markdown
Collaborator

It needs to pass first though :)

@semenko

semenko commented Mar 3, 2025

Copy link
Copy Markdown
Contributor Author

@endrebak Friendly ping here :) The tests won't run for me without approval from a maintainer:

image

@endrebak

endrebak commented Mar 4, 2025

Copy link
Copy Markdown
Collaborator

Thanks!

Transition to importlib.resources for file traversal and importlib for version.
@semenko

semenko commented Mar 4, 2025

Copy link
Copy Markdown
Contributor Author

Looks like the tests themselves are broken…

@endrebak

endrebak commented Mar 5, 2025

Copy link
Copy Markdown
Collaborator

I'll have a quick look.

Have you tried the new pyranges btw? https://github.com/pyranges/pyranges_1.x

It will soon get a new rust backend

@endrebak

endrebak commented Mar 5, 2025

Copy link
Copy Markdown
Collaborator

Would you bother updating the CHANGELOG and bump the version also? I'll just run the tests locally and merge squash myself afterwards

@endrebak

endrebak commented Mar 5, 2025

Copy link
Copy Markdown
Collaborator

If I make changes to your commits I'm not certain you will get credit on github

@semenko

semenko commented Mar 5, 2025

Copy link
Copy Markdown
Contributor Author

Will do! I'm excited about pyranges_1.x! Wasn't sure if/when it was launching to replace pyranges :)

For replacing deprecated pkg_resources
@endrebak endrebak merged commit 6c85a80 into pyranges:master Mar 6, 2025
@endrebak

endrebak commented Mar 6, 2025

Copy link
Copy Markdown
Collaborator

Thanks. I started a build wheels and upload packages to pypi workflow here: https://github.com/pyranges/pyranges/actions/runs/13702739555

@maclandrol

Copy link
Copy Markdown
Contributor

@endrebak @semenko there is bug here due toimportlib.metadata. See #395

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