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
support Python3.11 #2418
Merged
Jasha10
merged 13 commits into
facebookresearch:main
from
skshetry:dataclass-mutable-default
Dec 5, 2022
Merged
support Python3.11 #2418
Jasha10
merged 13 commits into
facebookresearch:main
from
skshetry:dataclass-mutable-default
Dec 5, 2022
Commits on Oct 15, 2022
-
use default_factory for mutable defaults
When trying to import hydra in Python 3.11, it throws following error: ```python File "/home/user/projects/iterative/hydra/hydra/conf/__init__.py", line 75, in JobConf @DataClass ^^^^^^^^^ File "/home/user/.pyenv/versions/3.11-dev/lib/python3.11/dataclasses.py", line 1221, in dataclass return wrap(cls) ^^^^^^^^^ File "/home/user/.pyenv/versions/3.11-dev/lib/python3.11/dataclasses.py", line 1211, in wrap return _process_class(cls, init, repr, eq, order, unsafe_hash, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.pyenv/versions/3.11-dev/lib/python3.11/dataclasses.py", line 959, in _process_class cls_fields.append(_get_field(cls, name, type, kw_only)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.pyenv/versions/3.11-dev/lib/python3.11/dataclasses.py", line 816, in _get_field raise ValueError(f'mutable default {type(f.default)} for field ' ValueError: mutable default <class 'hydra.conf.JobConf.JobConfig.OverrideDirname'> for field override_dirname is not allowed: use default_factory ``` This is due to a recent change in dataclasses in Python 3.11 that disallows mutable to be set as a default value. This is done via check for hashability. See python/cpython#88840. Note that I am trying to add support for Python 3.11 to hydra. This seems like a major blocker. For reproducibility, I used the following command to search for these: ```console rg ".*: .* = [A-Z].*\(.*\)" ```
Configuration menu - View commit details
-
Copy full SHA for b090e96 - Browse repository at this point
Copy the full SHA b090e96View commit details
Commits on Nov 9, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 0e856a6 - Browse repository at this point
Copy the full SHA 0e856a6View commit details
Commits on Dec 2, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 88dc0ae - Browse repository at this point
Copy the full SHA 88dc0aeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5a94eef - Browse repository at this point
Copy the full SHA 5a94eefView commit details -
Configuration menu - View commit details
-
Copy full SHA for 873bdd8 - Browse repository at this point
Copy the full SHA 873bdd8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0948a33 - Browse repository at this point
Copy the full SHA 0948a33View commit details -
Configuration menu - View commit details
-
Copy full SHA for 17eeeae - Browse repository at this point
Copy the full SHA 17eeeaeView commit details -
Configuration menu - View commit details
-
Copy full SHA for fb248e4 - Browse repository at this point
Copy the full SHA fb248e4View commit details
Commits on Dec 3, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 307397f - Browse repository at this point
Copy the full SHA 307397fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4be1961 - Browse repository at this point
Copy the full SHA 4be1961View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8c5e913 - Browse repository at this point
Copy the full SHA 8c5e913View commit details -
Configuration menu - View commit details
-
Copy full SHA for c1b7ea5 - Browse repository at this point
Copy the full SHA c1b7ea5View commit details -
Configuration menu - View commit details
-
Copy full SHA for af94ac3 - Browse repository at this point
Copy the full SHA af94ac3View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.