omry / omegaconf

Flexible Python configuration system. The last one you will ever need.
BSD 3-Clause "New" or "Revised" License
1.94k stars 105 forks source link

support python3.11 #1032

Closed Jasha10 closed 1 year ago

Jasha10 commented 1 year ago

This PR updates OmegaConf's tests and metadata for compatibility with python3.11.

There are no changes to the omegaconf source code.

The changes to the test are motivated by python3.11 dataclasses dropping support for mutable default arguments. This means dataclasses with mutable default arguments must use default_factory.

I've updated the dataclasses in the test suite to use default_factory, and I've added a file tests/structured_conf/dataclasses_pre_311.py that contains old-style dataclasses that do not use default_factory for mutable dataclass defaults. This pre_311 file is run only when python version < 3.10.

Commits:

Jasha10 commented 1 year ago

Blocked by https://github.com/omry/omegaconf/pull/1033 which should give our CI access to docker images that support python3.11.