Skip to content

Conversation

brianschubert
Copy link
Member

@brianschubert brianschubert commented Sep 14, 2025

Follow up to #14699

Based on the stubtest errors -- I haven't looked at the source.

Mostly mechanical additions of @disjoint_base, but see separate commits for special cases in gevent and pywintypes.

```
error: not checking stubs due to mypy build errors:

stubs\pywin32\win32\lib\pywintypes.pyi:20: error: Value of type variable "_TC" of "disjoint_base" cannot be "Callable[[VarArg(Never)], Never]"  [type-var]
```
@brianschubert
Copy link
Member Author

brianschubert commented Sep 14, 2025

@AlexWaygood strange how shard 1 seems to be just idling, even after restarting. If I'm reading the logs right, it's finishing the old/new runs for one project (dacite), but isn't starting runs for the next project?

@brianschubert
Copy link
Member Author

I tried bisecting through the primer projects to see if there's a particular project that's causing the primer stall. I think I've narrowed it down to an issue with materialize. It seems that there's exception being raised during its setup, which for some reason isn't being properly logged and re-raised in runs with many projects. I guess that's leading to some sort of deadlock in the async code?

https://github.com/brianschubert/typeshed/actions/runs/17712852806/job/50333878179

new commit
commit dd4bc53cd261cd683a7d701c72190a4cbc282d17
Merge c8b0e1999d282e83978c340727aa875e30557c41 into 4b0623f4fb2c4e5a04a0244e1592b1481a26e47e
Previous HEAD position was dd4bc53cd Merge c8b0e1999d282e83978c340727aa875e30557c41 into 4b0623f4fb2c4e5a04a0244e1592b1481a26e47e
Switched to a new branch 'upstream_main'
branch 'upstream_main' set up to track 'origin/main'.
base commit
commit 4b0623f4fb2c4e5a04a0244e1592b1481a26e47e
Update mypy to 1.18.1 (#14699)

git clone --recurse-submodules /home/runner/work/typeshed/typeshed/typeshed_to_test /tmp/mypy_primer/new_typeshed/typeshed_to_test	 in /tmp/mypy_primer/new_typeshed
git checkout --force --recurse-submodules origin/HEAD	 in /tmp/mypy_primer/new_typeshed/typeshed_to_test
git branch -D dd4bc53cd261cd683a7d701c72190a4cbc282d17	 in /tmp/mypy_primer/new_typeshed/typeshed_to_test
git checkout --force --recurse-submodules dd4bc53cd261cd683a7d701c72190a4cbc282d17	 in /tmp/mypy_primer/new_typeshed/typeshed_to_test
git clone --recurse-submodules /home/runner/work/typeshed/typeshed/typeshed_to_test /tmp/mypy_primer/old_typeshed/typeshed_to_test	 in /tmp/mypy_primer/old_typeshed
git checkout --force --recurse-submodules origin/HEAD	 in /tmp/mypy_primer/old_typeshed/typeshed_to_test
git branch -D upstream_main	 in /tmp/mypy_primer/old_typeshed/typeshed_to_test
git checkout --force --recurse-submodules upstream_main	 in /tmp/mypy_primer/old_typeshed/typeshed_to_test
/tmp/mypy_primer/mypy_new/venv/bin/python -m pip install mypy==v1.17.1
/tmp/mypy_primer/mypy_old/venv/bin/python -m pip install mypy==v1.17.1
/tmp/mypy_primer/mypy_new/venv/bin/mypy --version
/tmp/mypy_primer/mypy_old/venv/bin/mypy --version
new mypy version: mypy 1.17.1 (compiled: yes)
old mypy version: mypy 1.17.1 (compiled: yes)
git clone --recurse-submodules https://github.com/MaterializeInc/materialize /tmp/mypy_primer/projects/materialize --depth 1	 in /tmp/mypy_primer/projects
/tmp/mypy_primer/projects/_materialize_venv/bin/python -m pip install -r ci/builder/requirements.txt	 in /tmp/mypy_primer/projects/materialize
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/site-packages/mypy_primer/model.py", line 138, in setup
    await run(install_cmd, shell=True, cwd=repo_dir, output=True)
  File "/opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/site-packages/mypy_primer/utils.py", line 113, in run
    raise subprocess.CalledProcessError(proc.returncode, cmd, output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '/tmp/mypy_primer/projects/_materialize_venv/bin/python -m pip install -r ci/builder/requirements.txt' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/site-packages/mypy_primer/main.py", line 460, in main
    retcode = inner()
  File "/opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/site-packages/mypy_primer/main.py", line 453, in inner
    retcode = asyncio.run(coro)
  File "/opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/asyncio/runners.py", line 195, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/site-packages/mypy_primer/main.py", line 406, in primer
    result = await result_fut
             ^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/asyncio/tasks.py", line 634, in _wait_for_one
    return f.result() if resolve else f
           ~~~~~~~~^^
  File "/opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/site-packages/mypy_primer/model.py", line 424, in primer_result
    await self.setup()
  File "/opt/hostedtoolcache/Python/3.13.7/x64/lib/python3.13/site-packages/mypy_primer/model.py", line 144, in setup
    raise RuntimeError(f"pip install failed for {self.name}") from e
RuntimeError: pip install failed for materialize
Collecting pg8000@ git+https://github.com/tlocke/pg8000@46c00021ade1d19466b07ed30392386c5f0a6b8e (from -r ci/builder/requirements.txt (line 37))
  Cloning https://github.com/tlocke/pg8000 (to revision 46c00021ade1d19466b07ed30392386c5f0a6b8e) to /tmp/pip-install-0nm84sqj/pg8000_b567ba90fb4c499a8a074d169aab47b3

  Running command git clone --filter=blob:none --quiet https://github.com/tlocke/pg8000 /tmp/pip-install-0nm84sqj/pg8000_b567ba90fb4c499a8a074d169aab47b3
  fatal: could not read Username for 'https://github.com/': No such device or address
  error: subprocess-exited-with-error
  
  × git clone --filter=blob:none --quiet https://github.com/tlocke/pg8000 /tmp/pip-install-0nm84sqj/pg8000_b567ba90fb4c499a8a074d169aab47b3 did not run successfully.
  │ exit code: 128
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× git clone --filter=blob:none --quiet https://github.com/tlocke/pg8000 /tmp/pip-install-0nm84sqj/pg8000_b567ba90fb4c499a8a074d169aab47b3 did not run successfully.
│ exit code: 128
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Error: Process completed with exit code 1.

This comment has been minimized.

@disjoint_base
class HANDLEType:
def __new__(self, *args: Never) -> NoReturn: ...
def __new__(cls, *args: Never) -> Self: ...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that NoReturn was used to signal that this type isn't instantiatable. So this is likely a behavior change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm yes, I was hoping *args: Never would do the trick, but it seems not.

Switched back to the original signature and added a # type: ignore for the mypy error:

stubs\pywin32\win32\lib\pywintypes.pyi:20: error: Value of type variable "_TC" of "disjoint_base" cannot be "Callable[[VarArg(Never)], Never]"  [type-var]

Pity we don't have a more pleasant way of marking uninstantiable types... ;-)

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau srittau merged commit 47dbbd6 into python:main Sep 15, 2025
71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants