The approach is pretty similar to the approach I took in #9382 for regr_test.py: dynamically create virtual environments for testing stubs packages in isolation. However, since mypy_test.py tests all of typeshed's stubs in succession (and since lots of typeshed's stubs packages depend on other typeshed stubs packages), the performance issues with creating a virtual environment for testing each stubs package are even more severe than with regr_test.py.
I mitigate the performance issues associated with dynamically creating virtual environments in two ways:
- Dynamically creating venvs is mostly slow due to I/O bottlenecks. Creating the virtual environments can be sped up dramatically by creating them concurrently in a threadpool. The same goes for pip installing the requirements into the venvs -- though unfortunately, we have to use pip with --no-cache-dir, as the pip cache gets easily corrupted if you try to do concurrent reads and writes to the pip cache.
- If types-pycocotools requires numpy>=1 and types-D3DShot also requires numpy>=1 (for example), there's no need to create 2 virtual environments. The same requirements have been specified, so they can share a virtual environment between them. This means we don't have to create nearly so many virtual environments.
Release: https://pypi.org/pypi/ujson/5.7.0
Homepage: https://github.com/ultrajson/ultrajson
Diff: https://github.com/ultrajson/ultrajson/compare/5.6.0...5.7.0
Stubsabot analysis of the diff between the two releases:
- Total lines of Python code added: 38.
- Total lines of Python code deleted: 0.
If stubtest fails for this PR:
- Leave this PR open (as a reminder, and to prevent stubsabot from opening another PR)
- Fix stubtest failures in another PR, then close this PR
Note that you will need to close and re-open the PR in order to trigger CI
Co-authored-by: stubsabot <>
Release: https://pypi.org/pypi/singledispatch/4.0.0
Homepage: https://github.com/jaraco/singledispatch
Diff: https://github.com/jaraco/singledispatch/compare/v3.7.0...v4.0.0
Stubsabot analysis of the diff between the two releases:
- Total lines of Python code added: 381.
- Total lines of Python code deleted: 266.
If stubtest fails for this PR:
- Leave this PR open (as a reminder, and to prevent stubsabot from opening another PR)
- Fix stubtest failures in another PR, then close this PR
Note that you will need to close and re-open the PR in order to trigger CI
Co-authored-by: stubsabot <>
Release: https://pypi.org/pypi/pyOpenSSL/23.0.0
Homepage: https://pyopenssl.org/
Diff: https://github.com/pyca/pyopenssl/compare/22.1.0...23.0.0
Stubsabot analysis of the diff between the two releases:
- Total lines of Python code added: 83.
- Total lines of Python code deleted: 37.
If stubtest fails for this PR:
- Leave this PR open (as a reminder, and to prevent stubsabot from opening another PR)
- Fix stubtest failures in another PR, then close this PR
Note that you will need to close and re-open the PR in order to trigger CI
Co-authored-by: stubsabot <>
Release: https://pypi.org/pypi/Pygments/2.14.0
Homepage: https://pygments.org/
Changelog: https://github.com/pygments/pygments/blob/master/CHANGES
Diff: https://github.com/pygments/pygments/compare/2.13.0...2.14.0
Stubsabot analysis of the diff between the two releases:
- 11 public Python files have been added.
- 0 files included in typeshed's stubs have been deleted.
- 7 files included in typeshed's stubs have been modified or renamed: `pygments/__init__.py`, `pygments/formatters/__init__.py`, `pygments/formatters/html.py`, `pygments/formatters/irc.py`, `pygments/lexer.py`, `pygments/lexers/__init__.py`, `pygments/sphinxext.py`.
- Total lines of Python code added: 3094.
- Total lines of Python code deleted: 1387.
If stubtest fails for this PR:
- Leave this PR open (as a reminder, and to prevent stubsabot from opening another PR)
- Fix stubtest failures in another PR, then close this PR
Note that you will need to close and re-open the PR in order to trigger CI
Co-authored-by: stubsabot <>