Skip to content

internal server error - dmypy daemon crashed #18396

Closed

Description

@arthurbrenno

Bug Report

./src/intellibricks/models/supervised/engines.py: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.14.1
Daemon crashed!
Traceback (most recent call last):
File "mypy/dmypy_server.py", line 236, in serve
File "mypy/dmypy_server.py", line 285, in run_command
File "mypy/dmypy_server.py", line 353, in cmd_run
File "mypy/dmypy_server.py", line 432, in check
File "mypy/dmypy_server.py", line 700, in fine_grained_increment_follow_imports
File "mypy/server/update.py", line 285, in update
File "mypy/server/update.py", line 881, in propagate_changes_using_dependencies
File "mypy/server/update.py", line 1010, in reprocess_nodes
File "mypy/semanal_main.py", line 137, in semantic_analysis_for_targets
File "mypy/semanal_main.py", line 220, in process_top_levels
File "mypy/semanal_main.py", line 351, in semantic_analyze_target
File "mypy/semanal.py", line 646, in refresh_partial
File "mypy/semanal.py", line 657, in refresh_top_level
File "mypy/semanal.py", line 7288, in accept
File "mypy/errors.py", line 1288, in report_internal_error
File "mypy/semanal.py", line 7286, in accept
File "mypy/nodes.py", line 471, in accept
File "mypy/semanal.py", line 2958, in visit_import_from
File "mypy/semanal.py", line 3054, in report_missing_module_attribute
File "mypy/semanal.py", line 7267, in fail
File "mypy/errors.py", line 463, in report
File "mypy/errors.py", line 529, in add_error_info
File "mypy/errors.py", line 466, in _add_error_info
AssertionError

[35] Error running mypy in /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks: the mypy daemon crashed. This is probably a bug in mypy itself, see Output panel for details. The daemon will be restarted automatically.

To Reproduce

uv python install 3.13.1
uv python pin 3.13.1
uv venv
source .venv/bin/activate
uv add mypy --dev
dmypy start
x: str = 2
y: int = "3"
# ERROR

Your Environment

  • Mypy version used: 1.14.1
  • Mypy command-line flags: uv run dmypy start
  • Mypy configuration options from mypy.ini (and other config files):
  • Python version used: 3.13.1

