Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolkit selection is broken on Python 3.9 #998

Closed
mdickinson opened this issue Jul 18, 2021 · 1 comment · Fixed by #1000
Closed

Toolkit selection is broken on Python 3.9 #998

mdickinson opened this issue Jul 18, 2021 · 1 comment · Fixed by #1000

Comments

@mdickinson
Copy link
Member

Since #991, toolkit selection is broken on Python 3.9. Running the test suite shows:

(pyface) mdickinson@mirzakhani pyface % python -V
Python 3.9.6
(pyface) mdickinson@mirzakhani pyface % python -m unittest
E
======================================================================
ERROR: pyface (unittest.loader._FailedTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/mdickinson/Enthought/ETS/pyface/pyface/__init__.py", line 61, in load_tests
    from pyface.toolkit import toolkit_object  # noqa: F401
  File "/Users/mdickinson/Enthought/ETS/pyface/pyface/toolkit.py", line 23, in <module>
    toolkit = toolkit_object = find_toolkit("pyface.toolkits")
  File "/Users/mdickinson/Enthought/ETS/pyface/pyface/base_toolkit.py", line 259, in find_toolkit
    plugin for plugin in importlib_metadata.entry_points().select(group=entry_point)
AttributeError: 'dict' object has no attribute 'select'

----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (errors=1)

The issue is that in Python 3.9, importlib.metadata doesn't provide the select interface (it's new in Python 3.10).

I think in the short term, #991 should be reverted while we figure out the right fix. That may be to ignore the deprecation warnings, or we may want to deliberately continue to use importlib_metadata instead of importlib.metadata on Python 3.9. (It's annoying to have to do so, though - we'd really like to be able to drop use of importlib_metadata sooner rather than later.)

Related: python/importlib_metadata#298

@mdickinson
Copy link
Member Author

The right fix may be something similar to this: astropy/astropy#11534

@rahulporuri rahulporuri added this to To be considered in Enthought OSS Q3 2021 via automation Jul 18, 2021
@rahulporuri rahulporuri self-assigned this Jul 18, 2021
@rahulporuri rahulporuri moved this from To be considered to In progress in Enthought OSS Q3 2021 Jul 18, 2021
@rahulporuri rahulporuri moved this from In progress to Done in Enthought OSS Q3 2021 Jul 18, 2021
@rahulporuri rahulporuri moved this from Done to Sprint 1 (5 July - 16 July 2021) in Enthought OSS Q3 2021 Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Enthought OSS Q3 2021
  
Sprint 1 (5 July - 16 July 2021)
Development

Successfully merging a pull request may close this issue.

2 participants