)]}'
{"nova/objects/__init__.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"17912fdafc91c4e25ca64feedeae8852c2501644","unresolved":true,"context_lines":[{"line_number":22,"context_line":"import typing as ty"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"if ty.TYPE_CHECKING:"},{"line_number":25,"context_line":"    from nova.objects.aggregate import *  # noqa"},{"line_number":26,"context_line":"    from nova.objects.block_device import *  # noqa"},{"line_number":27,"context_line":"    from nova.objects.build_request import *  # noqa"},{"line_number":28,"context_line":"    from nova.objects.cell_mapping import *  # noqa"}],"source_content_type":"text/x-python","patch_set":1,"id":"291a4934_83d167d3","line":25,"updated":"2026-01-21 10:08:13.000000000","message":"Interesting. Is this form of import enough for mypy to match the types when we use them as objects.Aggregate even though they are really nova.objects.aggregate.Aggregate?","commit_id":"c870873f7fbf0dec03a520f60423491cf9ecf64f"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"823a7898d4589c27485cd7308c4851fe512e3adc","unresolved":false,"context_lines":[{"line_number":22,"context_line":"import typing as ty"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"if ty.TYPE_CHECKING:"},{"line_number":25,"context_line":"    from nova.objects.aggregate import *  # noqa"},{"line_number":26,"context_line":"    from nova.objects.block_device import *  # noqa"},{"line_number":27,"context_line":"    from nova.objects.build_request import *  # noqa"},{"line_number":28,"context_line":"    from nova.objects.cell_mapping import *  # noqa"}],"source_content_type":"text/x-python","patch_set":1,"id":"f15beabb_e5c669ef","line":25,"in_reply_to":"291a4934_83d167d3","updated":"2026-01-21 10:38:41.000000000","message":"Yes, I have more changes that I\u0027m carrying locally and when combined with the `__all__` changes (to ensure we don\u0027t end up e.g. importing the imports) this seems to do the trick. Obviously we still don\u0027t have fully type checking of the actual objects (that would require a plugin like the one you worked on some time back) but it\u0027ll catch obvious things like invalid object classes.","commit_id":"c870873f7fbf0dec03a520f60423491cf9ecf64f"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"9591a2b6076e78300655ac8bbdba704f6169bd91","unresolved":false,"context_lines":[{"line_number":22,"context_line":"import typing as ty"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"if ty.TYPE_CHECKING:"},{"line_number":25,"context_line":"    from nova.objects.aggregate import *  # noqa"},{"line_number":26,"context_line":"    from nova.objects.block_device import *  # noqa"},{"line_number":27,"context_line":"    from nova.objects.build_request import *  # noqa"},{"line_number":28,"context_line":"    from nova.objects.cell_mapping import *  # noqa"}],"source_content_type":"text/x-python","patch_set":1,"id":"f286792d_ae3321fd","line":25,"in_reply_to":"897cccaf_ec4d0ad5","updated":"2026-01-21 13:29:55.000000000","message":"Afraid not: mypy and other type checkers read code: they don\u0027t execute it. I tested locally but applying this change to the end of my series and got the following:\n\n```\n❯ tox -e mypy\n.pkg: _optional_hooks\u003e python /usr/lib/python3.14/site-packages/pyproject_api/_backend.py True pbr.build\n.pkg: get_requires_for_build_sdist\u003e python /usr/lib/python3.14/site-packages/pyproject_api/_backend.py True pbr.build\n.pkg: get_requires_for_build_editable\u003e python /usr/lib/python3.14/site-packages/pyproject_api/_backend.py True pbr.build\n.pkg: build_editable\u003e python /usr/lib/python3.14/site-packages/pyproject_api/_backend.py True pbr.build\nmypy: install_package\u003e python -I -m pip install -chttps://releases.openstack.org/constraints/upper/master --force-reinstall --no-deps /home/stephenfin/Development/openstack/nova/.tox/.tmp/package/1104/nova-32.1.0.dev175-0.editable-py3-none-any.whl\nmypy: commands[0]\u003e mypy /home/stephenfin/Development/openstack/nova/nova\nnova/filters.py: note: In member \"_filter_one\" of class \"BaseFilter\":\nnova/filters.py:38:2: error: Name \"objects.RequestSpec\" is not defined  [name-defined]\n...\n... {snip}\n...\nnova/virt/fake.py: note: In member \"unrescue\" of class \"FakeDriver\":\nnova/virt/fake.py:254:2: error: Name \"objects.Instance\" is not defined  [name-defined]\nFound 866 errors in 46 files (checked 1481 source files)\nmypy: exit 1 (31.73 seconds) /home/stephenfin/Development/openstack/nova\u003e mypy /home/stephenfin/Development/openstack/nova/nova pid\u003d875349\n.pkg: _exit\u003e python /usr/lib/python3.14/site-packages/pyproject_api/_backend.py True pbr.build\n  mypy: FAIL code 1 (48.00\u003dsetup[16.27]+cmd[31.73] seconds)\n  evaluation failed :( (48.81 seconds)\n```\n\n😅\n\n(iirc, I also tried this approach originally leading to this current approach)","commit_id":"c870873f7fbf0dec03a520f60423491cf9ecf64f"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"739e3b5b639c975c1185ac2d9a48b1168b2a096c","unresolved":true,"context_lines":[{"line_number":22,"context_line":"import typing as ty"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"if ty.TYPE_CHECKING:"},{"line_number":25,"context_line":"    from nova.objects.aggregate import *  # noqa"},{"line_number":26,"context_line":"    from nova.objects.block_device import *  # noqa"},{"line_number":27,"context_line":"    from nova.objects.build_request import *  # noqa"},{"line_number":28,"context_line":"    from nova.objects.cell_mapping import *  # noqa"}],"source_content_type":"text/x-python","patch_set":1,"id":"897cccaf_ec4d0ad5","line":25,"in_reply_to":"d06c7f55_07015876","updated":"2026-01-21 13:08:27.000000000","message":"out of interes did calling register_all() under \n\nif ty.TYPE_CHECKING:\n\nnot work?\n\ni generally dont like haveing to use __all__ if we can avoid it but if its requrie then that ok.","commit_id":"c870873f7fbf0dec03a520f60423491cf9ecf64f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e0d0e8ef8ec54dd06b0b7514f44e37d1b2a930ac","unresolved":false,"context_lines":[{"line_number":22,"context_line":"import typing as ty"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"if ty.TYPE_CHECKING:"},{"line_number":25,"context_line":"    from nova.objects.aggregate import *  # noqa"},{"line_number":26,"context_line":"    from nova.objects.block_device import *  # noqa"},{"line_number":27,"context_line":"    from nova.objects.build_request import *  # noqa"},{"line_number":28,"context_line":"    from nova.objects.cell_mapping import *  # noqa"}],"source_content_type":"text/x-python","patch_set":1,"id":"d06c7f55_07015876","line":25,"in_reply_to":"f15beabb_e5c669ef","updated":"2026-01-21 12:14:55.000000000","message":"OK cool","commit_id":"c870873f7fbf0dec03a520f60423491cf9ecf64f"}]}
