Hydra: [Feature Request] Add support for Python 3.9

Created on 14 Oct 2020  路  9Comments  路  Source: facebookresearch/hydra

馃殌 Feature Request

Add support for Python 3.9

Motivation

  • Python 3.9 is available. We should consider supporting it.

Pitch

  • [x] Check if CI/Conda supports 3.9.
  • [x] Run the tests with python 3.9 and check what breaks.
  • [x] Fix whatever breaks (if applicable).

Are you willing to open a pull request? (See CONTRIBUTING)

Yes

Additional context

NA

enhancement

All 9 comments

cc @jieru-hu

Regarding 1. python 3.9 is not available right now. Retry in a few days.

Once you get it to work, can you also send a PR against OmegaConf to add 3.9? the CI there is much simpler.

Attempting to run on Python 3.9 (Windows) results in the following for me (same code works on Python 3.8):

C:\Users\johndi\AppData\Local\Programs\Python\Python39\lib\site-packages\hydra\core\plugins.py:202: UserWarning: 
    Error importing 'hydra._internal.core_plugins.importlib_resources_config_source'.
    Plugin is incompatible with this Hydra version or buggy.
    Recommended to uninstall or upgrade plugin.
        ModuleNotFoundError : No module named 'importlib_resources'
  warnings.warn(
Traceback (most recent call last):
  File "C:\Users\johndi\AppData\Local\Programs\Python\Python39\lib\site-packages\hydra\_internal\utils.py", line 198, in run_and_report
    return func()
  File "C:\Users\johndi\AppData\Local\Programs\Python\Python39\lib\site-packages\hydra\_internal\utils.py", line 320, in <lambda>
    lambda: Hydra.create_main_hydra2(
  File "C:\Users\johndi\AppData\Local\Programs\Python\Python39\lib\site-packages\hydra\_internal\hydra.py", line 73, in create_main_hydra2
    config_loader: ConfigLoader = ConfigLoaderImpl(
  File "C:\Users\johndi\AppData\Local\Programs\Python\Python39\lib\site-packages\hydra\_internal\config_loader_impl.py", line 79, in __init__
    self.repository: ConfigRepository = ConfigRepository(
  File "C:\Users\johndi\AppData\Local\Programs\Python\Python39\lib\site-packages\hydra\_internal\config_repository.py", line 22, in __init__
    source_type = SourcesRegistry.instance().resolve(scheme)
  File "C:\Users\johndi\AppData\Local\Programs\Python\Python39\lib\site-packages\hydra\_internal\sources_registry.py", line 29, in resolve
    raise ValueError(
ValueError: No config source registered for schema pkg, supported types : [file, structured]

Process finished with exit code 1

I have a PR on this. Will push later today

Thanks for reporting @johnmdilley, we will have a fix for it soon.

@shagunsodhani , once your fix is accepted, can you also backport it to the 1.0_branch?

Following plugins do not support 3.9:

  1. Ray Launcher: https://github.com/ray-project/ray/issues/11287

Ok. can you leave a comment in its setup.py with a link to that issue?

@johnmdilley The fix has landed in master now.

Was this page helpful?
0 / 5 - 0 ratings