Skip to content

Drop usage of pkg_resources#553

Closed
edgarrmondragon wants to merge 1 commit into
PyFilesystem:masterfrom
edgarrmondragon:refactor/drop-pkg_resources
Closed

Drop usage of pkg_resources#553
edgarrmondragon wants to merge 1 commit into
PyFilesystem:masterfrom
edgarrmondragon:refactor/drop-pkg_resources

Conversation

@edgarrmondragon

@edgarrmondragon edgarrmondragon commented Sep 27, 2022

Copy link
Copy Markdown

Type of changes

  • Bug fix

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @PyFilesystem/maintainers may be pedantic in the code review.

Description

Drop pkg_resources in favor of the importlib.metadata API.

Closes #356

@edgarrmondragon edgarrmondragon marked this pull request as ready for review September 28, 2022 01:25
@edgarrmondragon

Copy link
Copy Markdown
Author

@althonos the tests that fail seem to do so (rather randomly?) due to a DeprecationWarning in the Python 3.10 importlib.metadata API. There's a few options I can think of:

  • Kludgy solution that supports both the deprecated and new APIs
  • Require importlib_metadata==2.0.0 for all Python versions (even the newer ones) and use the legacy API
  • Drop support for Python 2.7 (EOL Jan 2021) and Python 3.5 (EOL Sept 2020) and require importlib_metadata>=3.6.0;<4.9.0 for Python 3.6 and 3.7.

@matrss

matrss commented Aug 24, 2023

Copy link
Copy Markdown

Is there any progress on this? The CI logs are not available anymore

@edgarrmondragon

Copy link
Copy Markdown
Author

@matrss tbh the project feels abandoned 😢

@lurch

lurch commented Sep 1, 2023

Copy link
Copy Markdown
Contributor

I occasionally review some of the PRs in this project, but I don't know anything about the code being modified here, so I won't be reviewing this one.

Drop support for Python 2.7

Yeah, see also #317

@anthrotype

Copy link
Copy Markdown

tbh the project feels abandoned 😢

oh.. @willmcgugan is it so?

@althonos

althonos commented Sep 4, 2023

Copy link
Copy Markdown
Member

@anthrotype : Well, technically @willmcgugan is not maintaining this anymore (see #422), so I would be the main maintainer, but with my PhD going on I don't have a lot of time to allocate to this, and I've been fine with the "if it's not broken don't fix it" for now. But we definitely need to sit down on a version 3 at some point because these sort of issues are piling up.

@anthrotype

Copy link
Copy Markdown

willmcgugan is not maintaining this anymore

oh, I somehow missed that, thanks for the clarification/reminder.

"if it's not broken don't fix it"

definitely makes sense. Good luck with the PhD!

@AbdealiLoKo

Copy link
Copy Markdown

@althonos would you like some help maintaining it ?
I use pyfilesystem actively and am happy to help maintain.
I was looking to fix the warnings from pyfilesystem related to pkg_resources and came across this PR

@eli-schwartz

Copy link
Copy Markdown

@althonos the tests that fail seem to do so (rather randomly?) due to a DeprecationWarning in the Python 3.10 importlib.metadata API. There's a few options I can think of:

I'm probably missing something since the CI logs are long gone...

Why would this fail at all? A DeprecationWarning should not cause CI failures since the pytest config doesn't appear to be catching it as an error. You just get:

2654 passed, 26 skipped, 1703 warnings in 38.20s

@eli-schwartz

Copy link
Copy Markdown

Either way I think the obviously correct approach is to handle a fallback to the legacy API if needed, since that means you don't have to block this PR on resolving the python2 question.

@anthrotype

Copy link
Copy Markdown

hello! what it would take to get this PR to the finish line?

@edgarrmondragon

Copy link
Copy Markdown
Author

The flaky 3.10 tests pass locally 🤔

@eli-schwartz

Copy link
Copy Markdown

That doesn't look like a flake to me -- it's running on python 3.7, not 3.10. And, as I said above:

Either way I think the obviously correct approach is to handle a fallback to the legacy API if needed, since that means you don't have to block this PR on resolving the python2 question.

But currently you're exclusively using the legacy API, which is broken.

@edgarrmondragon edgarrmondragon deleted the refactor/drop-pkg_resources branch July 10, 2024 02:52
@edgarrmondragon

Copy link
Copy Markdown
Author

I'm closing the PR since I won't be able to finish this any time soon :)

@mxmlnkn

mxmlnkn commented Sep 15, 2024

Copy link
Copy Markdown

I've been fine with the "if it's not broken don't fix it" for now.

Unfortunately, with Python 3.12, it is broken now. Installing PyFilesystem2 seems to still work, but trying to import it, I get:

Traceback (most recent call last):
  [...]
  File "squashfs-root/opt/python3.12/lib/python3.12/site-packages/fs/__init__.py", line 4, in <module>
    __import__("pkg_resources").declare_namespace(__name__)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'pkg_resources'

@eli-schwartz

Copy link
Copy Markdown

Submitted an alternative PR at #589 / #590

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.

drop or relax dependency on pkg_resources?

8 participants