Activity

  1. A5rocks commented on Dec 31, 2024

    @A5rocks
    Collaborator

    Are you sure that's the right file? The traceback says that it crashed visiting an import from: File "mypy/semanal.py", line 2958, in visit_import_from.

  2. hauntsaninja commented on Dec 31, 2024

    @hauntsaninja
    Collaborator

    Yeah, the traceback suggests ./src/intellibricks/models/supervised/engines.py

  3. arthurbrenno commented on Dec 31, 2024

    @arthurbrenno
    Author

    Hi. supervised/engines.py does not exist anymore. I deleted it. Maybe I clear mypy cache?

  4. arthurbrenno commented on Dec 31, 2024

    @arthurbrenno
    Author

    Are you sure that's the right file? The traceback says that it crashed visiting an import from: File "mypy/semanal.py", line 2958, in visit_import_from.

    I'm sure! Also, I'm using the mypy extension, from Matan Gover. That might not be your problem, right? I should tell the extension author. The error I told you happens automatically. I didn't run any mypy command. The extension is running mypy daemon in the background. I tested now in a file called schema.py.

    Just replicated the error again now:
    Document saved: /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/src/intellibricks/llms/schema.py
    [62] Check folder: /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks
    [62] Received Python path from Python extension: /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/bin/python
    [62] Running dmypy in folder /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks
    /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/bin/dmypy --status-file '/Users/arthurbrenno/Library/Application Support/Code/User/workspaceStorage/8a9c88162dc1465d3ab80eb67813bccb/matangover.mypy/dmypy-8472a25bb76665ac15378ffb435fc2ea45288337-1975.json' run --log-file '/Users/arthurbrenno/Library/Application Support/Code/User/workspaceStorage/8a9c88162dc1465d3ab80eb67813bccb/matangover.mypy/dmypy-8472a25bb76665ac15378ffb435fc2ea45288337.log' -- --python-executable /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/bin/python . --show-error-end --no-error-summary --no-pretty --no-color-output
    [62] stderr:
    Daemon crashed!
    Traceback (most recent call last):
    File "mypy/dmypy_server.py", line 236, in serve
    File "mypy/dmypy_server.py", line 285, in run_command
    File "mypy/dmypy_server.py", line 353, in cmd_run
    File "mypy/dmypy_server.py", line 432, in check
    File "mypy/dmypy_server.py", line 700, in fine_grained_increment_follow_imports
    File "mypy/server/update.py", line 285, in update
    File "mypy/server/update.py", line 881, in propagate_changes_using_dependencies
    File "mypy/server/update.py", line 1025, in reprocess_nodes
    File "mypy/checker.py", line 535, in check_second_pass
    File "mypy/checker.py", line 540, in check_partial
    File "mypy/checker.py", line 555, in check_top_level
    File "mypy/nodes.py", line 1364, in accept
    File "mypy/checker.py", line 3001, in visit_assignment_stmt
    File "mypy/checker.py", line 3179, in check_assignment
    File "mypy/checker.py", line 4379, in check_simple_assignment
    File "mypy/checker.py", line 7007, in check_subtype
    File "mypy/checker.py", line 7350, in fail
    File "mypy/messages.py", line 289, in fail
    File "mypy/messages.py", line 264, in report
    File "mypy/errors.py", line 463, in report
    File "mypy/errors.py", line 529, in add_error_info
    File "mypy/errors.py", line 466, in _add_error_info
    AssertionError

    [62] Error running mypy in /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks: the mypy daemon crashed. This is probably a bug in mypy itself, see Output panel for details. The daemon will be restarted automatically.

    Idk where to look honestly

  5. A5rocks commented on Dec 31, 2024

    @A5rocks
    Collaborator

    The traceback is different now (and is plausible on the repro you gave), so that's good! I'm not sure why it's happening since I'm not familiar with mypyd :/

  6. miky-rola commented on Jan 2, 2025

    @miky-rola

    Hi, I wanted to know whether this bug has been fixed.

  7. A5rocks commented on Jan 2, 2025

    @A5rocks
    Collaborator

    It is unlikely this bug has been fixed. You can always install mypy via pip install git+https://github.com/python/mypy to check.

  8. arthurbrenno commented on Jan 2, 2025

    @arthurbrenno
    Author

    Just reproduced the error again, more details below:

    Daemon crashed!
    Traceback (most recent call last):
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/dmypy_server.py", line 237, in serve
        resp = self.run_command(command, data)
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/dmypy_server.py", line 286, in run_command
        ret = method(self, **data)
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/dmypy_server.py", line 354, in cmd_run
        return self.check(sources, export_types, is_tty, terminal_width)
               ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/dmypy_server.py", line 433, in check
        messages = self.fine_grained_increment_follow_imports(
            sources, explicit_export_types=export_types
        )
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/dmypy_server.py", line 701, in fine_grained_increment_follow_imports
        messages = fine_grained_manager.update([], to_delete)
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/server/update.py", line 286, in update
        changed_modules = propagate_changes_using_dependencies(
            self.manager,
        ...<5 lines>...
            self.processed_targets,
        )
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/server/update.py", line 882, in propagate_changes_using_dependencies
        triggered |= reprocess_nodes(manager, graph, id, nodes, deps, processed_targets)
                     ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/server/update.py", line 1011, in reprocess_nodes
        semantic_analysis_for_targets(graph[module_id], nodes, graph, saved_attrs)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal_main.py", line 137, in semantic_analysis_for_targets
        process_top_levels(graph, [state.id], patches)
        ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal_main.py", line 220, in process_top_levels
        deferred, incomplete, progress = semantic_analyze_target(
                                         ~~~~~~~~~~~~~~~~~~~~~~~^
            next_id, next_id, state, state.tree, None, final_iteration, patches
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal_main.py", line 351, in semantic_analyze_target
        analyzer.refresh_partial(
        ~~~~~~~~~~~~~~~~~~~~~~~~^
            refresh_node,
            ^^^^^^^^^^^^^
        ...<4 lines>...
            active_type=active_type,
            ^^^^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 647, in refresh_partial
        self.refresh_top_level(node)
        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 658, in refresh_top_level
        self.accept(d)
        ~~~~~~~~~~~^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 7303, in accept
        report_internal_error(err, self.errors.file, node.line, self.errors, self.options)
        ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/errors.py", line 1289, in report_internal_error
        raise err
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 7301, in accept
        node.accept(self)
        ~~~~~~~~~~~^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/nodes.py", line 1183, in accept
        return visitor.visit_class_def(self)
               ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 1788, in visit_class_def
        self.analyze_class(defn)
        ~~~~~~~~~~~~~~~~~~^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 1929, in analyze_class
        bases, tvar_defs, is_protocol = self.clean_up_bases_and_infer_type_variables(
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
            defn, bases, context=defn
            ^^^^^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 2240, in clean_up_bases_and_infer_type_variables
        self.analyze_type_expr(base_expr)
        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 7355, in analyze_type_expr
        expr.accept(self)
        ~~~~~~~~~~~^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/nodes.py", line 1895, in accept
        return visitor.visit_member_expr(self)
               ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 5906, in visit_member_expr
        base.accept(self)
        ~~~~~~~~~~~^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/nodes.py", line 1873, in accept
        return visitor.visit_name_expr(self)
               ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 5651, in visit_name_expr
        n = self.lookup(expr.name, expr)
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 6345, in lookup
        self.name_not_defined(name, ctx)
        ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 7176, in name_not_defined
        self.fail(message, ctx, code=codes.NAME_DEFINED)
        ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/semanal.py", line 7282, in fail
        self.errors.report(ctx.line, ctx.column, msg, blocker=blocker, code=code)
        ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/errors.py", line 464, in report
        self.add_error_info(info)
        ~~~~~~~~~~~~~~~~~~~^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/errors.py", line 530, in add_error_info
        self._add_error_info(file, info)
        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
      File "/Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks/.venv/lib/python3.13/site-packages/mypy/errors.py", line 467, in _add_error_info
        assert file not in self.flushed_files
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError
    
    
    [34] Error running mypy in /Users/arthurbrenno/Documents/Dev/Public/ctx/intellibricks: the mypy daemon crashed. This is probably a bug in mypy itself, see Output panel for details. The daemon will be restarted automatically.
  9. sanmai-NL commented on Jan 14, 2025

    @sanmai-NL

    I have the same exception. It could be induced by ungraceful shutdown of the daemon.

  10. gerner commented on Jan 14, 2025

    @gerner

    I ran into the same issue and posted my problem to #15486. @hauntsaninja suggested it's actually this bug. I did a bisect and determined that I don't get the crash in 1.13.0 but I do get the crash in 1.14.0

    The behavior I see is that from a fresh dmypy restart I can run dmypy run twice successfully and then I get a crash with the following stack trace on the third run. This is 100% reproduceable on this code base, you'll have to introduce a syntax/type error of some sort. I try not to check those in :)

    https://github.com/gerner/stellarpunk/tree/87748840624727e521b7641bd947b17f71ca061d

    dmypy run
    src/stellarpunk/intel.py:307: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
    https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
    Please report a bug at https://github.com/python/mypy/issues
    version: 1.14.0
    src/stellarpunk/intel.py:304: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
    https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
    Please report a bug at https://github.com/python/mypy/issues
    version: 1.14.0
    src/stellarpunk/intel.py: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
    https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
    Please report a bug at https://github.com/python/mypy/issues
    version: 1.14.0
    Daemon crashed!
    Traceback (most recent call last):
      File "mypy/dmypy_server.py", line 236, in serve
      File "mypy/dmypy_server.py", line 285, in run_command
      File "mypy/dmypy_server.py", line 353, in cmd_run
      File "mypy/dmypy_server.py", line 432, in check
      File "mypy/dmypy_server.py", line 700, in fine_grained_increment_follow_imports
      File "mypy/server/update.py", line 285, in update
      File "mypy/server/update.py", line 881, in propagate_changes_using_dependencies
      File "mypy/server/update.py", line 1010, in reprocess_nodes
      File "mypy/semanal_main.py", line 144, in semantic_analysis_for_targets
      File "mypy/semanal_main.py", line 291, in process_top_level_function
      File "mypy/semanal_main.py", line 351, in semantic_analyze_target
      File "mypy/semanal.py", line 649, in refresh_partial
      File "mypy/semanal.py", line 7288, in accept
      File "mypy/errors.py", line 1288, in report_internal_error
      File "mypy/semanal.py", line 7286, in accept
      File "mypy/nodes.py", line 827, in accept
      File "mypy/semanal.py", line 907, in visit_func_def
      File "mypy/semanal.py", line 989, in analyze_func_def
      File "mypy/semanal.py", line 1583, in analyze_function_body
      File "mypy/nodes.py", line 1277, in accept
      File "mypy/semanal.py", line 5287, in visit_block
      File "mypy/semanal.py", line 7288, in accept
      File "mypy/errors.py", line 1288, in report_internal_error
      File "mypy/semanal.py", line 7286, in accept
      File "mypy/nodes.py", line 1364, in accept
      File "mypy/semanal.py", line 3213, in visit_assignment_stmt
      File "mypy/nodes.py", line 1886, in accept
      File "mypy/semanal.py", line 5636, in visit_name_expr
      File "mypy/semanal.py", line 6330, in lookup
      File "mypy/semanal.py", line 7161, in name_not_defined
      File "mypy/semanal.py", line 7267, in fail
      File "mypy/errors.py", line 463, in report
      File "mypy/errors.py", line 529, in add_error_info
      File "mypy/errors.py", line 466, in _add_error_info
    AssertionError
    
  11. hauntsaninja commented on Jan 19, 2025

    @hauntsaninja
    Collaborator

    Hmm, I couldn't trivially repro on 8774884 with numpy 2.1. I introduced a type error in src/stellarpunk/intel.py. Could you share what error you introduced and when, and what third party package versions you're using? (Alternatively if you have a few lines of bash that set up a new environment in which it repros, that would be amazing!)

  12. lovettchris commented on Jan 29, 2025

    @lovettchris

    I'm getting this more and more on Windows lately with this assertion stack trace:

    Traceback (most recent call last):
      File "mypy\dmypy_server.py", line 236, in serve
      File "mypy\dmypy_server.py", line 285, in run_command
      File "mypy\dmypy_server.py", line 353, in cmd_run
      File "mypy\dmypy_server.py", line 432, in check
      File "mypy\dmypy_server.py", line 700, in fine_grained_increment_follow_imports
      File "mypy\server\update.py", line 285, in update
      File "mypy\server\update.py", line 881, in propagate_changes_using_dependencies
      File "mypy\server\update.py", line 1025, in reprocess_nodes
      File "mypy\checker.py", line 535, in check_second_pass
      File "mypy\checker.py", line 547, in check_partial
      File "mypy\checker.py", line 594, in accept
      File "mypy\errors.py", line 1288, in report_internal_error
      File "mypy\checker.py", line 592, in accept
      File "mypy\nodes.py", line 827, in accept
      File "mypy\checker.py", line 1046, in visit_func_def
      File "mypy\checker.py", line 1050, in _visit_func_def
      File "mypy\checker.py", line 1084, in check_func_item
      File "mypy\checker.py", line 1360, in check_func_def
      File "mypy\checker.py", line 594, in accept
      File "mypy\errors.py", line 1288, in report_internal_error
      File "mypy\checker.py", line 592, in accept
      File "mypy\nodes.py", line 1277, in accept
      File "mypy\checker.py", line 2952, in visit_block
      File "mypy\checker.py", line 594, in accept
      File "mypy\errors.py", line 1288, in report_internal_error
      File "mypy\checker.py", line 592, in accept
      File "mypy\nodes.py", line 1545, in accept
      File "mypy\checker.py", line 4735, in visit_if_stmt
      File "mypy\checker.py", line 594, in accept
      File "mypy\errors.py", line 1288, in report_internal_error
      File "mypy\checker.py", line 592, in accept
      File "mypy\nodes.py", line 1277, in accept
      File "mypy\checker.py", line 2952, in visit_block
      File "mypy\checker.py", line 594, in accept
      File "mypy\errors.py", line 1288, in report_internal_error
      File "mypy\checker.py", line 592, in accept
      File "mypy\nodes.py", line 1473, in accept
      File "mypy\checker.py", line 4613, in visit_return_stmt
      File "mypy\checker.py", line 4649, in check_return_stmt
      File "mypy\checkexpr.py", line 5892, in accept
      File "mypy\errors.py", line 1288, in report_internal_error
      File "mypy\checkexpr.py", line 5890, in accept
      File "mypy\nodes.py", line 1984, in accept
      File "mypy\checkexpr.py", line 484, in visit_call_expr
      File "mypy\checkexpr.py", line 618, in visit_call_expr_inner
      File "mypy\checkexpr.py", line 1475, in check_call_expr_with_callee_type
      File "mypy\checkexpr.py", line 1571, in check_call
      File "mypy\checkexpr.py", line 1798, in check_callable_call
      File "mypy\checkexpr.py", line 2593, in check_argument_types
      File "mypy\checkexpr.py", line 2630, in check_arg
      File "mypy\messages.py", line 838, in incompatible_argument
      File "mypy\messages.py", line 289, in fail
      File "mypy\messages.py", line 264, in report
      File "mypy\errors.py", line 463, in report
      File "mypy\errors.py", line 529, in add_error_info
      File "mypy\errors.py", line 466, in _add_error_info
    AssertionError
    
  13. gerner commented on Feb 4, 2025

    @gerner

    @hauntsaninja sorry for the delay! I just did a clean clone of my repo and indeed I can't reproduce the error in that clean clone.

    The kind of type error I'm introducing doesn't seem to matter on my main clone. I'm trying, for example, something like this:

    def __init__(self, collection_director:"IntelCollectionDirector", *args:Any, idle_period:float=120.0, **kwargs) -> None:
    

    Notice the missing annotation for **kwargs

    Does mypy keep some state around that survives a dmypy restart?

  14. 11 remaining items

  15. sterliakov commented on Apr 9, 2025

    @sterliakov
    Collaborator

    Following the investigation by @svalentin (thanks!), a few more observations:

    • Crash reproduces on master

    • First two runs aren't equivalent (Found 61 errors in 10 files (checked 90 source files) and Found 60 errors in 9 files (checked 90 source files), resp.). The error that gets lost is

      src/stellarpunk/interface/presenter.py:494: error: "make_pointy_hex_grid_canvas" gets multiple values for keyword argument "bbox" [misc]

      This is likely irrelevant - with minimal deps (see below) both runs produce the same output.

    • Reverting #976d105 fixes the problem, producing 60 errors for all subsequent runs without crashing. The "offending" (and the only affected by is_stdlib_file addition) module is xml.etree.

    • The only needed dependency is imageio (implies numpy). tests can be excluded from files (src is enough), and numpy plugin can be disabled. If I exclude tests, crash happens during the third run, otherwise - during the second run.

    It's slow as hell, but at least happens consistently (. I wasn't able to narrow the scope further. The following crashed 5/5 during the second run:

    cd "$(mktemp -d)"
    git clone https://github.com/gerner/stellarpunk
    cd stellarpunk && git checkout 87748840624727e521b7641bd947b17f71ca061d
    uv venv && . .venv/bin/activate && uv pip install 'mypy==1.15.0' 'imageio==2.37.0'
    dmypy restart && for i in {1..3}; do dmypy run; done
  16. sterliakov commented on Apr 9, 2025

    @sterliakov
    Collaborator

    Hm, I might be onto something - can someone more familiar with dmypy updates take a look at my observations?

    fine_grained_increment_follow_imports builds seen set. If my understanding is correct, any module should depend on its parent, so the final seen should contain a ladder from root to every reached submodule. It... isn't in some cases, resulting in numpy.testing._private and xml.etree considered deleted and processed as such.

    With the following patch:

    diff --git a/mypy/build.py b/mypy/build.py
    index 355ba8613..1fb271848 100644
    --- a/mypy/build.py
    +++ b/mypy/build.py
    @@ -99,7 +99,7 @@ from mypy.version import __version__
     # mode only that is useful during development. This produces only a subset of
     # output compared to --verbose output. We use a global flag to enable this so
     # that it's easy to enable this when running tests.
    -DEBUG_FINE_GRAINED: Final = False
    +DEBUG_FINE_GRAINED: Final = True
     
     # These modules are special and should always come from typeshed.
     CORE_BUILTIN_MODULES: Final = {
    diff --git a/mypy/dmypy_server.py b/mypy/dmypy_server.py
    index d73487efe..cc76dc286 100644
    --- a/mypy/dmypy_server.py
    +++ b/mypy/dmypy_server.py
    @@ -694,6 +694,7 @@ class Server:
                 if module_id not in graph:
                     continue
                 if module_id not in seen:
    +                print(f"xxx {module_id} {sorted(seen)!r}", file=sys.stderr)
                     module_path = graph[module_id].path
                     assert module_path is not None
                     to_delete.append((module_id, module_path))

    I get the following log:

    Long scrolling!
    dmypy restart && for i in {1..3}; do dmypy run --verbose ; done
    Daemon stopped
    Daemon started
    src/stellarpunk/core/base.py:18: error: Module "stellarpunk" has no attribute "_version"  [attr-defined]
    src/stellarpunk/orders/core.py:359: error: Incompatible types in assignment (expression has type "floating[Any] | float64", variable has type "float64")  [assignment]
    src/stellarpunk/generate/core.py:541: error: Incompatible types in assignment (expression has type "float | ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, ...], dtype[float64]]")  [assignment]
    src/stellarpunk/generate/core.py:845: error: Name "loc" already defined on line 841  [no-redef]
    src/stellarpunk/generate/core.py:1708: error: Argument 1 to "spawn_character" of "UniverseGenerator" has incompatible type "Asset"; expected "SectorEntity"  [arg-type]
    src/stellarpunk/generate/core.py:1709: error: Argument 2 to "setup_captain" of "UniverseGenerator" has incompatible type "Asset"; expected "SectorEntity"  [arg-type]
    src/stellarpunk/generate/core.py:1712: error: "Asset" has no attribute "captain"  [attr-defined]
    src/stellarpunk/generate/core.py:2082: error: Argument 1 to "_random_bipartite_graph" of "UniverseGenerator" has incompatible type "signedinteger[_64Bit]"; expected "int"  [arg-type]
    src/stellarpunk/generate/core.py:2083: error: Argument 2 to "_random_bipartite_graph" of "UniverseGenerator" has incompatible type "signedinteger[_64Bit]"; expected "int"  [arg-type]
    src/stellarpunk/generate/core.py:2084: error: Argument 3 to "_random_bipartite_graph" of "UniverseGenerator" has incompatible type "ndarray[tuple[int, ...], dtype[signedinteger[_64Bit]]]"; expected "int"  [arg-type]                                                                                                                                                                                                             
    src/stellarpunk/generate/core.py:2085: error: Argument 1 has incompatible type "tuple[signedinteger[_64Bit], int]"; expected "_SupportsArray[dtype[Never]] | _NestedSequence[_SupportsArray[dtype[Never]]]"  [arg-type]                                                                                                                                                                                                             
    src/stellarpunk/generate/core.py:2086: error: Argument 1 has incompatible type "tuple[signedinteger[_64Bit], int]"; expected "_SupportsArray[dtype[Never]] | _NestedSequence[_SupportsArray[dtype[Never]]]"  [arg-type]                                                                                                                                                                                                             
    src/stellarpunk/generate/core.py:2087: error: Argument 6 to "_random_bipartite_graph" of "UniverseGenerator" has incompatible type "ndarray[Any, Any]"; expected "float"  [arg-type]
    src/stellarpunk/generate/core.py:2248: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[signedinteger[_64Bit]]]", variable has type "ndarray[tuple[int], dtype[signedinteger[_64Bit]]]")  [assignment]
    src/stellarpunk/generate/core.py:2249: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                         
    src/stellarpunk/generate/core.py:2250: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/generate/core.py:2253: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[float64]]")  [assignment]
    src/stellarpunk/generate/core.py:2369: error: Value of type "float64" is not indexable  [index]
    src/stellarpunk/generate/core.py:2370: error: Value of type "float64" is not indexable  [index]
    src/stellarpunk/generate/core.py:2371: error: Value of type "float64" is not indexable  [index]
    src/stellarpunk/generate/core.py:2372: error: Value of type "float64" is not indexable  [index]
    src/stellarpunk/generate/core.py:2381: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "float64")  [assignment]
    src/stellarpunk/generate/core.py:2382: error: Incompatible types in assignment (expression has type "float", variable has type "float64")  [assignment]
    src/stellarpunk/generate/core.py:2389: error: Value of type "float64" is not indexable  [index]
    src/stellarpunk/generate/core.py:2390: error: Value of type "float64" is not indexable  [index]
    src/stellarpunk/generate/core.py:2391: error: Value of type "float64" is not indexable  [index]
    src/stellarpunk/generate/core.py:2392: error: Value of type "float64" is not indexable  [index]
    src/stellarpunk/econ_sim.py:277: error: Incompatible types in assignment (expression has type "int", variable has type "signedinteger[_32Bit | _64Bit]")  [assignment]
    src/stellarpunk/econ_sim.py:512: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:515: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:519: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:545: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:549: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:560: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:565: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:572: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:578: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:595: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:601: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:705: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]
    src/stellarpunk/econ_sim.py:717: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]
    src/stellarpunk/econ_sim.py:1105: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/econ_sim.py:1111: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/econ_sim.py:1114: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/econ_sim.py:1147: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/econ_sim.py:1326: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/econ_sim.py:1652: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int], dtype[float64]]")  [assignment]
    src/stellarpunk/econ_sim.py:1657: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int], dtype[float64]]")  [assignment]
    src/stellarpunk/econ_sim.py:1751: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/econ_sim.py:1754: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/econ_sim.py:1783: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/econ_sim.py:1804: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/serialization/intel.py:233: error: Incompatible types in assignment (expression has type "dict[int, tuple[float64, ...]]", variable has type "dict[int, tuple[float, float]]")  [assignment]
    src/stellarpunk/serialization/intel.py:234: error: Incompatible types in assignment (expression has type "dict[int, tuple[float64, ...]]", variable has type "dict[int, tuple[float, float]]")  [assignment]
    src/stellarpunk/serialization/econ.py:86: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/serialization/econ.py:87: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[Any]]")  [assignment]
    src/stellarpunk/serialization/econ.py:88: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/interface/ui_util.py:406: error: Function is missing a type annotation  [no-untyped-def]
    src/stellarpunk/interface/pilot.py:556: error: Incompatible types in assignment (expression has type "float", variable has type "float64")  [assignment]
    Found 59 errors in 8 files (checked 74 source files)
    err                     : 
    out                     : src/stellarpunk/core/base.py:18: \x1b[1m ... 18089 more characters
    platform                :      linux
    python_version          :       3_13
    roundtrip_time          :     76.256
    stats                   : {'validate_meta_time': 0.0009768009185791016, 'files_parsed': 437, 'modules_parsed': 122, 'stubs_parsed': 315, 'parse_time': 2.2808902263641357, 'find_module_time': 0.14767193794250488, 'find_module_calls': 7948, 'graph_size': 437, 'stubs_found': 315, 'graph_load_time': 2.5956292152404785, 'fm_cache_size': 3583, 'sccs_left': 0, 'nodes_left': 0, 'cache_commit_time': 1.9073486328125e-06, 'load_fg_deps_time': 1.6689300537109375e-06}
    status                  :          1
    xxx numpy.testing._private ['PIL', 'PIL.ExifTags', 'PIL.GifImagePlugin', 'PIL.GimpGradientFile', 'PIL.GimpPaletteFile', 'PIL.Image', 'PIL.ImageChops', 'PIL.ImageCms', 'PIL.ImageColor', 'PIL.ImageFile', 'PIL.ImageFilter', 'PIL.ImageMath', 'PIL.ImageMode', 'PIL.ImageOps', 'PIL.ImagePalette', 'PIL.ImageQt', 'PIL.ImageSequence', 'PIL.PaletteFile', 'PIL.TiffImagePlugin', 'PIL.TiffTags', 'PIL._binary', 'PIL._deprecate', 'PIL._imaging', 'PIL._imagingcms', 'PIL._imagingmath', 'PIL._typing', 'PIL._util', 'PIL._version', '__future__', '_ast', '_asyncio', '_bisect', '_blake2', '_bz2', '_codecs', '_collections_abc', '_compression', '_contextvars', '_ctypes', '_curses', '_decimal', '_frozen_importlib', '_frozen_importlib_external', '_hashlib', '_heapq', '_io', '_lsprof', '_operator', '_pickle', '_queue', '_sitebuiltins', '_socket', '_ssl', '_struct', '_thread', '_typeshed', '_typeshed.importlib', '_warnings', '_weakref', '_weakrefset', 'abc', 'argparse', 'array', 'ast', 'asyncio', 'asyncio.base_events', 'asyncio.coroutines', 'asyncio.events', 'asyncio.exceptions', 'asyncio.futures', 'asyncio.locks', 'asyncio.mixins', 'asyncio.protocols', 'asyncio.queues', 'asyncio.runners', 'asyncio.selector_events', 'asyncio.streams', 'asyncio.subprocess', 'asyncio.taskgroups', 'asyncio.tasks', 'asyncio.threads', 'asyncio.timeouts', 'asyncio.transports', 'asyncio.unix_events', 'atexit', 'bdb', 'bisect', 'builtins', 'bz2', 'cProfile', 'cmd', 'codecs', 'collections', 'collections.abc', 'concurrent', 'concurrent.futures', 'concurrent.futures._base', 'concurrent.futures.process', 'concurrent.futures.thread', 'contextlib', 'contextvars', 'copy', 'copyreg', 'ctypes', 'ctypes._endian', 'curses', 'curses.ascii', 'curses.textpad', 'dataclasses', 'datetime', 'decimal', 'dis', 'email', 'email._policybase', 'email.charset', 'email.contentmanager', 'email.errors', 'email.header', 'email.message', 'email.policy', 'enum', 'fcntl', 'fractions', 'functools', 'gc', 'genericpath', 'glob', 'gzip', 'hashlib', 'heapq', 'imageio', 'imageio.config', 'imageio.config.extensions', 'imageio.config.plugins', 'imageio.core', 'imageio.core.fetching', 'imageio.core.findlib', 'imageio.core.format', 'imageio.core.imopen', 'imageio.core.legacy_plugin_wrapper', 'imageio.core.request', 'imageio.core.util', 'imageio.core.v3_plugin_api', 'imageio.plugins', 'imageio.plugins.opencv', 'imageio.plugins.pillow', 'imageio.plugins.pyav', 'imageio.plugins.rawpy', 'imageio.plugins.tifffile_v3', 'imageio.typing', 'imageio.v2', 'imageio.v3', 'importlib', 'importlib._abc', 'importlib._bootstrap', 'importlib._bootstrap_external', 'importlib.abc', 'importlib.machinery', 'importlib.metadata', 'importlib.metadata._meta', 'importlib.readers', 'importlib.resources', 'importlib.resources._common', 'importlib.resources._functional', 'importlib.resources.abc', 'inspect', 'io', 'itertools', 'json', 'json.decoder', 'json.encoder', 'logging', 'math', 'mmap', 'multiprocessing', 'multiprocessing.connection', 'multiprocessing.context', 'multiprocessing.managers', 'multiprocessing.pool', 'multiprocessing.popen_fork', 'multiprocessing.popen_forkserver', 'multiprocessing.popen_spawn_posix', 'multiprocessing.popen_spawn_win32', 'multiprocessing.process', 'multiprocessing.queues', 'multiprocessing.reduction', 'multiprocessing.shared_memory', 'multiprocessing.sharedctypes', 'multiprocessing.spawn', 'multiprocessing.synchronize', 'multiprocessing.util', 'numbers', 'numpy', 'numpy.__config__', 'numpy._array_api_info', 'numpy._core', 'numpy._core._asarray', 'numpy._core._internal', 'numpy._core._type_aliases', 'numpy._core._ufunc_config', 'numpy._core.arrayprint', 'numpy._core.defchararray', 'numpy._core.einsumfunc', 'numpy._core.fromnumeric', 'numpy._core.function_base', 'numpy._core.multiarray', 'numpy._core.numeric', 'numpy._core.numerictypes', 'numpy._core.records', 'numpy._core.shape_base', 'numpy._core.strings', 'numpy._expired_attrs_2_0', 'numpy._globals', 'numpy._pytesttester', 'numpy._typing', 'numpy._typing._add_docstring', 'numpy._typing._array_like', 'numpy._typing._callable', 'numpy._typing._char_codes', 'numpy._typing._dtype_like', 'numpy._typing._extended_precision', 'numpy._typing._nbit', 'numpy._typing._nbit_base', 'numpy._typing._nested_sequence', 'numpy._typing._scalars', 'numpy._typing._shape', 'numpy._typing._ufunc', 'numpy._utils', 'numpy._utils._convertions', 'numpy.char', 'numpy.core', 'numpy.ctypeslib', 'numpy.dtypes', 'numpy.exceptions', 'numpy.f2py', 'numpy.fft', 'numpy.fft._helper', 'numpy.fft._pocketfft', 'numpy.lib', 'numpy.lib._array_utils_impl', 'numpy.lib._arraypad_impl', 'numpy.lib._arraysetops_impl', 'numpy.lib._arrayterator_impl', 'numpy.lib._datasource', 'numpy.lib._function_base_impl', 'numpy.lib._histograms_impl', 'numpy.lib._index_tricks_impl', 'numpy.lib._nanfunctions_impl', 'numpy.lib._npyio_impl', 'numpy.lib._polynomial_impl', 'numpy.lib._scimath_impl', 'numpy.lib._shape_base_impl', 'numpy.lib._stride_tricks_impl', 'numpy.lib._twodim_base_impl', 'numpy.lib._type_check_impl', 'numpy.lib._ufunclike_impl', 'numpy.lib._utils_impl', 'numpy.lib._version', 'numpy.lib.array_utils', 'numpy.lib.format', 'numpy.lib.introspect', 'numpy.lib.mixins', 'numpy.lib.npyio', 'numpy.lib.scimath', 'numpy.lib.stride_tricks', 'numpy.linalg', 'numpy.linalg._linalg', 'numpy.ma', 'numpy.ma.core', 'numpy.ma.extras', 'numpy.ma.mrecords', 'numpy.matlib', 'numpy.matrixlib', 'numpy.matrixlib.defmatrix', 'numpy.polynomial', 'numpy.polynomial._polybase', 'numpy.polynomial._polytypes', 'numpy.polynomial.chebyshev', 'numpy.polynomial.hermite', 'numpy.polynomial.hermite_e', 'numpy.polynomial.laguerre', 'numpy.polynomial.legendre', 'numpy.polynomial.polynomial', 'numpy.polynomial.polyutils', 'numpy.random', 'numpy.random._generator', 'numpy.random._mt19937', 'numpy.random._pcg64', 'numpy.random._philox', 'numpy.random._sfc64', 'numpy.random.bit_generator', 'numpy.random.mtrand', 'numpy.rec', 'numpy.strings', 'numpy.testing', 'numpy.testing._private.utils', 'numpy.testing.overrides', 'numpy.typing', 'numpy.version', 'opcode', 'operator', 'os', 'os.path', 'pathlib', 'pdb', 'pickle', 'posixpath', 'profile', 'pstats', 'pydoc', 'pyexpat', 'pyexpat.errors', 'pyexpat.model', 'queue', 're', 'reprlib', 'resource', 'selectors', 'shutil', 'signal', 'socket', 'sre_compile', 'sre_constants', 'sre_parse', 'ssl', 'stellarpunk', 'stellarpunk.agenda', 'stellarpunk.config', 'stellarpunk.core', 'stellarpunk.core.base', 'stellarpunk.core.character', 'stellarpunk.core.combat', 'stellarpunk.core.entity_order_watch', 'stellarpunk.core.gamestate', 'stellarpunk.core.order', 'stellarpunk.core.production_chain', 'stellarpunk.core.sector', 'stellarpunk.core.sector_entity', 'stellarpunk.core.ship', 'stellarpunk.data', 'stellarpunk.dialog', 'stellarpunk.econ', 'stellarpunk.econ_sim', 'stellarpunk.effects', 'stellarpunk.events', 'stellarpunk.events.core', 'stellarpunk.events.events', 'stellarpunk.generate', 'stellarpunk.generate.core', 'stellarpunk.generate.markov', 'stellarpunk.goap_toy', 'stellarpunk.hist_extract', 'stellarpunk.intel', 'stellarpunk.interface', 'stellarpunk.interface.audio', 'stellarpunk.interface.character', 'stellarpunk.interface.command_input', 'stellarpunk.interface.comms', 'stellarpunk.interface.manager', 'stellarpunk.interface.pilot', 'stellarpunk.interface.presenter', 'stellarpunk.interface.sector', 'stellarpunk.interface.starfield', 'stellarpunk.interface.startup', 'stellarpunk.interface.station', 'stellarpunk.interface.ui_events', 'stellarpunk.interface.ui_util', 'stellarpunk.interface.universe', 'stellarpunk.narrative', 'stellarpunk.narrative.director', 'stellarpunk.narrative.rule_parser', 'stellarpunk.orders', 'stellarpunk.orders.collision', 'stellarpunk.orders.core', 'stellarpunk.orders.movement', 'stellarpunk.orders.steering', 'stellarpunk.predicates', 'stellarpunk.sensors', 'stellarpunk.serialization', 'stellarpunk.serialization.agenda', 'stellarpunk.serialization.character', 'stellarpunk.serialization.combat', 'stellarpunk.serialization.econ', 'stellarpunk.serialization.effect', 'stellarpunk.serialization.events', 'stellarpunk.serialization.gamestate', 'stellarpunk.serialization.intel', 'stellarpunk.serialization.movement', 'stellarpunk.serialization.order', 'stellarpunk.serialization.order_core', 'stellarpunk.serialization.save_game', 'stellarpunk.serialization.sector', 'stellarpunk.serialization.sector_entity', 'stellarpunk.serialization.sensors', 'stellarpunk.serialization.serialize_econ_sim', 'stellarpunk.serialization.util', 'stellarpunk.sim', 'stellarpunk.spunk_image', 'stellarpunk.task_schedule', 'stellarpunk.util', 'string', 'struct', 'subprocess', 'sys', 'sys._monitoring', 'tarfile', 'tempfile', 'termios', 'textwrap', 'threading', 'time', 'types', 'typing', 'typing_extensions', 'unittest', 'unittest._log', 'unittest.async_case', 'unittest.case', 'unittest.loader', 'unittest.main', 'unittest.result', 'unittest.runner', 'unittest.signals', 'unittest.suite', 'uuid', 'warnings', 'weakref', 'xml', 'xml.etree.ElementTree', 'xml.parsers', 'xml.parsers.expat', 'zipfile', 'zipfile._path', 'zipimport', 'zlib']
    xxx xml.etree ['PIL', 'PIL.ExifTags', 'PIL.GifImagePlugin', 'PIL.GimpGradientFile', 'PIL.GimpPaletteFile', 'PIL.Image', 'PIL.ImageChops', 'PIL.ImageCms', 'PIL.ImageColor', 'PIL.ImageFile', 'PIL.ImageFilter', 'PIL.ImageMath', 'PIL.ImageMode', 'PIL.ImageOps', 'PIL.ImagePalette', 'PIL.ImageQt', 'PIL.ImageSequence', 'PIL.PaletteFile', 'PIL.TiffImagePlugin', 'PIL.TiffTags', 'PIL._binary', 'PIL._deprecate', 'PIL._imaging', 'PIL._imagingcms', 'PIL._imagingmath', 'PIL._typing', 'PIL._util', 'PIL._version', '__future__', '_ast', '_asyncio', '_bisect', '_blake2', '_bz2', '_codecs', '_collections_abc', '_compression', '_contextvars', '_ctypes', '_curses', '_decimal', '_frozen_importlib', '_frozen_importlib_external', '_hashlib', '_heapq', '_io', '_lsprof', '_operator', '_pickle', '_queue', '_sitebuiltins', '_socket', '_ssl', '_struct', '_thread', '_typeshed', '_typeshed.importlib', '_warnings', '_weakref', '_weakrefset', 'abc', 'argparse', 'array', 'ast', 'asyncio', 'asyncio.base_events', 'asyncio.coroutines', 'asyncio.events', 'asyncio.exceptions', 'asyncio.futures', 'asyncio.locks', 'asyncio.mixins', 'asyncio.protocols', 'asyncio.queues', 'asyncio.runners', 'asyncio.selector_events', 'asyncio.streams', 'asyncio.subprocess', 'asyncio.taskgroups', 'asyncio.tasks', 'asyncio.threads', 'asyncio.timeouts', 'asyncio.transports', 'asyncio.unix_events', 'atexit', 'bdb', 'bisect', 'builtins', 'bz2', 'cProfile', 'cmd', 'codecs', 'collections', 'collections.abc', 'concurrent', 'concurrent.futures', 'concurrent.futures._base', 'concurrent.futures.process', 'concurrent.futures.thread', 'contextlib', 'contextvars', 'copy', 'copyreg', 'ctypes', 'ctypes._endian', 'curses', 'curses.ascii', 'curses.textpad', 'dataclasses', 'datetime', 'decimal', 'dis', 'email', 'email._policybase', 'email.charset', 'email.contentmanager', 'email.errors', 'email.header', 'email.message', 'email.policy', 'enum', 'fcntl', 'fractions', 'functools', 'gc', 'genericpath', 'glob', 'gzip', 'hashlib', 'heapq', 'imageio', 'imageio.config', 'imageio.config.extensions', 'imageio.config.plugins', 'imageio.core', 'imageio.core.fetching', 'imageio.core.findlib', 'imageio.core.format', 'imageio.core.imopen', 'imageio.core.legacy_plugin_wrapper', 'imageio.core.request', 'imageio.core.util', 'imageio.core.v3_plugin_api', 'imageio.plugins', 'imageio.plugins.opencv', 'imageio.plugins.pillow', 'imageio.plugins.pyav', 'imageio.plugins.rawpy', 'imageio.plugins.tifffile_v3', 'imageio.typing', 'imageio.v2', 'imageio.v3', 'importlib', 'importlib._abc', 'importlib._bootstrap', 'importlib._bootstrap_external', 'importlib.abc', 'importlib.machinery', 'importlib.metadata', 'importlib.metadata._meta', 'importlib.readers', 'importlib.resources', 'importlib.resources._common', 'importlib.resources._functional', 'importlib.resources.abc', 'inspect', 'io', 'itertools', 'json', 'json.decoder', 'json.encoder', 'logging', 'math', 'mmap', 'multiprocessing', 'multiprocessing.connection', 'multiprocessing.context', 'multiprocessing.managers', 'multiprocessing.pool', 'multiprocessing.popen_fork', 'multiprocessing.popen_forkserver', 'multiprocessing.popen_spawn_posix', 'multiprocessing.popen_spawn_win32', 'multiprocessing.process', 'multiprocessing.queues', 'multiprocessing.reduction', 'multiprocessing.shared_memory', 'multiprocessing.sharedctypes', 'multiprocessing.spawn', 'multiprocessing.synchronize', 'multiprocessing.util', 'numbers', 'numpy', 'numpy.__config__', 'numpy._array_api_info', 'numpy._core', 'numpy._core._asarray', 'numpy._core._internal', 'numpy._core._type_aliases', 'numpy._core._ufunc_config', 'numpy._core.arrayprint', 'numpy._core.defchararray', 'numpy._core.einsumfunc', 'numpy._core.fromnumeric', 'numpy._core.function_base', 'numpy._core.multiarray', 'numpy._core.numeric', 'numpy._core.numerictypes', 'numpy._core.records', 'numpy._core.shape_base', 'numpy._core.strings', 'numpy._expired_attrs_2_0', 'numpy._globals', 'numpy._pytesttester', 'numpy._typing', 'numpy._typing._add_docstring', 'numpy._typing._array_like', 'numpy._typing._callable', 'numpy._typing._char_codes', 'numpy._typing._dtype_like', 'numpy._typing._extended_precision', 'numpy._typing._nbit', 'numpy._typing._nbit_base', 'numpy._typing._nested_sequence', 'numpy._typing._scalars', 'numpy._typing._shape', 'numpy._typing._ufunc', 'numpy._utils', 'numpy._utils._convertions', 'numpy.char', 'numpy.core', 'numpy.ctypeslib', 'numpy.dtypes', 'numpy.exceptions', 'numpy.f2py', 'numpy.fft', 'numpy.fft._helper', 'numpy.fft._pocketfft', 'numpy.lib', 'numpy.lib._array_utils_impl', 'numpy.lib._arraypad_impl', 'numpy.lib._arraysetops_impl', 'numpy.lib._arrayterator_impl', 'numpy.lib._datasource', 'numpy.lib._function_base_impl', 'numpy.lib._histograms_impl', 'numpy.lib._index_tricks_impl', 'numpy.lib._nanfunctions_impl', 'numpy.lib._npyio_impl', 'numpy.lib._polynomial_impl', 'numpy.lib._scimath_impl', 'numpy.lib._shape_base_impl', 'numpy.lib._stride_tricks_impl', 'numpy.lib._twodim_base_impl', 'numpy.lib._type_check_impl', 'numpy.lib._ufunclike_impl', 'numpy.lib._utils_impl', 'numpy.lib._version', 'numpy.lib.array_utils', 'numpy.lib.format', 'numpy.lib.introspect', 'numpy.lib.mixins', 'numpy.lib.npyio', 'numpy.lib.scimath', 'numpy.lib.stride_tricks', 'numpy.linalg', 'numpy.linalg._linalg', 'numpy.ma', 'numpy.ma.core', 'numpy.ma.extras', 'numpy.ma.mrecords', 'numpy.matlib', 'numpy.matrixlib', 'numpy.matrixlib.defmatrix', 'numpy.polynomial', 'numpy.polynomial._polybase', 'numpy.polynomial._polytypes', 'numpy.polynomial.chebyshev', 'numpy.polynomial.hermite', 'numpy.polynomial.hermite_e', 'numpy.polynomial.laguerre', 'numpy.polynomial.legendre', 'numpy.polynomial.polynomial', 'numpy.polynomial.polyutils', 'numpy.random', 'numpy.random._generator', 'numpy.random._mt19937', 'numpy.random._pcg64', 'numpy.random._philox', 'numpy.random._sfc64', 'numpy.random.bit_generator', 'numpy.random.mtrand', 'numpy.rec', 'numpy.strings', 'numpy.testing', 'numpy.testing._private.utils', 'numpy.testing.overrides', 'numpy.typing', 'numpy.version', 'opcode', 'operator', 'os', 'os.path', 'pathlib', 'pdb', 'pickle', 'posixpath', 'profile', 'pstats', 'pydoc', 'pyexpat', 'pyexpat.errors', 'pyexpat.model', 'queue', 're', 'reprlib', 'resource', 'selectors', 'shutil', 'signal', 'socket', 'sre_compile', 'sre_constants', 'sre_parse', 'ssl', 'stellarpunk', 'stellarpunk.agenda', 'stellarpunk.config', 'stellarpunk.core', 'stellarpunk.core.base', 'stellarpunk.core.character', 'stellarpunk.core.combat', 'stellarpunk.core.entity_order_watch', 'stellarpunk.core.gamestate', 'stellarpunk.core.order', 'stellarpunk.core.production_chain', 'stellarpunk.core.sector', 'stellarpunk.core.sector_entity', 'stellarpunk.core.ship', 'stellarpunk.data', 'stellarpunk.dialog', 'stellarpunk.econ', 'stellarpunk.econ_sim', 'stellarpunk.effects', 'stellarpunk.events', 'stellarpunk.events.core', 'stellarpunk.events.events', 'stellarpunk.generate', 'stellarpunk.generate.core', 'stellarpunk.generate.markov', 'stellarpunk.goap_toy', 'stellarpunk.hist_extract', 'stellarpunk.intel', 'stellarpunk.interface', 'stellarpunk.interface.audio', 'stellarpunk.interface.character', 'stellarpunk.interface.command_input', 'stellarpunk.interface.comms', 'stellarpunk.interface.manager', 'stellarpunk.interface.pilot', 'stellarpunk.interface.presenter', 'stellarpunk.interface.sector', 'stellarpunk.interface.starfield', 'stellarpunk.interface.startup', 'stellarpunk.interface.station', 'stellarpunk.interface.ui_events', 'stellarpunk.interface.ui_util', 'stellarpunk.interface.universe', 'stellarpunk.narrative', 'stellarpunk.narrative.director', 'stellarpunk.narrative.rule_parser', 'stellarpunk.orders', 'stellarpunk.orders.collision', 'stellarpunk.orders.core', 'stellarpunk.orders.movement', 'stellarpunk.orders.steering', 'stellarpunk.predicates', 'stellarpunk.sensors', 'stellarpunk.serialization', 'stellarpunk.serialization.agenda', 'stellarpunk.serialization.character', 'stellarpunk.serialization.combat', 'stellarpunk.serialization.econ', 'stellarpunk.serialization.effect', 'stellarpunk.serialization.events', 'stellarpunk.serialization.gamestate', 'stellarpunk.serialization.intel', 'stellarpunk.serialization.movement', 'stellarpunk.serialization.order', 'stellarpunk.serialization.order_core', 'stellarpunk.serialization.save_game', 'stellarpunk.serialization.sector', 'stellarpunk.serialization.sector_entity', 'stellarpunk.serialization.sensors', 'stellarpunk.serialization.serialize_econ_sim', 'stellarpunk.serialization.util', 'stellarpunk.sim', 'stellarpunk.spunk_image', 'stellarpunk.task_schedule', 'stellarpunk.util', 'string', 'struct', 'subprocess', 'sys', 'sys._monitoring', 'tarfile', 'tempfile', 'termios', 'textwrap', 'threading', 'time', 'types', 'typing', 'typing_extensions', 'unittest', 'unittest._log', 'unittest.async_case', 'unittest.case', 'unittest.loader', 'unittest.main', 'unittest.result', 'unittest.runner', 'unittest.signals', 'unittest.suite', 'uuid', 'warnings', 'weakref', 'xml', 'xml.etree.ElementTree', 'xml.parsers', 'xml.parsers.expat', 'zipfile', 'zipfile._path', 'zipimport', 'zlib']
    ==== update 'numpy.testing._private', 'xml.etree' ====
    previous targets with errors: ['stellarpunk.core.base', 'stellarpunk.econ_sim.EconomyDataLogger.source_resources', 'stellarpunk.econ_sim.EconomySimulation.initialize', 'stellarpunk.econ_sim.EconomySimulation.run', 'stellarpunk.econ_sim.EconomySimulation.set_prices', 'stellarpunk.econ_sim.EconomySimulation.source_resources', 'stellarpunk.generate.core.UniverseGenerator._generate_chain', 'stellarpunk.generate.core.UniverseGenerator._prepare_projectile_spawn_pattern', 'stellarpunk.generate.core.UniverseGenerator.gen_sector_location', 'stellarpunk.generate.core.UniverseGenerator.generate_sector_topology', 'stellarpunk.generate.core.UniverseGenerator.spawn_habitable_sector', 'stellarpunk.interface.pilot.PilotView.command_list', 'stellarpunk.interface.ui_util.MeterMenu.__init__', 'stellarpunk.orders.core.DisembarkToEntity.disembark_to', 'stellarpunk.serialization.econ.StationAgentSaver._load_econ_agent', 'stellarpunk.serialization.intel.EconAgentIntelSaver._load_entity_intel']
    --- update single 'numpy.testing._private' ---
    delete module 'numpy.testing._private'
    triggered: ['<numpy.testing._private>', '<numpy.testing._private[wildcard]>']
    triggered: []
    update once: numpy.testing._private in 0.001s - 1 left
    --- update single 'xml.etree' ---
    update once: xml.etree in 0.000s - 0 left
    process target with error: stellarpunk.interface.pilot.PilotView.command_list
    process target with error: stellarpunk.generate.core.UniverseGenerator.gen_sector_location
    process target with error: stellarpunk.orders.core.DisembarkToEntity.disembark_to
    process target with error: stellarpunk.generate.core.UniverseGenerator._generate_chain
    process target with error: stellarpunk.econ_sim.EconomySimulation.source_resources
    process target with error: stellarpunk.generate.core.UniverseGenerator.spawn_habitable_sector
    process target with error: stellarpunk.generate.core.UniverseGenerator.generate_sector_topology
    process target with error: stellarpunk.interface.ui_util.MeterMenu.__init__
    process target with error: stellarpunk.serialization.econ.StationAgentSaver._load_econ_agent
    process target with error: stellarpunk.econ_sim.EconomyDataLogger.source_resources
    process target with error: stellarpunk.econ_sim.EconomySimulation.run
    process target with error: stellarpunk.econ_sim.EconomySimulation.set_prices
    process target with error: stellarpunk.core.base
    process target with error: stellarpunk.econ_sim.EconomySimulation.initialize
    process target with error: stellarpunk.generate.core.UniverseGenerator._prepare_projectile_spawn_pattern
    process target with error: stellarpunk.serialization.intel.EconAgentIntelSaver._load_entity_intel
    triggered: []
    src/stellarpunk/core/base.py:18: error: Module "stellarpunk" has no attribute "_version"  [attr-defined]
    src/stellarpunk/orders/core.py:359: error: Incompatible types in assignment (expression has type "floating[Any] | float64", variable has type "float64")  [assignment]
    src/stellarpunk/generate/core.py:541: error: Incompatible types in assignment (expression has type "float | ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, ...], dtype[float64]]")  [assignment]
    src/stellarpunk/generate/core.py:845: error: Name "loc" already defined on line 841  [no-redef]
    src/stellarpunk/generate/core.py:1708: error: Argument 1 to "spawn_character" of "UniverseGenerator" has incompatible type "Asset"; expected "SectorEntity"  [arg-type]
    src/stellarpunk/generate/core.py:1709: error: Argument 2 to "setup_captain" of "UniverseGenerator" has incompatible type "Asset"; expected "SectorEntity"  [arg-type]
    src/stellarpunk/generate/core.py:1712: error: "Asset" has no attribute "captain"  [attr-defined]
    src/stellarpunk/generate/core.py:2082: error: Argument 1 to "_random_bipartite_graph" of "UniverseGenerator" has incompatible type "signedinteger[_64Bit]"; expected "int"  [arg-type]
    src/stellarpunk/generate/core.py:2083: error: Argument 2 to "_random_bipartite_graph" of "UniverseGenerator" has incompatible type "signedinteger[_64Bit]"; expected "int"  [arg-type]
    src/stellarpunk/generate/core.py:2084: error: Argument 3 to "_random_bipartite_graph" of "UniverseGenerator" has incompatible type "ndarray[tuple[int, ...], dtype[signedinteger[_64Bit]]]"; expected "int"  [arg-type]                                                                                                                                                                                                             
    src/stellarpunk/generate/core.py:2085: error: Argument 1 has incompatible type "tuple[signedinteger[_64Bit], int]"; expected "_SupportsArray[dtype[Never]] | _NestedSequence[_SupportsArray[dtype[Never]]]"  [arg-type]                                                                                                                                                                                                             
    src/stellarpunk/generate/core.py:2086: error: Argument 1 has incompatible type "tuple[signedinteger[_64Bit], int]"; expected "_SupportsArray[dtype[Never]] | _NestedSequence[_SupportsArray[dtype[Never]]]"  [arg-type]                                                                                                                                                                                                             
    src/stellarpunk/generate/core.py:2087: error: Argument 6 to "_random_bipartite_graph" of "UniverseGenerator" has incompatible type "ndarray[Any, Any]"; expected "float"  [arg-type]
    src/stellarpunk/generate/core.py:2248: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[signedinteger[_64Bit]]]", variable has type "ndarray[tuple[int], dtype[signedinteger[_64Bit]]]")  [assignment]
    src/stellarpunk/generate/core.py:2249: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                         
    src/stellarpunk/generate/core.py:2250: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/generate/core.py:2253: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[float64]]")  [assignment]
    src/stellarpunk/generate/core.py:2369: error: Value of type "float64" is not indexable  [index]
    src/stellarpunk/generate/core.py:2370: error: Value of type "float64" is not indexable  [index]
    src/stellarpunk/generate/core.py:2371: error: Value of type "float64" is not indexable  [index]
    src/stellarpunk/generate/core.py:2372: error: Value of type "float64" is not indexable  [index]
    src/stellarpunk/generate/core.py:2381: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "float64")  [assignment]
    src/stellarpunk/generate/core.py:2382: error: Incompatible types in assignment (expression has type "float", variable has type "float64")  [assignment]
    src/stellarpunk/generate/core.py:2389: error: Value of type "float64" is not indexable  [index]
    src/stellarpunk/generate/core.py:2390: error: Value of type "float64" is not indexable  [index]
    src/stellarpunk/generate/core.py:2391: error: Value of type "float64" is not indexable  [index]
    src/stellarpunk/generate/core.py:2392: error: Value of type "float64" is not indexable  [index]
    src/stellarpunk/econ_sim.py:277: error: Incompatible types in assignment (expression has type "int", variable has type "signedinteger[_32Bit | _64Bit]")  [assignment]
    src/stellarpunk/econ_sim.py:512: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:515: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:519: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:545: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:549: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:560: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:565: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:572: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:578: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:595: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:601: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/econ_sim.py:705: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]
    src/stellarpunk/econ_sim.py:717: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]
    src/stellarpunk/econ_sim.py:1105: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/econ_sim.py:1111: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/econ_sim.py:1114: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/econ_sim.py:1147: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/econ_sim.py:1326: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/econ_sim.py:1652: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int], dtype[float64]]")  [assignment]
    src/stellarpunk/econ_sim.py:1657: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int], dtype[float64]]")  [assignment]
    src/stellarpunk/econ_sim.py:1751: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/econ_sim.py:1754: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/econ_sim.py:1783: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/econ_sim.py:1804: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[float64]]", variable has type "ndarray[tuple[int, int], dtype[float64]]")  [assignment]                                                                                                                                                                                                              
    src/stellarpunk/serialization/intel.py:233: error: Incompatible types in assignment (expression has type "dict[int, tuple[float64, ...]]", variable has type "dict[int, tuple[float, float]]")  [assignment]
    src/stellarpunk/serialization/intel.py:234: error: Incompatible types in assignment (expression has type "dict[int, tuple[float64, ...]]", variable has type "dict[int, tuple[float, float]]")  [assignment]
    src/stellarpunk/serialization/econ.py:86: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/serialization/econ.py:87: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[Any]]")  [assignment]
    src/stellarpunk/serialization/econ.py:88: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[Any]]", variable has type "ndarray[tuple[int], dtype[float64]]")  [assignment]                                                                                                                                                                                                               
    src/stellarpunk/interface/ui_util.py:406: error: Function is missing a type annotation  [no-untyped-def]
    src/stellarpunk/interface/pilot.py:556: error: Incompatible types in assignment (expression has type "float", variable has type "float64")  [assignment]
    Found 59 errors in 8 files (checked 74 source files)
    err                     : 
    out                     : src/stellarpunk/core/base.py:18: \x1b[1m ... 18089 more characters
    platform                :      linux
    python_version          :       3_13
    roundtrip_time          :     18.802
    stats                   : {'load_fg_deps_time': 5.245208740234375e-05, 'update_isolated_time': 0.0004661083221435547, 'propagate_time': 0.00017595291137695312, 'find_module_time': 0.0008432865142822266, 'find_module_calls': 10, 'find_changes_time': 0.0028734207153320312, 'fg_update_time': 0.0018589496612548828, 'refresh_suppressed_time': 0.009680747985839844, 'find_added_suppressed_time': 0.0018458366394042969, 'cleanup_time': 18.778390169143677}
    status                  :          1
    xxx xml.etree ['PIL', 'PIL.ExifTags', 'PIL.GifImagePlugin', 'PIL.GimpGradientFile', 'PIL.GimpPaletteFile', 'PIL.Image', 'PIL.ImageChops', 'PIL.ImageCms', 'PIL.ImageColor', 'PIL.ImageFile', 'PIL.ImageFilter', 'PIL.ImageMath', 'PIL.ImageMode', 'PIL.ImageOps', 'PIL.ImagePalette', 'PIL.ImageQt', 'PIL.ImageSequence', 'PIL.PaletteFile', 'PIL.TiffImagePlugin', 'PIL.TiffTags', 'PIL._binary', 'PIL._deprecate', 'PIL._imaging', 'PIL._imagingcms', 'PIL._imagingmath', 'PIL._typing', 'PIL._util', 'PIL._version', '__future__', '_ast', '_asyncio', '_bisect', '_blake2', '_bz2', '_codecs', '_collections_abc', '_compression', '_contextvars', '_ctypes', '_curses', '_decimal', '_frozen_importlib', '_frozen_importlib_external', '_hashlib', '_heapq', '_io', '_lsprof', '_operator', '_pickle', '_queue', '_sitebuiltins', '_socket', '_ssl', '_struct', '_thread', '_typeshed', '_typeshed.importlib', '_warnings', '_weakref', '_weakrefset', 'abc', 'argparse', 'array', 'ast', 'asyncio', 'asyncio.base_events', 'asyncio.coroutines', 'asyncio.events', 'asyncio.exceptions', 'asyncio.futures', 'asyncio.locks', 'asyncio.mixins', 'asyncio.protocols', 'asyncio.queues', 'asyncio.runners', 'asyncio.selector_events', 'asyncio.streams', 'asyncio.subprocess', 'asyncio.taskgroups', 'asyncio.tasks', 'asyncio.threads', 'asyncio.timeouts', 'asyncio.transports', 'asyncio.unix_events', 'atexit', 'bdb', 'bisect', 'builtins', 'bz2', 'cProfile', 'cmd', 'codecs', 'collections', 'collections.abc', 'concurrent', 'concurrent.futures', 'concurrent.futures._base', 'concurrent.futures.process', 'concurrent.futures.thread', 'contextlib', 'contextvars', 'copy', 'copyreg', 'ctypes', 'ctypes._endian', 'curses', 'curses.ascii', 'curses.textpad', 'dataclasses', 'datetime', 'decimal', 'dis', 'email', 'email._policybase', 'email.charset', 'email.contentmanager', 'email.errors', 'email.header', 'email.message', 'email.policy', 'enum', 'fcntl', 'fractions', 'functools', 'gc', 'genericpath', 'glob', 'gzip', 'hashlib', 'heapq', 'imageio', 'imageio.config', 'imageio.config.extensions', 'imageio.config.plugins', 'imageio.core', 'imageio.core.fetching', 'imageio.core.findlib', 'imageio.core.format', 'imageio.core.imopen', 'imageio.core.legacy_plugin_wrapper', 'imageio.core.request', 'imageio.core.util', 'imageio.core.v3_plugin_api', 'imageio.plugins', 'imageio.plugins.opencv', 'imageio.plugins.pillow', 'imageio.plugins.pyav', 'imageio.plugins.rawpy', 'imageio.plugins.tifffile_v3', 'imageio.typing', 'imageio.v2', 'imageio.v3', 'importlib', 'importlib._abc', 'importlib._bootstrap', 'importlib._bootstrap_external', 'importlib.abc', 'importlib.machinery', 'importlib.metadata', 'importlib.metadata._meta', 'importlib.readers', 'importlib.resources', 'importlib.resources._common', 'importlib.resources._functional', 'importlib.resources.abc', 'inspect', 'io', 'itertools', 'json', 'json.decoder', 'json.encoder', 'logging', 'math', 'mmap', 'multiprocessing', 'multiprocessing.connection', 'multiprocessing.context', 'multiprocessing.managers', 'multiprocessing.pool', 'multiprocessing.popen_fork', 'multiprocessing.popen_forkserver', 'multiprocessing.popen_spawn_posix', 'multiprocessing.popen_spawn_win32', 'multiprocessing.process', 'multiprocessing.queues', 'multiprocessing.reduction', 'multiprocessing.shared_memory', 'multiprocessing.sharedctypes', 'multiprocessing.spawn', 'multiprocessing.synchronize', 'multiprocessing.util', 'numbers', 'numpy', 'numpy.__config__', 'numpy._array_api_info', 'numpy._core', 'numpy._core._asarray', 'numpy._core._internal', 'numpy._core._type_aliases', 'numpy._core._ufunc_config', 'numpy._core.arrayprint', 'numpy._core.defchararray', 'numpy._core.einsumfunc', 'numpy._core.fromnumeric', 'numpy._core.function_base', 'numpy._core.multiarray', 'numpy._core.numeric', 'numpy._core.numerictypes', 'numpy._core.records', 'numpy._core.shape_base', 'numpy._core.strings', 'numpy._expired_attrs_2_0', 'numpy._globals', 'numpy._pytesttester', 'numpy._typing', 'numpy._typing._add_docstring', 'numpy._typing._array_like', 'numpy._typing._callable', 'numpy._typing._char_codes', 'numpy._typing._dtype_like', 'numpy._typing._extended_precision', 'numpy._typing._nbit', 'numpy._typing._nbit_base', 'numpy._typing._nested_sequence', 'numpy._typing._scalars', 'numpy._typing._shape', 'numpy._typing._ufunc', 'numpy._utils', 'numpy._utils._convertions', 'numpy.char', 'numpy.core', 'numpy.ctypeslib', 'numpy.dtypes', 'numpy.exceptions', 'numpy.f2py', 'numpy.fft', 'numpy.fft._helper', 'numpy.fft._pocketfft', 'numpy.lib', 'numpy.lib._array_utils_impl', 'numpy.lib._arraypad_impl', 'numpy.lib._arraysetops_impl', 'numpy.lib._arrayterator_impl', 'numpy.lib._datasource', 'numpy.lib._function_base_impl', 'numpy.lib._histograms_impl', 'numpy.lib._index_tricks_impl', 'numpy.lib._nanfunctions_impl', 'numpy.lib._npyio_impl', 'numpy.lib._polynomial_impl', 'numpy.lib._scimath_impl', 'numpy.lib._shape_base_impl', 'numpy.lib._stride_tricks_impl', 'numpy.lib._twodim_base_impl', 'numpy.lib._type_check_impl', 'numpy.lib._ufunclike_impl', 'numpy.lib._utils_impl', 'numpy.lib._version', 'numpy.lib.array_utils', 'numpy.lib.format', 'numpy.lib.introspect', 'numpy.lib.mixins', 'numpy.lib.npyio', 'numpy.lib.scimath', 'numpy.lib.stride_tricks', 'numpy.linalg', 'numpy.linalg._linalg', 'numpy.ma', 'numpy.ma.core', 'numpy.ma.extras', 'numpy.ma.mrecords', 'numpy.matlib', 'numpy.matrixlib', 'numpy.matrixlib.defmatrix', 'numpy.polynomial', 'numpy.polynomial._polybase', 'numpy.polynomial._polytypes', 'numpy.polynomial.chebyshev', 'numpy.polynomial.hermite', 'numpy.polynomial.hermite_e', 'numpy.polynomial.laguerre', 'numpy.polynomial.legendre', 'numpy.polynomial.polynomial', 'numpy.polynomial.polyutils', 'numpy.random', 'numpy.random._generator', 'numpy.random._mt19937', 'numpy.random._pcg64', 'numpy.random._philox', 'numpy.random._sfc64', 'numpy.random.bit_generator', 'numpy.random.mtrand', 'numpy.rec', 'numpy.strings', 'numpy.testing', 'numpy.testing._private.utils', 'numpy.testing.overrides', 'numpy.typing', 'numpy.version', 'opcode', 'operator', 'os', 'os.path', 'pathlib', 'pdb', 'pickle', 'posixpath', 'profile', 'pstats', 'pydoc', 'pyexpat', 'pyexpat.errors', 'pyexpat.model', 'queue', 're', 'reprlib', 'resource', 'selectors', 'shutil', 'signal', 'socket', 'sre_compile', 'sre_constants', 'sre_parse', 'ssl', 'stellarpunk', 'stellarpunk.agenda', 'stellarpunk.config', 'stellarpunk.core', 'stellarpunk.core.base', 'stellarpunk.core.character', 'stellarpunk.core.combat', 'stellarpunk.core.entity_order_watch', 'stellarpunk.core.gamestate', 'stellarpunk.core.order', 'stellarpunk.core.production_chain', 'stellarpunk.core.sector', 'stellarpunk.core.sector_entity', 'stellarpunk.core.ship', 'stellarpunk.data', 'stellarpunk.dialog', 'stellarpunk.econ', 'stellarpunk.econ_sim', 'stellarpunk.effects', 'stellarpunk.events', 'stellarpunk.events.core', 'stellarpunk.events.events', 'stellarpunk.generate', 'stellarpunk.generate.core', 'stellarpunk.generate.markov', 'stellarpunk.goap_toy', 'stellarpunk.hist_extract', 'stellarpunk.intel', 'stellarpunk.interface', 'stellarpunk.interface.audio', 'stellarpunk.interface.character', 'stellarpunk.interface.command_input', 'stellarpunk.interface.comms', 'stellarpunk.interface.manager', 'stellarpunk.interface.pilot', 'stellarpunk.interface.presenter', 'stellarpunk.interface.sector', 'stellarpunk.interface.starfield', 'stellarpunk.interface.startup', 'stellarpunk.interface.station', 'stellarpunk.interface.ui_events', 'stellarpunk.interface.ui_util', 'stellarpunk.interface.universe', 'stellarpunk.narrative', 'stellarpunk.narrative.director', 'stellarpunk.narrative.rule_parser', 'stellarpunk.orders', 'stellarpunk.orders.collision', 'stellarpunk.orders.core', 'stellarpunk.orders.movement', 'stellarpunk.orders.steering', 'stellarpunk.predicates', 'stellarpunk.sensors', 'stellarpunk.serialization', 'stellarpunk.serialization.agenda', 'stellarpunk.serialization.character', 'stellarpunk.serialization.combat', 'stellarpunk.serialization.econ', 'stellarpunk.serialization.effect', 'stellarpunk.serialization.events', 'stellarpunk.serialization.gamestate', 'stellarpunk.serialization.intel', 'stellarpunk.serialization.movement', 'stellarpunk.serialization.order', 'stellarpunk.serialization.order_core', 'stellarpunk.serialization.save_game', 'stellarpunk.serialization.sector', 'stellarpunk.serialization.sector_entity', 'stellarpunk.serialization.sensors', 'stellarpunk.serialization.serialize_econ_sim', 'stellarpunk.serialization.util', 'stellarpunk.sim', 'stellarpunk.spunk_image', 'stellarpunk.task_schedule', 'stellarpunk.util', 'string', 'struct', 'subprocess', 'sys', 'sys._monitoring', 'tarfile', 'tempfile', 'termios', 'textwrap', 'threading', 'time', 'types', 'typing', 'typing_extensions', 'unittest', 'unittest._log', 'unittest.async_case', 'unittest.case', 'unittest.loader', 'unittest.main', 'unittest.result', 'unittest.runner', 'unittest.signals', 'unittest.suite', 'uuid', 'warnings', 'weakref', 'xml', 'xml.etree.ElementTree', 'xml.parsers', 'xml.parsers.expat', 'zipfile', 'zipfile._path', 'zipimport', 'zlib']
    ==== update 'xml.etree' ====
    previous targets with errors: ['stellarpunk.core.base', 'stellarpunk.econ_sim.EconomyDataLogger.source_resources', 'stellarpunk.econ_sim.EconomySimulation.initialize', 'stellarpunk.econ_sim.EconomySimulation.run', 'stellarpunk.econ_sim.EconomySimulation.set_prices', 'stellarpunk.econ_sim.EconomySimulation.source_resources', 'stellarpunk.generate.core.UniverseGenerator._generate_chain', 'stellarpunk.generate.core.UniverseGenerator._prepare_projectile_spawn_pattern', 'stellarpunk.generate.core.UniverseGenerator.gen_sector_location', 'stellarpunk.generate.core.UniverseGenerator.generate_sector_topology', 'stellarpunk.generate.core.UniverseGenerator.spawn_habitable_sector', 'stellarpunk.interface.pilot.PilotView.command_list', 'stellarpunk.interface.ui_util.MeterMenu.__init__', 'stellarpunk.orders.core.DisembarkToEntity.disembark_to', 'stellarpunk.serialization.econ.StationAgentSaver._load_econ_agent', 'stellarpunk.serialization.intel.EconAgentIntelSaver._load_entity_intel']
    --- update single 'xml.etree' ---
    update once: xml.etree in 0.000s - 0 left
    process target with error: stellarpunk.interface.pilot.PilotView.command_list
    process target with error: stellarpunk.generate.core.UniverseGenerator.gen_sector_location
    process target with error: stellarpunk.econ_sim.EconomySimulation.source_resources
    process target with error: stellarpunk.generate.core.UniverseGenerator._generate_chain
    process target with error: stellarpunk.orders.core.DisembarkToEntity.disembark_to
    process target with error: stellarpunk.generate.core.UniverseGenerator.spawn_habitable_sector
    process target with error: stellarpunk.generate.core.UniverseGenerator.generate_sector_topology
    process target with error: stellarpunk.interface.ui_util.MeterMenu.__init__
    process target with error: stellarpunk.serialization.econ.StationAgentSaver._load_econ_agent
    process target with error: stellarpunk.generate.core.UniverseGenerator._prepare_projectile_spawn_pattern
    process target with error: stellarpunk.econ_sim.EconomySimulation.run
    process target with error: stellarpunk.econ_sim.EconomySimulation.set_prices
    process target with error: stellarpunk.econ_sim.EconomySimulation.initialize
    process target with error: stellarpunk.core.base
    process target with error: stellarpunk.econ_sim.EconomyDataLogger.source_resources
    process target with error: stellarpunk.serialization.intel.EconAgentIntelSaver._load_entity_intel
    src/stellarpunk/core/base.py:18: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
    https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
    Please report a bug at https://github.com/python/mypy/issues
    version: 1.16.0+dev.c8bd14800b255d13ef9fca2399cd3448fd7ef699.dirty
    src/stellarpunk/core/base.py: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
    https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
    Please report a bug at https://github.com/python/mypy/issues
    version: 1.16.0+dev.c8bd14800b255d13ef9fca2399cd3448fd7ef699.dirty
    Daemon crashed!
    Traceback (most recent call last):
      File "/home/stas/Documents/Work/mypy/mypy/dmypy_server.py", line 237, in serve
        resp = self.run_command(command, data)
      File "/home/stas/Documents/Work/mypy/mypy/dmypy_server.py", line 286, in run_command
        ret = method(self, **data)
      File "/home/stas/Documents/Work/mypy/mypy/dmypy_server.py", line 354, in cmd_run
        return self.check(sources, export_types, is_tty, terminal_width)
               ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/stas/Documents/Work/mypy/mypy/dmypy_server.py", line 433, in check
        messages = self.fine_grained_increment_follow_imports(
            sources, explicit_export_types=export_types
        )
      File "/home/stas/Documents/Work/mypy/mypy/dmypy_server.py", line 702, in fine_grained_increment_follow_imports
        messages = fine_grained_manager.update([], to_delete)
      File "/home/stas/Documents/Work/mypy/mypy/server/update.py", line 286, in update
        changed_modules = propagate_changes_using_dependencies(
            self.manager,
        ...<5 lines>...
            self.processed_targets,
        )
      File "/home/stas/Documents/Work/mypy/mypy/server/update.py", line 882, in propagate_changes_using_dependencies
        triggered |= reprocess_nodes(manager, graph, id, nodes, deps, processed_targets)
                     ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/stas/Documents/Work/mypy/mypy/server/update.py", line 1011, in reprocess_nodes
        semantic_analysis_for_targets(graph[module_id], nodes, graph, saved_attrs)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/stas/Documents/Work/mypy/mypy/semanal_main.py", line 139, in semantic_analysis_for_targets
        process_top_levels(graph, [state.id], patches)
        ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/stas/Documents/Work/mypy/mypy/semanal_main.py", line 222, in process_top_levels
        deferred, incomplete, progress = semantic_analyze_target(
                                         ~~~~~~~~~~~~~~~~~~~~~~~^
            next_id, next_id, state, state.tree, None, final_iteration, patches
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/home/stas/Documents/Work/mypy/mypy/semanal_main.py", line 398, in semantic_analyze_target
        analyzer.refresh_partial(
        ~~~~~~~~~~~~~~~~~~~~~~~~^
            refresh_node,
            ^^^^^^^^^^^^^
        ...<4 lines>...
            active_type=active_type,
            ^^^^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/home/stas/Documents/Work/mypy/mypy/semanal.py", line 653, in refresh_partial
        self.refresh_top_level(node)
        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^
      File "/home/stas/Documents/Work/mypy/mypy/semanal.py", line 671, in refresh_top_level
        self.accept(d)
        ~~~~~~~~~~~^^^
      File "/home/stas/Documents/Work/mypy/mypy/semanal.py", line 7323, in accept
        report_internal_error(err, self.errors.file, node.line, self.errors, self.options)
        ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/stas/Documents/Work/mypy/mypy/errors.py", line 1279, in report_internal_error
        raise err
      File "/home/stas/Documents/Work/mypy/mypy/semanal.py", line 7321, in accept
        node.accept(self)
        ~~~~~~~~~~~^^^^^^
      File "/home/stas/Documents/Work/mypy/mypy/nodes.py", line 460, in accept
        return visitor.visit_import_from(self)
               ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
      File "/home/stas/Documents/Work/mypy/mypy/semanal.py", line 2941, in visit_import_from
        self.report_missing_module_attribute(
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
            module_id,
            ^^^^^^^^^^
        ...<4 lines>...
            context=imp,
            ^^^^^^^^^^^^
        )
        ^
      File "/home/stas/Documents/Work/mypy/mypy/semanal.py", line 3037, in report_missing_module_attribute
        self.fail(message, context, code=codes.ATTR_DEFINED)
        ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/stas/Documents/Work/mypy/mypy/semanal.py", line 7294, in fail
        self.errors.report(
        ~~~~~~~~~~~~~~~~~~^
            ctx.line,
            ^^^^^^^^^
        ...<5 lines>...
            end_column=ctx.end_column,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/home/stas/Documents/Work/mypy/mypy/errors.py", line 466, in report
        self.add_error_info(info)
        ~~~~~~~~~~~~~~~~~~~^^^^^^
      File "/home/stas/Documents/Work/mypy/mypy/errors.py", line 535, in add_error_info
        self._add_error_info(file, info)
        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
      File "/home/stas/Documents/Work/mypy/mypy/errors.py", line 469, in _add_error_info
        assert file not in self.flushed_files
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError
    

    Here's the list from "xxx" unwrapped and sorted:

    ...
    numpy.strings
    numpy.testing
    numpy.testing._private.utils
    numpy.testing.overrides
    ...
    weakref
    xml
    xml.etree.ElementTree
    xml.parsers
    
    Full list

    PIL
    PIL.ExifTags
    PIL.GifImagePlugin
    PIL.GimpGradientFile
    PIL.GimpPaletteFile
    PIL.Image
    PIL.ImageChops
    PIL.ImageCms
    PIL.ImageColor
    PIL.ImageFile
    PIL.ImageFilter
    PIL.ImageMath
    PIL.ImageMode
    PIL.ImageOps
    PIL.ImagePalette
    PIL.ImageQt
    PIL.ImageSequence
    PIL.PaletteFile
    PIL.TiffImagePlugin
    PIL.TiffTags
    PIL._binary
    PIL._deprecate
    PIL._imaging
    PIL._imagingcms
    PIL._imagingmath
    PIL._typing
    PIL._util
    PIL._version
    future
    _ast
    _asyncio
    _bisect
    _blake2
    _bz2
    _codecs
    _collections_abc
    _compression
    _contextvars
    _ctypes
    _curses
    _decimal
    _frozen_importlib
    _frozen_importlib_external
    _hashlib
    _heapq
    _io
    _lsprof
    _operator
    _pickle
    _queue
    _sitebuiltins
    _socket
    _ssl
    _struct
    _thread
    _typeshed
    _typeshed.importlib
    _warnings
    _weakref
    _weakrefset
    abc
    argparse
    array
    ast
    asyncio
    asyncio.base_events
    asyncio.coroutines
    asyncio.events
    asyncio.exceptions
    asyncio.futures
    asyncio.locks
    asyncio.mixins
    asyncio.protocols
    asyncio.queues
    asyncio.runners
    asyncio.selector_events
    asyncio.streams
    asyncio.subprocess
    asyncio.taskgroups
    asyncio.tasks
    asyncio.threads
    asyncio.timeouts
    asyncio.transports
    asyncio.unix_events
    atexit
    bdb
    bisect
    builtins
    bz2
    cProfile
    cmd
    codecs
    collections
    collections.abc
    concurrent
    concurrent.futures
    concurrent.futures._base
    concurrent.futures.process
    concurrent.futures.thread
    contextlib
    contextvars
    copy
    copyreg
    ctypes
    ctypes._endian
    curses
    curses.ascii
    curses.textpad
    dataclasses
    datetime
    decimal
    dis
    email
    email._policybase
    email.charset
    email.contentmanager
    email.errors
    email.header
    email.message
    email.policy
    enum
    fcntl
    fractions
    functools
    gc
    genericpath
    glob
    gzip
    hashlib
    heapq
    imageio
    imageio.config
    imageio.config.extensions
    imageio.config.plugins
    imageio.core
    imageio.core.fetching
    imageio.core.findlib
    imageio.core.format
    imageio.core.imopen
    imageio.core.legacy_plugin_wrapper
    imageio.core.request
    imageio.core.util
    imageio.core.v3_plugin_api
    imageio.plugins
    imageio.plugins.opencv
    imageio.plugins.pillow
    imageio.plugins.pyav
    imageio.plugins.rawpy
    imageio.plugins.tifffile_v3
    imageio.typing
    imageio.v2
    imageio.v3
    importlib
    importlib._abc
    importlib._bootstrap
    importlib._bootstrap_external
    importlib.abc
    importlib.machinery
    importlib.metadata
    importlib.metadata._meta
    importlib.readers
    importlib.resources
    importlib.resources._common
    importlib.resources._functional
    importlib.resources.abc
    inspect
    io
    itertools
    json
    json.decoder
    json.encoder
    logging
    math
    mmap
    multiprocessing
    multiprocessing.connection
    multiprocessing.context
    multiprocessing.managers
    multiprocessing.pool
    multiprocessing.popen_fork
    multiprocessing.popen_forkserver
    multiprocessing.popen_spawn_posix
    multiprocessing.popen_spawn_win32
    multiprocessing.process
    multiprocessing.queues
    multiprocessing.reduction
    multiprocessing.shared_memory
    multiprocessing.sharedctypes
    multiprocessing.spawn
    multiprocessing.synchronize
    multiprocessing.util
    numbers
    numpy
    numpy.config
    numpy._array_api_info
    numpy._core
    numpy._core._asarray
    numpy._core._internal
    numpy._core._type_aliases
    numpy._core._ufunc_config
    numpy._core.arrayprint
    numpy._core.defchararray
    numpy._core.einsumfunc
    numpy._core.fromnumeric
    numpy._core.function_base
    numpy._core.multiarray
    numpy._core.numeric
    numpy._core.numerictypes
    numpy._core.records
    numpy._core.shape_base
    numpy._core.strings
    numpy._expired_attrs_2_0
    numpy._globals
    numpy._pytesttester
    numpy._typing
    numpy._typing._add_docstring
    numpy._typing._array_like
    numpy._typing._callable
    numpy._typing._char_codes
    numpy._typing._dtype_like
    numpy._typing._extended_precision
    numpy._typing._nbit
    numpy._typing._nbit_base
    numpy._typing._nested_sequence
    numpy._typing._scalars
    numpy._typing._shape
    numpy._typing._ufunc
    numpy._utils
    numpy._utils._convertions
    numpy.char
    numpy.core
    numpy.ctypeslib
    numpy.dtypes
    numpy.exceptions
    numpy.f2py
    numpy.fft
    numpy.fft._helper
    numpy.fft._pocketfft
    numpy.lib
    numpy.lib._array_utils_impl
    numpy.lib._arraypad_impl
    numpy.lib._arraysetops_impl
    numpy.lib._arrayterator_impl
    numpy.lib._datasource
    numpy.lib._function_base_impl
    numpy.lib._histograms_impl
    numpy.lib._index_tricks_impl
    numpy.lib._nanfunctions_impl
    numpy.lib._npyio_impl
    numpy.lib._polynomial_impl
    numpy.lib._scimath_impl
    numpy.lib._shape_base_impl
    numpy.lib._stride_tricks_impl
    numpy.lib._twodim_base_impl
    numpy.lib._type_check_impl
    numpy.lib._ufunclike_impl
    numpy.lib._utils_impl
    numpy.lib._version
    numpy.lib.array_utils
    numpy.lib.format
    numpy.lib.introspect
    numpy.lib.mixins
    numpy.lib.npyio
    numpy.lib.scimath
    numpy.lib.stride_tricks
    numpy.linalg
    numpy.linalg._linalg
    numpy.ma
    numpy.ma.core
    numpy.ma.extras
    numpy.ma.mrecords
    numpy.matlib
    numpy.matrixlib
    numpy.matrixlib.defmatrix
    numpy.polynomial
    numpy.polynomial._polybase
    numpy.polynomial._polytypes
    numpy.polynomial.chebyshev
    numpy.polynomial.hermite
    numpy.polynomial.hermite_e
    numpy.polynomial.laguerre
    numpy.polynomial.legendre
    numpy.polynomial.polynomial
    numpy.polynomial.polyutils
    numpy.random
    numpy.random._generator
    numpy.random._mt19937
    numpy.random._pcg64
    numpy.random._philox
    numpy.random._sfc64
    numpy.random.bit_generator
    numpy.random.mtrand
    numpy.rec
    numpy.strings
    numpy.testing
    numpy.testing._private.utils
    numpy.testing.overrides
    numpy.typing
    numpy.version
    opcode
    operator
    os
    os.path
    pathlib
    pdb
    pickle
    posixpath
    profile
    pstats
    pydoc
    pyexpat
    pyexpat.errors
    pyexpat.model
    queue
    re
    reprlib
    resource
    selectors
    shutil
    signal
    socket
    sre_compile
    sre_constants
    sre_parse
    ssl
    stellarpunk
    stellarpunk.agenda
    stellarpunk.config
    stellarpunk.core
    stellarpunk.core.base
    stellarpunk.core.character
    stellarpunk.core.combat
    stellarpunk.core.entity_order_watch
    stellarpunk.core.gamestate
    stellarpunk.core.order
    stellarpunk.core.production_chain
    stellarpunk.core.sector
    stellarpunk.core.sector_entity
    stellarpunk.core.ship
    stellarpunk.data
    stellarpunk.dialog
    stellarpunk.econ
    stellarpunk.econ_sim
    stellarpunk.effects
    stellarpunk.events
    stellarpunk.events.core
    stellarpunk.events.events
    stellarpunk.generate
    stellarpunk.generate.core
    stellarpunk.generate.markov
    stellarpunk.goap_toy
    stellarpunk.hist_extract
    stellarpunk.intel
    stellarpunk.interface
    stellarpunk.interface.audio
    stellarpunk.interface.character
    stellarpunk.interface.command_input
    stellarpunk.interface.comms
    stellarpunk.interface.manager
    stellarpunk.interface.pilot
    stellarpunk.interface.presenter
    stellarpunk.interface.sector
    stellarpunk.interface.starfield
    stellarpunk.interface.startup
    stellarpunk.interface.station
    stellarpunk.interface.ui_events
    stellarpunk.interface.ui_util
    stellarpunk.interface.universe
    stellarpunk.narrative
    stellarpunk.narrative.director
    stellarpunk.narrative.rule_parser
    stellarpunk.orders
    stellarpunk.orders.collision
    stellarpunk.orders.core
    stellarpunk.orders.movement
    stellarpunk.orders.steering
    stellarpunk.predicates
    stellarpunk.sensors
    stellarpunk.serialization
    stellarpunk.serialization.agenda
    stellarpunk.serialization.character
    stellarpunk.serialization.combat
    stellarpunk.serialization.econ
    stellarpunk.serialization.effect
    stellarpunk.serialization.events
    stellarpunk.serialization.gamestate
    stellarpunk.serialization.intel
    stellarpunk.serialization.movement
    stellarpunk.serialization.order
    stellarpunk.serialization.order_core
    stellarpunk.serialization.save_game
    stellarpunk.serialization.sector
    stellarpunk.serialization.sector_entity
    stellarpunk.serialization.sensors
    stellarpunk.serialization.serialize_econ_sim
    stellarpunk.serialization.util
    stellarpunk.sim
    stellarpunk.spunk_image
    stellarpunk.task_schedule
    stellarpunk.util
    string
    struct
    subprocess
    sys
    sys._monitoring
    tarfile
    tempfile
    termios
    textwrap
    threading
    time
    types
    typing
    typing_extensions
    unittest
    unittest._log
    unittest.async_case
    unittest.case
    unittest.loader
    unittest.main
    unittest.result
    unittest.runner
    unittest.signals
    unittest.suite
    uuid
    warnings
    weakref
    xml
    xml.etree.ElementTree
    xml.parsers
    xml.parsers.expat
    zipfile
    zipfile._path
    zipimport
    zlib

    This feels wrong - if we have xml.etree.ElementTree, how come xml.etree is not there?

    numpy.testing._private and xml.etree are the only such modules; they are added by self.find_reachable_changed_modules.

    Honestly, I'm done for today, I'd appreciate if someone who knows this part better could confirm whether I'm on the right track.

  17. sterliakov commented on Apr 10, 2025

    @sterliakov
    Collaborator

    Well, the following (I don't know whether this is a reasonable thing to do or the patch should be at some lower level!) fixes the symptoms.

    diff --git a/mypy/dmypy_server.py b/mypy/dmypy_server.py
    index d73487efe..211a83dd0 100644
    --- a/mypy/dmypy_server.py
    +++ b/mypy/dmypy_server.py
    @@ -756,7 +756,7 @@ class Server:
                     changed.append((nxt.module, nxt.path))
                 elif nxt.module in graph:
                     state = graph[nxt.module]
    -                for dep in state.dependencies:
    +                for dep in [*state.dependencies, *(state.ancestors or [])]:
                         if dep not in seen:
                             seen.add(dep)
                             worklist.append(BuildSource(graph[dep].path, graph[dep].id, followed=True))
    

    It also fixes the "vanishing error" problem I mentioned earlier, so the dependency omission is indeed the common cause for both of them?

    @ilevkivskyi sorry to bother you, but it's a p-high issue affecting many users, and you should be familiar with this beast daemon... Does this change make sense at all?

    This change also somehow fixes #17652 (I'm able to reproduce that one consistently on 1.15.0 and it's gone with this patch applied)

  18. ilevkivskyi commented on Apr 10, 2025

    @ilevkivskyi
    Member

    FWIW something very wrong happens here. IIUC there were no changes between dmypy runs, so daemon should have literally just fetched old error messages and printed them. I will try to figure out what is going on, but it may take a while.

  19. sterliakov commented on Apr 10, 2025

    @sterliakov
    Collaborator

    That happens on the third and subsequent runs, while the second run is still slow (for me it's like 80s, 20s, <0.5s with non-compiled mypy). With the patch applied, it goes exactly as you say: all runs after the first complete immediately (roundtrip_time : 0.047).

    So either this is the right thing to do or dependency is missed somewhere else.

  20. sterliakov commented on Apr 10, 2025

    @sterliakov
    Collaborator

    Wait, but it is the right thing to do. When we traverse dependencies in find_reachable_changed_modules, we do want to include all ancestors as well - at least because we did so previously, and that's the reason they are on the graph. The same happens in another place where we ensure that all deps are loaded:

    mypy/mypy/server/update.py

    Lines 472 to 497 in a4e79ea

    def find_unloaded_deps(
    manager: BuildManager, graph: dict[str, State], initial: Sequence[str]
    ) -> list[str]:
    """Find all the deps of the nodes in initial that haven't had their tree loaded.
    The key invariant here is that if a module is loaded, so are all
    of their dependencies. This means that when we encounter a loaded
    module, we don't need to explore its dependencies. (This
    invariant is slightly violated when dependencies are added, which
    can be handled by calling find_unloaded_deps directly on the new
    dependencies.)
    """
    worklist = list(initial)
    seen: set[str] = set()
    unloaded = []
    while worklist:
    node = worklist.pop()
    if node in seen or node not in graph:
    continue
    seen.add(node)
    if node not in manager.modules:
    ancestors = graph[node].ancestors or []
    worklist.extend(graph[node].dependencies + ancestors)
    unloaded.append(node)
    return unloaded

    I'm opening a PR with this change. I don't yet understand how to write a self-contained unit test, but at least understand why my suggestion actually helps. Now some ancestors are unreachable when we only consider explicit dependencies, and so dmypy treats those modules as deleted. Modules are still there, the state becomes inconsistent.

  21. added a commit that references this issue on Apr 12, 2025
    1ba23f1
  22. DavideCanton commented on May 16, 2025

    @DavideCanton

    I see that this issue is fixed in the main branch, is there a plan for releasing this fix? Mypy in vscode is quite unusable at the moment, since it is quite slow when the daemon is turned off.

  23. A5rocks commented on May 16, 2025

    @A5rocks
    Collaborator

    I assume this will be in mypy 1.16

  24. svalentin commented on May 16, 2025

    @svalentin
    Collaborator

    Yes, this will be in 1.16. We are almost done with the release. Follow the release issue here. It will most likely be out right after PyCon (ends May 22)

  25. DavideCanton commented on May 16, 2025

    @DavideCanton

    Ah ok, I thought that since that's a big issue for mypy users in IDE it would have been released in a 1.15.1, but I guess I'll wait for 1.16 and use a built wheel of 1.16.dev in the meanwhile.

    Thanks!

  26. svalentin commented on May 16, 2025

    @svalentin
    Collaborator

    I recommend the wheel for 9e45dad. It should address another dmypy bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions