Skip to content

Commit 729d113

Browse files
Henry PeteetGitHub Enterprise
authored andcommitted
Fix cattrs register calls for 3.9.10 (#17)
1 parent e00f47e commit 729d113

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

.github/workflows/pytest.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ jobs:
2323
# If one test in the matrix fails we still want to run the others.
2424
fail-fast: false
2525
matrix:
26-
# pinning python 3.9.9 since there are typing issues with 3.9.10: https://github.com/Unity-Technologies/ml-agents/issues/5689
27-
python-version: [3.7.x, 3.8.x, 3.9.9]
26+
python-version: [3.7.x, 3.8.x, 3.9.x]
2827
include:
2928
- python-version: 3.7.x
3029
pip_constraints: test_constraints_min_version.txt
3130
- python-version: 3.8.x
3231
pip_constraints: test_constraints_mid_version.txt
33-
- python-version: 3.9.9
32+
- python-version: 3.9.x
3433
pip_constraints: test_constraints_max_version.txt
3534
steps:
3635
- uses: actions/checkout@v2

com.unity.ml-agents/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ and this project adheres to
1717
### Minor Changes
1818
#### com.unity.ml-agents / com.unity.ml-agents.extensions (C#)
1919
#### ml-agents / ml-agents-envs
20+
- Extended support to python 3.9.10
21+
2022
### Bug Fixes
2123
#### com.unity.ml-agents / com.unity.ml-agents.extensions (C#)
2224
#### ml-agents / ml-agents-envs

ml-agents-envs/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def run(self):
5959
"numpy==1.21.2",
6060
"filelock>=3.4.0",
6161
],
62-
python_requires=">=3.7.2,<3.9.10",
62+
python_requires=">=3.7.2,<3.10.0",
6363
# TODO: Remove this once mypy stops having spurious setuptools issues.
6464
cmdclass={"verify": VerifyVersionCommand}, # type: ignore
6565
)

ml-agents/mlagents/trainers/settings.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,9 @@ def _set_default_hyperparameters(self):
664664
self_play: Optional[SelfPlaySettings] = None
665665
behavioral_cloning: Optional[BehavioralCloningSettings] = None
666666

667-
cattr.register_structure_hook(
668-
Dict[RewardSignalType, RewardSignalSettings], RewardSignalSettings.structure
667+
cattr.register_structure_hook_func(
668+
lambda t: t == Dict[RewardSignalType, RewardSignalSettings],
669+
RewardSignalSettings.structure,
669670
)
670671

671672
@network_settings.validator
@@ -878,8 +879,9 @@ class RunOptions(ExportableSettings):
878879
cattr.register_structure_hook(EnvironmentSettings, strict_to_cls)
879880
cattr.register_structure_hook(EngineSettings, strict_to_cls)
880881
cattr.register_structure_hook(CheckpointSettings, strict_to_cls)
881-
cattr.register_structure_hook(
882-
Dict[str, EnvironmentParameterSettings], EnvironmentParameterSettings.structure
882+
cattr.register_structure_hook_func(
883+
lambda t: t == Dict[str, EnvironmentParameterSettings],
884+
EnvironmentParameterSettings.structure,
883885
)
884886
cattr.register_structure_hook(Lesson, strict_to_cls)
885887
cattr.register_structure_hook(

ml-agents/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def run(self):
7878
'pypiwin32==223;platform_system=="Windows"',
7979
"importlib_metadata; python_version<'3.8'",
8080
],
81-
python_requires=">=3.7.2,<3.9.10",
81+
python_requires=">=3.7.2,<3.10.0",
8282
entry_points={
8383
"console_scripts": [
8484
"mlagents-learn=mlagents.trainers.learn:main",

0 commit comments

Comments
 (0)