Rewriting of the registration mechanism (#2748)

* First version of the new registration

* Almost done

* Hopefully final commit

* Minor fixes

* Missing error

* Type fixes

* Type fixes

* Add some type hinting stuff

* Fix an error?

* Fix literal import

* Add a comment

* Add some docstrings

Remove old tests

* Add some docstrings, rename helper functions

* Rename a function

* Registration check fix

* Consistently use `register` instead of `envs.register` in tests

* Fix the malformed registration error message to not use a write-only format

* Change an error back to a warning when double-registering an environment
This commit is contained in:
Ariel Kwiatkowski
2022-04-21 20:41:15 +02:00
committed by GitHub
parent 0a5f543d6a
commit 00a60e6cc8
4 changed files with 359 additions and 649 deletions

View File

@@ -50,6 +50,6 @@ def should_skip_env_spec_for_tests(spec):
spec_list = [
spec
for spec in sorted(envs.registry.all(), key=lambda x: x.id)
for spec in sorted(envs.registry.values(), key=lambda x: x.id)
if spec.entry_point is not None and not should_skip_env_spec_for_tests(spec)
]