Skip to content

Replace deprecated pkg_resources with importlib#393

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

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

Conversation

@semenko
Copy link
Copy Markdown
Contributor

@semenko semenko commented Jan 31, 2025

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
Copy link
Copy Markdown
Collaborator

endrebak commented Feb 2, 2025

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

@endrebak
Copy link
Copy Markdown
Collaborator

endrebak commented Feb 2, 2025

It needs to pass first though :)

@semenko
Copy link
Copy Markdown
Contributor Author

semenko commented Mar 3, 2025

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

image

@endrebak
Copy link
Copy Markdown
Collaborator

endrebak commented Mar 4, 2025

Thanks!

Transition to importlib.resources for file traversal and importlib for version.
@semenko
Copy link
Copy Markdown
Contributor Author

semenko commented Mar 4, 2025

Looks like the tests themselves are broken…

@endrebak
Copy link
Copy Markdown
Collaborator

endrebak commented Mar 5, 2025

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
Copy link
Copy Markdown
Collaborator

endrebak commented Mar 5, 2025

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

@endrebak
Copy link
Copy Markdown
Collaborator

endrebak commented Mar 5, 2025

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

@semenko
Copy link
Copy Markdown
Contributor Author

semenko commented Mar 5, 2025

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
Copy link
Copy Markdown
Collaborator

endrebak commented Mar 6, 2025

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