diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 79072a1bb..55ab2ca1f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -163,7 +163,7 @@ supported: When the stubs are updated to a newer version of the library, the version of the stub should be bumped (note that previous versions are still available on PyPI). -* `requires` (optional): A list of other stub packages or packages with type +* `dependencies` (optional): A list of other stub packages or packages with type information that are imported by the stubs in this package. Only packages generated by typeshed or required by the upstream package are allowed to be listed here, for security reasons. See @@ -202,9 +202,9 @@ This has the following keys: `--ignore_missing_stub` option to the stubtest call. See [tests/README.md](./tests/README.md) for more information. In most cases, this field should be identical to `partial_stub`. -* `stubtest_requirements` (default: `[]`): A list of Python packages that need +* `stubtest_dependencies` (default: `[]`): A list of Python packages that need to be installed for stubtest to run successfully. These packages are installed - in addition to the requirements in the `requires` field. + in addition to the dependencies in the `dependencies` field. * `apt_dependencies` (default: `[]`): A list of Ubuntu APT packages that need to be installed for stubtest to run successfully. * `brew_dependencies` (default: `[]`): A list of MacOS Homebrew packages diff --git a/lib/ts_utils/metadata.py b/lib/ts_utils/metadata.py index 1b7000216..a33b1ff11 100644 --- a/lib/ts_utils/metadata.py +++ b/lib/ts_utils/metadata.py @@ -84,7 +84,7 @@ class StubtestSettings: ignore_missing_stub: bool supported_platforms: list[str] | None # None means all platforms ci_platforms: list[str] - stubtest_requirements: list[str] + stubtest_dependencies: list[str] mypy_plugins: list[str] mypy_plugins_config: dict[str, dict[str, Any]] @@ -109,7 +109,7 @@ def read_stubtest_settings(distribution: str) -> StubtestSettings: ignore_missing_stub: object = data.get("ignore_missing_stub", False) supported_platforms: object = data.get("supported_platforms") ci_platforms: object = data.get("ci_platforms", DEFAULT_STUBTEST_PLATFORMS) - stubtest_requirements: object = data.get("stubtest_requirements", []) + stubtest_dependencies: object = data.get("stubtest_dependencies", []) mypy_plugins: object = data.get("mypy_plugins", []) mypy_plugins_config: object = data.get("mypy_plugins_config", {}) @@ -123,7 +123,7 @@ def read_stubtest_settings(distribution: str) -> StubtestSettings: assert _is_list_of_strings(brew_dependencies) assert _is_list_of_strings(choco_dependencies) assert _is_list_of_strings(extras) - assert _is_list_of_strings(stubtest_requirements) + assert _is_list_of_strings(stubtest_dependencies) assert _is_list_of_strings(mypy_plugins) assert _is_nested_dict(mypy_plugins_config) @@ -151,7 +151,7 @@ def read_stubtest_settings(distribution: str) -> StubtestSettings: ignore_missing_stub=ignore_missing_stub, supported_platforms=supported_platforms, ci_platforms=ci_platforms, - stubtest_requirements=stubtest_requirements, + stubtest_dependencies=stubtest_dependencies, mypy_plugins=mypy_plugins, mypy_plugins_config=mypy_plugins_config, ) @@ -174,7 +174,7 @@ class StubMetadata: distribution: Annotated[str, "The name of the distribution on PyPI"] version_spec: Annotated[Specifier, "Upstream versions that the stubs are compatible with"] - requires: Annotated[list[Requirement], "The parsed requirements as listed in METADATA.toml"] + dependencies: Annotated[list[Requirement], "The parsed dependencies as listed in METADATA.toml"] extra_description: str | None stub_distribution: Annotated[str, "The name under which the distribution is uploaded to PyPI"] upstream_repository: Annotated[str, "The URL of the upstream repository"] | None @@ -193,7 +193,7 @@ class StubMetadata: _KNOWN_METADATA_FIELDS: Final = frozenset( { "version", - "requires", + "dependencies", "extra_description", "stub_distribution", "upstream_repository", @@ -216,7 +216,7 @@ _KNOWN_METADATA_TOOL_FIELDS: Final = { "ignore_missing_stub", "supported_platforms", "ci_platforms", - "stubtest_requirements", + "stubtest_dependencies", "mypy_plugins", "mypy_plugins_config", } @@ -235,7 +235,7 @@ def read_metadata(distribution: str) -> StubMetadata: This function does some basic validation, but does no parsing, transforming or normalization of the metadata. Use `read_dependencies` if you need to parse the dependencies - given in the `requires` field, for example. + given in the `dependencies` field, for example. """ try: with metadata_path(distribution).open("rb") as f: @@ -255,9 +255,9 @@ def read_metadata(distribution: str) -> StubMetadata: version_spec = Specifier(version) assert version_spec.operator in {"==", "~="}, f"Invalid 'version' field in METADATA.toml for {distribution!r}" - requires_s: object = data.get("requires", []) # pyright: ignore[reportUnknownMemberType] - assert isinstance(requires_s, list) - requires = [parse_requires(distribution, req) for req in requires_s] + dependencies_s: object = data.get("dependencies", []) # pyright: ignore[reportUnknownMemberType] + assert isinstance(dependencies_s, list) + dependencies = [parse_dependencies(distribution, dep) for dep in dependencies_s] extra_description: object = data.get("extra_description") # pyright: ignore[reportUnknownMemberType] assert isinstance(extra_description, (str, type(None))) @@ -336,7 +336,7 @@ def read_metadata(distribution: str) -> StubMetadata: return StubMetadata( distribution=distribution, version_spec=version_spec, - requires=requires, + dependencies=dependencies, extra_description=extra_description, stub_distribution=stub_distribution, upstream_repository=upstream_repository, @@ -366,7 +366,7 @@ def update_metadata(distribution: str, **new_values: object) -> tomlkit.TOMLDocu return data -def parse_requires(distribution: str, req: object) -> Requirement: +def parse_dependencies(distribution: str, req: object) -> Requirement: assert isinstance(req, str), f"Invalid requirement {req!r} for {distribution!r}" return Requirement(req) @@ -398,7 +398,7 @@ def read_dependencies(distribution: str) -> PackageDependencies: pypi_name_to_typeshed_name_mapping = get_pypi_name_to_typeshed_name_mapping() typeshed: list[Requirement] = [] external: list[Requirement] = [] - for dependency in read_metadata(distribution).requires: + for dependency in read_metadata(distribution).dependencies: if dependency.name in pypi_name_to_typeshed_name_mapping: req = Requirement(str(dependency)) # copy the requirement req.name = pypi_name_to_typeshed_name_mapping[dependency.name] diff --git a/stubs/Authlib/METADATA.toml b/stubs/Authlib/METADATA.toml index f7778c178..c6ac49d36 100644 --- a/stubs/Authlib/METADATA.toml +++ b/stubs/Authlib/METADATA.toml @@ -1,3 +1,3 @@ version = "1.6.9" upstream_repository = "https://github.com/authlib/authlib" -requires = ["cryptography"] +dependencies = ["cryptography"] diff --git a/stubs/Deprecated/METADATA.toml b/stubs/Deprecated/METADATA.toml index fefce48a3..c16442798 100644 --- a/stubs/Deprecated/METADATA.toml +++ b/stubs/Deprecated/METADATA.toml @@ -1,3 +1,3 @@ version = "~=1.3.1" upstream_repository = "https://github.com/laurent-laporte-pro/deprecated" -requires = [] +dependencies = [] diff --git a/stubs/Flask-Cors/METADATA.toml b/stubs/Flask-Cors/METADATA.toml index cacf48ed4..50a6e7eb3 100644 --- a/stubs/Flask-Cors/METADATA.toml +++ b/stubs/Flask-Cors/METADATA.toml @@ -1,4 +1,4 @@ version = "6.0.*" upstream_repository = "https://github.com/corydolphin/flask-cors" # Requires a version of flask with a `py.typed` file -requires = ["Flask>=2.0.0"] +dependencies = ["Flask>=2.0.0"] diff --git a/stubs/Flask-Migrate/METADATA.toml b/stubs/Flask-Migrate/METADATA.toml index 6c2b99083..517f60640 100644 --- a/stubs/Flask-Migrate/METADATA.toml +++ b/stubs/Flask-Migrate/METADATA.toml @@ -1,4 +1,4 @@ version = "4.1.*" upstream_repository = "https://github.com/miguelgrinberg/Flask-Migrate" # Requires versions of flask and Flask-SQLAlchemy with `py.typed` files -requires = ["Flask-SQLAlchemy>=3.0.1", "Flask>=2.0.0"] +dependencies = ["Flask-SQLAlchemy>=3.0.1", "Flask>=2.0.0"] diff --git a/stubs/Flask-SocketIO/METADATA.toml b/stubs/Flask-SocketIO/METADATA.toml index 1fc858c96..8060e89dc 100644 --- a/stubs/Flask-SocketIO/METADATA.toml +++ b/stubs/Flask-SocketIO/METADATA.toml @@ -1,3 +1,3 @@ version = "5.6.*" -requires = ["Flask>=0.9"] +dependencies = ["Flask>=0.9"] upstream_repository = "https://github.com/miguelgrinberg/flask-socketio" diff --git a/stubs/JACK-Client/METADATA.toml b/stubs/JACK-Client/METADATA.toml index b37b5b295..34d6058a3 100644 --- a/stubs/JACK-Client/METADATA.toml +++ b/stubs/JACK-Client/METADATA.toml @@ -1,7 +1,7 @@ version = "0.5.*" upstream_repository = "https://github.com/spatialaudio/jackclient-python" # Requires a version of numpy with a `py.typed` file -requires = ["numpy>=1.20", "types-cffi"] +dependencies = ["numpy>=1.20", "types-cffi"] [tool.stubtest] # darwin and win32 are equivalent diff --git a/stubs/PyAutoGUI/METADATA.toml b/stubs/PyAutoGUI/METADATA.toml index 66c268a99..21cb893fd 100644 --- a/stubs/PyAutoGUI/METADATA.toml +++ b/stubs/PyAutoGUI/METADATA.toml @@ -1,3 +1,3 @@ version = "0.9.*" upstream_repository = "https://github.com/asweigart/pyautogui" -requires = ["types-PyScreeze"] +dependencies = ["types-PyScreeze"] diff --git a/stubs/PyScreeze/METADATA.toml b/stubs/PyScreeze/METADATA.toml index 723e24d73..4c3d870af 100644 --- a/stubs/PyScreeze/METADATA.toml +++ b/stubs/PyScreeze/METADATA.toml @@ -1,6 +1,6 @@ version = "1.0.1" upstream_repository = "https://github.com/asweigart/pyscreeze" -requires = ["Pillow>=10.3.0"] +dependencies = ["Pillow>=10.3.0"] [tool.stubtest] # Linux has extra constants, win32 has different definitions @@ -8,4 +8,4 @@ ci_platforms = ["linux", "win32"] # PyScreeze has an odd setup.py file # that doesn't list Pillow as a dependency for py312+ yet: # https://github.com/asweigart/pyscreeze/blob/eeca245a135cf171c163b3691300138518efa64e/setup.py#L38-L46 -stubtest_requirements = ["Pillow"] +stubtest_dependencies = ["Pillow"] diff --git a/stubs/Pygments/METADATA.toml b/stubs/Pygments/METADATA.toml index f6fea0247..45a1bcecf 100644 --- a/stubs/Pygments/METADATA.toml +++ b/stubs/Pygments/METADATA.toml @@ -1,8 +1,8 @@ version = "2.19.*" upstream_repository = "https://github.com/pygments/pygments" -requires = ["types-docutils"] +dependencies = ["types-docutils"] partial_stub = true [tool.stubtest] -stubtest_requirements = ["sphinx"] +stubtest_dependencies = ["sphinx"] ignore_missing_stub = true diff --git a/stubs/WTForms/METADATA.toml b/stubs/WTForms/METADATA.toml index a7a4b3a1a..f53b7378f 100644 --- a/stubs/WTForms/METADATA.toml +++ b/stubs/WTForms/METADATA.toml @@ -1,3 +1,3 @@ version = "~= 3.2.1" upstream_repository = "https://github.com/pallets-eco/wtforms" -requires = ["MarkupSafe"] +dependencies = ["MarkupSafe"] diff --git a/stubs/auth0-python/METADATA.toml b/stubs/auth0-python/METADATA.toml index 4e1606df7..a7d136713 100644 --- a/stubs/auth0-python/METADATA.toml +++ b/stubs/auth0-python/METADATA.toml @@ -1,3 +1,3 @@ version = "4.10.*" upstream_repository = "https://github.com/auth0/auth0-python" -requires = ["cryptography", "types-requests"] +dependencies = ["cryptography", "types-requests"] diff --git a/stubs/bleach/METADATA.toml b/stubs/bleach/METADATA.toml index 38c7fd7b5..4a698e420 100644 --- a/stubs/bleach/METADATA.toml +++ b/stubs/bleach/METADATA.toml @@ -1,5 +1,5 @@ version = "6.3.*" -requires = ["types-html5lib"] +dependencies = ["types-html5lib"] upstream_repository = "https://github.com/mozilla/bleach" [tool.stubtest] diff --git a/stubs/cffi/METADATA.toml b/stubs/cffi/METADATA.toml index 22f51de9e..11eeef3f5 100644 --- a/stubs/cffi/METADATA.toml +++ b/stubs/cffi/METADATA.toml @@ -1,6 +1,6 @@ version = "2.0.*" upstream_repository = "https://github.com/python-cffi/cffi/" -requires = ["types-setuptools"] +dependencies = ["types-setuptools"] [tool.stubtest] # linux and darwin are mostly equivalent, except for a single `RTLD_DEEPBIND` variable diff --git a/stubs/channels/METADATA.toml b/stubs/channels/METADATA.toml index 750fcf102..9f1853665 100644 --- a/stubs/channels/METADATA.toml +++ b/stubs/channels/METADATA.toml @@ -1,8 +1,8 @@ version = "4.3.*" upstream_repository = "https://github.com/django/channels" -requires = ["django-stubs>=4.2", "asgiref"] +dependencies = ["django-stubs>=4.2", "asgiref"] [tool.stubtest] mypy_plugins = ['mypy_django_plugin.main'] mypy_plugins_config = {"django-stubs" = {"django_settings_module" = "@tests.django_settings"}} -stubtest_requirements = ["daphne"] +stubtest_dependencies = ["daphne"] diff --git a/stubs/click-default-group/METADATA.toml b/stubs/click-default-group/METADATA.toml index 713e657a8..352488b61 100644 --- a/stubs/click-default-group/METADATA.toml +++ b/stubs/click-default-group/METADATA.toml @@ -1,4 +1,4 @@ version = "1.2.*" upstream_repository = "https://github.com/click-contrib/click-default-group" # requires a version of click with a py.typed -requires = ["click>=8.0.0"] +dependencies = ["click>=8.0.0"] diff --git a/stubs/click-log/METADATA.toml b/stubs/click-log/METADATA.toml index c1548cdc2..abf06fcaa 100644 --- a/stubs/click-log/METADATA.toml +++ b/stubs/click-log/METADATA.toml @@ -1,3 +1,3 @@ version = "0.4.*" -requires = ["click>=8.0.0"] +dependencies = ["click>=8.0.0"] upstream_repository = "https://github.com/click-contrib/click-log" diff --git a/stubs/click-shell/METADATA.toml b/stubs/click-shell/METADATA.toml index 630e551b1..49c228167 100644 --- a/stubs/click-shell/METADATA.toml +++ b/stubs/click-shell/METADATA.toml @@ -1,3 +1,3 @@ version = "2.1" upstream_repository = "https://github.com/clarkperkins/click-shell" -requires = ["click>=8.0.0"] +dependencies = ["click>=8.0.0"] diff --git a/stubs/click-web/METADATA.toml b/stubs/click-web/METADATA.toml index 1f42748d4..f3d3c10a6 100644 --- a/stubs/click-web/METADATA.toml +++ b/stubs/click-web/METADATA.toml @@ -1,3 +1,3 @@ version = "0.8.*" -requires = ["click>=8.0.0", "Flask>=2.3.2"] +dependencies = ["click>=8.0.0", "Flask>=2.3.2"] upstream_repository = "https://github.com/fredrik-corneliusson/click-web" diff --git a/stubs/defusedxml/METADATA.toml b/stubs/defusedxml/METADATA.toml index c073b5244..54560092e 100644 --- a/stubs/defusedxml/METADATA.toml +++ b/stubs/defusedxml/METADATA.toml @@ -2,4 +2,4 @@ version = "0.7.*" upstream_repository = "https://github.com/tiran/defusedxml" [tool.stubtest] -stubtest_requirements = ["lxml"] +stubtest_dependencies = ["lxml"] diff --git a/stubs/django-filter/METADATA.toml b/stubs/django-filter/METADATA.toml index 5f24ade15..82441a5f7 100644 --- a/stubs/django-filter/METADATA.toml +++ b/stubs/django-filter/METADATA.toml @@ -1,6 +1,6 @@ version = "25.2.*" upstream_repository = "https://github.com/carltongibson/django-filter/" -requires = ["django-stubs"] +dependencies = ["django-stubs"] [tool.stubtest] mypy_plugins = ["mypy_django_plugin.main"] diff --git a/stubs/django-import-export/METADATA.toml b/stubs/django-import-export/METADATA.toml index bc47485c7..64c84c2d3 100644 --- a/stubs/django-import-export/METADATA.toml +++ b/stubs/django-import-export/METADATA.toml @@ -1,6 +1,6 @@ version = "4.4.*" upstream_repository = "https://github.com/django-import-export/django-import-export" -requires = ["django-stubs"] # Add tablib when typed, and update _Incomplete aliases in stubs +dependencies = ["django-stubs"] # Add tablib when typed, and update _Incomplete aliases in stubs [tool.stubtest] skip = true # Django requires configured settings at runtime diff --git a/stubs/docker/METADATA.toml b/stubs/docker/METADATA.toml index 0ce47db99..21602af49 100644 --- a/stubs/docker/METADATA.toml +++ b/stubs/docker/METADATA.toml @@ -1,3 +1,3 @@ version = "7.1.*" upstream_repository = "https://github.com/docker/docker-py" -requires = ["types-paramiko", "types-requests", "urllib3>=2"] +dependencies = ["types-paramiko", "types-requests", "urllib3>=2"] diff --git a/stubs/fanstatic/METADATA.toml b/stubs/fanstatic/METADATA.toml index 6740efc28..2f2663de3 100644 --- a/stubs/fanstatic/METADATA.toml +++ b/stubs/fanstatic/METADATA.toml @@ -1,3 +1,3 @@ version = "1.7.*" upstream_repository = "https://github.com/zopefoundation/fanstatic" -requires = ["types-setuptools", "types-WebOb"] +dependencies = ["types-setuptools", "types-WebOb"] diff --git a/stubs/flake8-builtins/METADATA.toml b/stubs/flake8-builtins/METADATA.toml index 3406949e4..535f3a927 100644 --- a/stubs/flake8-builtins/METADATA.toml +++ b/stubs/flake8-builtins/METADATA.toml @@ -1,3 +1,3 @@ version = "3.1.*" upstream_repository = "https://github.com/gforcada/flake8-builtins" -requires = ["types-flake8"] +dependencies = ["types-flake8"] diff --git a/stubs/flake8-docstrings/METADATA.toml b/stubs/flake8-docstrings/METADATA.toml index 8d4722b27..49902d8b7 100644 --- a/stubs/flake8-docstrings/METADATA.toml +++ b/stubs/flake8-docstrings/METADATA.toml @@ -1,3 +1,3 @@ version = "1.7.*" upstream_repository = "https://github.com/pycqa/flake8-docstrings" -requires = ["types-flake8"] +dependencies = ["types-flake8"] diff --git a/stubs/flake8/METADATA.toml b/stubs/flake8/METADATA.toml index f84346a54..ea16f7dcb 100644 --- a/stubs/flake8/METADATA.toml +++ b/stubs/flake8/METADATA.toml @@ -1,3 +1,3 @@ version = "7.3.*" upstream_repository = "https://github.com/pycqa/flake8" -requires = ["types-pyflakes"] +dependencies = ["types-pyflakes"] diff --git a/stubs/fpdf2/METADATA.toml b/stubs/fpdf2/METADATA.toml index 0a8398549..5430aa884 100644 --- a/stubs/fpdf2/METADATA.toml +++ b/stubs/fpdf2/METADATA.toml @@ -1,7 +1,7 @@ version = "2.8.4" upstream_repository = "https://github.com/py-pdf/fpdf2" -requires = ["Pillow>=10.3.0"] +dependencies = ["Pillow>=10.3.0"] obsolete_since = "2.8.6" # Released on 2026-02-19 [tool.stubtest] -stubtest_requirements = ["cryptography"] +stubtest_dependencies = ["cryptography"] diff --git a/stubs/geopandas/METADATA.toml b/stubs/geopandas/METADATA.toml index cf29f4c3e..9c5da14ba 100644 --- a/stubs/geopandas/METADATA.toml +++ b/stubs/geopandas/METADATA.toml @@ -1,6 +1,6 @@ version = "1.1.3" # Requires a version of numpy with a `py.typed` file -requires = ["numpy>=1.20", "pandas-stubs", "types-shapely", "pyproj"] +dependencies = ["numpy>=1.20", "pandas-stubs", "types-shapely", "pyproj"] upstream_repository = "https://github.com/geopandas/geopandas" [tool.stubtest] diff --git a/stubs/gevent/METADATA.toml b/stubs/gevent/METADATA.toml index 58869c1ac..d85085828 100644 --- a/stubs/gevent/METADATA.toml +++ b/stubs/gevent/METADATA.toml @@ -1,12 +1,12 @@ version = "25.9.*" upstream_repository = "https://github.com/gevent/gevent" -requires = ["types-greenlet", "types-psutil>=7.2.0"] +dependencies = ["types-greenlet", "types-psutil>=7.2.0"] [tool.stubtest] # Run stubtest on all platforms, since there is some platform specific stuff # especially in the stdlib module replacement ci_platforms = ["linux", "darwin", "win32"] # for testing the ffi loop implementations on all platforms -stubtest_requirements = ["cffi", "dnspython"] +stubtest_dependencies = ["cffi", "dnspython"] apt_dependencies = ["libev4", "libev-dev", "libuv1", "libuv1-dev"] brew_dependencies = ["libev", "libuv"] diff --git a/stubs/grpcio-channelz/METADATA.toml b/stubs/grpcio-channelz/METADATA.toml index bac12ed6b..035665f75 100644 --- a/stubs/grpcio-channelz/METADATA.toml +++ b/stubs/grpcio-channelz/METADATA.toml @@ -1,3 +1,3 @@ version = "1.*" upstream_repository = "https://github.com/grpc/grpc" -requires = ["types-grpcio", "types-protobuf"] +dependencies = ["types-grpcio", "types-protobuf"] diff --git a/stubs/grpcio-health-checking/METADATA.toml b/stubs/grpcio-health-checking/METADATA.toml index bac12ed6b..035665f75 100644 --- a/stubs/grpcio-health-checking/METADATA.toml +++ b/stubs/grpcio-health-checking/METADATA.toml @@ -1,3 +1,3 @@ version = "1.*" upstream_repository = "https://github.com/grpc/grpc" -requires = ["types-grpcio", "types-protobuf"] +dependencies = ["types-grpcio", "types-protobuf"] diff --git a/stubs/grpcio-reflection/METADATA.toml b/stubs/grpcio-reflection/METADATA.toml index bac12ed6b..035665f75 100644 --- a/stubs/grpcio-reflection/METADATA.toml +++ b/stubs/grpcio-reflection/METADATA.toml @@ -1,3 +1,3 @@ version = "1.*" upstream_repository = "https://github.com/grpc/grpc" -requires = ["types-grpcio", "types-protobuf"] +dependencies = ["types-grpcio", "types-protobuf"] diff --git a/stubs/grpcio-status/METADATA.toml b/stubs/grpcio-status/METADATA.toml index f70c0410a..3b05e70a7 100644 --- a/stubs/grpcio-status/METADATA.toml +++ b/stubs/grpcio-status/METADATA.toml @@ -1,3 +1,3 @@ version = "1.*" upstream_repository = "https://github.com/grpc/grpc" -requires = ["types-grpcio"] +dependencies = ["types-grpcio"] diff --git a/stubs/gunicorn/METADATA.toml b/stubs/gunicorn/METADATA.toml index ef9dc009f..7b371da44 100644 --- a/stubs/gunicorn/METADATA.toml +++ b/stubs/gunicorn/METADATA.toml @@ -1,8 +1,8 @@ version = "25.3.0" upstream_repository = "https://github.com/benoitc/gunicorn" -requires = ["types-gevent"] +dependencies = ["types-gevent"] [tool.stubtest] supported_platforms = ["linux", "darwin"] ci_platforms = ["linux", "darwin"] -stubtest_requirements = ["gevent>=1.4.0", "eventlet>=0.24.1,!=0.36.0", "tornado>=0.2", "setproctitle", "PasteDeploy", "inotify"] +stubtest_dependencies = ["gevent>=1.4.0", "eventlet>=0.24.1,!=0.36.0", "tornado>=0.2", "setproctitle", "PasteDeploy", "inotify"] diff --git a/stubs/hnswlib/METADATA.toml b/stubs/hnswlib/METADATA.toml index ac9eaa390..e7590f597 100644 --- a/stubs/hnswlib/METADATA.toml +++ b/stubs/hnswlib/METADATA.toml @@ -1,4 +1,4 @@ version = "0.8.*" # Requires a version of numpy with a `py.typed` file -requires = ["numpy>=1.21"] +dependencies = ["numpy>=1.21"] upstream_repository = "https://github.com/nmslib/hnswlib" diff --git a/stubs/html5lib/METADATA.toml b/stubs/html5lib/METADATA.toml index 3f4ba61f3..3c440b249 100644 --- a/stubs/html5lib/METADATA.toml +++ b/stubs/html5lib/METADATA.toml @@ -1,6 +1,6 @@ version = "1.1.*" upstream_repository = "https://github.com/html5lib/html5lib-python" -requires = ["types-webencodings"] +dependencies = ["types-webencodings"] [tool.stubtest] extras = ["all"] diff --git a/stubs/hvac/METADATA.toml b/stubs/hvac/METADATA.toml index 413110cd4..01a67aa87 100644 --- a/stubs/hvac/METADATA.toml +++ b/stubs/hvac/METADATA.toml @@ -1,3 +1,3 @@ version = "2.4.*" upstream_repository = "https://github.com/hvac/hvac" -requires = ["types-requests"] +dependencies = ["types-requests"] diff --git a/stubs/icalendar/METADATA.toml b/stubs/icalendar/METADATA.toml index 3596ada3c..0df94ecd9 100644 --- a/stubs/icalendar/METADATA.toml +++ b/stubs/icalendar/METADATA.toml @@ -1,7 +1,7 @@ version = "6.3.2" upstream_repository = "https://github.com/collective/icalendar" -requires = ["types-python-dateutil", "types-pytz"] +dependencies = ["types-python-dateutil", "types-pytz"] obsolete_since = "7.0.0" # Released on 2026-02-11 [tool.stubtest] -stubtest_requirements = ["pytz"] +stubtest_dependencies = ["pytz"] diff --git a/stubs/jsonschema/METADATA.toml b/stubs/jsonschema/METADATA.toml index 4f3f6a572..27bbebfc4 100644 --- a/stubs/jsonschema/METADATA.toml +++ b/stubs/jsonschema/METADATA.toml @@ -1,6 +1,6 @@ version = "~=4.26.0" upstream_repository = "https://github.com/python-jsonschema/jsonschema" -requires = ["referencing"] +dependencies = ["referencing"] [tool.stubtest] extras = ["format"] diff --git a/stubs/jwcrypto/METADATA.toml b/stubs/jwcrypto/METADATA.toml index 53d468ec6..c16192e55 100644 --- a/stubs/jwcrypto/METADATA.toml +++ b/stubs/jwcrypto/METADATA.toml @@ -1,3 +1,3 @@ version = "1.5.*" upstream_repository = "https://github.com/latchset/jwcrypto" -requires = ["cryptography"] +dependencies = ["cryptography"] diff --git a/stubs/ldap3/METADATA.toml b/stubs/ldap3/METADATA.toml index 47c015f41..852ae307a 100644 --- a/stubs/ldap3/METADATA.toml +++ b/stubs/ldap3/METADATA.toml @@ -1,10 +1,10 @@ version = "2.9.*" upstream_repository = "https://github.com/cannatag/ldap3" -requires = ["types-pyasn1"] +dependencies = ["types-pyasn1"] [tool.stubtest] apt_dependencies = ["libkrb5-dev"] # No need to install on the CI. Leaving here as information for MacOs/Windows contributors. # brew_dependencies = ["krb5"] # choco_dependencies = ["mitkerberos"] -stubtest_requirements = ["gssapi"] +stubtest_dependencies = ["gssapi"] diff --git a/stubs/networkx/METADATA.toml b/stubs/networkx/METADATA.toml index 417099c70..91999898e 100644 --- a/stubs/networkx/METADATA.toml +++ b/stubs/networkx/METADATA.toml @@ -1,8 +1,8 @@ version = "3.6.1" upstream_repository = "https://github.com/networkx/networkx" # requires a version of numpy with a `py.typed` file -requires = ["numpy>=1.20"] +dependencies = ["numpy>=1.20"] [tool.stubtest] # stub_uploader won't allow pandas-stubs in the requires field https://github.com/typeshed-internal/stub_uploader/issues/90 -stubtest_requirements = ["pandas"] +stubtest_dependencies = ["pandas"] diff --git a/stubs/paramiko/METADATA.toml b/stubs/paramiko/METADATA.toml index 1531573c8..3eef7ec96 100644 --- a/stubs/paramiko/METADATA.toml +++ b/stubs/paramiko/METADATA.toml @@ -1,7 +1,7 @@ version = "4.0.*" upstream_repository = "https://github.com/paramiko/paramiko" # Requires a version of cryptography where cryptography.hazmat.primitives.ciphers.Cipher is generic -requires = ["cryptography>=37.0.0"] +dependencies = ["cryptography>=37.0.0"] [tool.stubtest] # linux and darwin are equivalent diff --git a/stubs/peewee/METADATA.toml b/stubs/peewee/METADATA.toml index 5fc0f5088..2da90bfbf 100644 --- a/stubs/peewee/METADATA.toml +++ b/stubs/peewee/METADATA.toml @@ -5,6 +5,6 @@ upstream_repository = "https://github.com/coleifer/peewee" partial_stub = true [tool.stubtest] -stubtest_requirements = ["Flask>=2.0.0"] +stubtest_dependencies = ["Flask>=2.0.0"] # Using stubtest_allowlist to ignore playhouse modules we don't provide. ignore_missing_stub = false diff --git a/stubs/pika/METADATA.toml b/stubs/pika/METADATA.toml index e3b0e6a04..1613f073e 100644 --- a/stubs/pika/METADATA.toml +++ b/stubs/pika/METADATA.toml @@ -7,4 +7,4 @@ are maintained outside of typeshed.\ """ [tool.stubtest] -stubtest_requirements = ["gevent", "tornado", "twisted"] +stubtest_dependencies = ["gevent", "tornado", "twisted"] diff --git a/stubs/pony/METADATA.toml b/stubs/pony/METADATA.toml index 4110f557f..9311beea1 100644 --- a/stubs/pony/METADATA.toml +++ b/stubs/pony/METADATA.toml @@ -1,3 +1,3 @@ version = "0.7.*" upstream_repository = "https://github.com/ponyorm/pony" -requires = ["types-psycopg2", "types-PyMySQL"] +dependencies = ["types-psycopg2", "types-PyMySQL"] diff --git a/stubs/pycocotools/METADATA.toml b/stubs/pycocotools/METADATA.toml index cd764fe93..cb8e8b6f5 100644 --- a/stubs/pycocotools/METADATA.toml +++ b/stubs/pycocotools/METADATA.toml @@ -1,3 +1,3 @@ version = "2.0.*" upstream_repository = "https://github.com/ppwwyyxx/cocoapi" -requires = ["numpy>=2.0.0rc1"] +dependencies = ["numpy>=2.0.0rc1"] diff --git a/stubs/pyjks/METADATA.toml b/stubs/pyjks/METADATA.toml index ccc64c3d6..7697fa4ae 100644 --- a/stubs/pyjks/METADATA.toml +++ b/stubs/pyjks/METADATA.toml @@ -1,3 +1,3 @@ version = "20.0.*" upstream_repository = "https://github.com/kurtbrose/pyjks" -requires = ["types-pyasn1"] +dependencies = ["types-pyasn1"] diff --git a/stubs/pysftp/METADATA.toml b/stubs/pysftp/METADATA.toml index 8296a25da..1f9f89e66 100644 --- a/stubs/pysftp/METADATA.toml +++ b/stubs/pysftp/METADATA.toml @@ -1,6 +1,6 @@ version = "0.2.*" upstream_repository = "https://bitbucket.org/dundeemt/pysftp" -requires = ["types-paramiko"] +dependencies = ["types-paramiko"] [tool.stubtest] -stubtest_requirements = ["paramiko~=3.0"] +stubtest_dependencies = ["paramiko~=3.0"] diff --git a/stubs/python-crontab/METADATA.toml b/stubs/python-crontab/METADATA.toml index c379fed74..07cee733e 100644 --- a/stubs/python-crontab/METADATA.toml +++ b/stubs/python-crontab/METADATA.toml @@ -1,3 +1,3 @@ version = "3.3.*" upstream_repository = "https://gitlab.com/doctormo/python-crontab" -requires = ["types-croniter"] +dependencies = ["types-croniter"] diff --git a/stubs/python-jenkins/METADATA.toml b/stubs/python-jenkins/METADATA.toml index fdf458654..4155f4773 100644 --- a/stubs/python-jenkins/METADATA.toml +++ b/stubs/python-jenkins/METADATA.toml @@ -1,3 +1,3 @@ version = "~=1.8.3" upstream_repository = "https://opendev.org/jjb/python-jenkins" -requires = ["types-requests"] +dependencies = ["types-requests"] diff --git a/stubs/python-jose/METADATA.toml b/stubs/python-jose/METADATA.toml index fe3ccd39f..2ef8060c3 100644 --- a/stubs/python-jose/METADATA.toml +++ b/stubs/python-jose/METADATA.toml @@ -1,3 +1,3 @@ version = "3.5.*" upstream_repository = "https://github.com/mpdavis/python-jose" -requires = ["types-pyasn1"] # excluding pyrsa, cryptography until typing is available +dependencies = ["types-pyasn1"] # excluding pyrsa, cryptography until typing is available diff --git a/stubs/qrbill/METADATA.toml b/stubs/qrbill/METADATA.toml index 033646f39..5f26499b0 100644 --- a/stubs/qrbill/METADATA.toml +++ b/stubs/qrbill/METADATA.toml @@ -1,3 +1,3 @@ version = "1.2.*" upstream_repository = "https://github.com/claudep/swiss-qr-bill" -requires = ["types-qrcode"] +dependencies = ["types-qrcode"] diff --git a/stubs/qrcode/METADATA.toml b/stubs/qrcode/METADATA.toml index d08ef719f..591efe1fb 100644 --- a/stubs/qrcode/METADATA.toml +++ b/stubs/qrcode/METADATA.toml @@ -1,7 +1,7 @@ version = "8.2.*" upstream_repository = "https://github.com/lincolnloop/python-qrcode" # must be a version of Pillow that is py.typed -requires = ["Pillow>=10.3.0"] +dependencies = ["Pillow>=10.3.0"] [tool.stubtest] extras = ["pil"] diff --git a/stubs/requests-oauthlib/METADATA.toml b/stubs/requests-oauthlib/METADATA.toml index 0696b26cb..8f322b968 100644 --- a/stubs/requests-oauthlib/METADATA.toml +++ b/stubs/requests-oauthlib/METADATA.toml @@ -1,3 +1,3 @@ version = "2.0.*" upstream_repository = "https://github.com/requests/requests-oauthlib" -requires = ["types-oauthlib", "types-requests"] +dependencies = ["types-oauthlib", "types-requests"] diff --git a/stubs/requests/METADATA.toml b/stubs/requests/METADATA.toml index 53bfe7a02..242c54f45 100644 --- a/stubs/requests/METADATA.toml +++ b/stubs/requests/METADATA.toml @@ -1,7 +1,7 @@ version = "~=2.33.0" upstream_repository = "https://github.com/psf/requests" # requires a version of urllib3 with a py.typed file -requires = ["urllib3>=2"] +dependencies = ["urllib3>=2"] extra_description = """\ Note: `types-requests` has required `urllib3>=2` since v2.31.0.7. \ If you need to install `types-requests` into an environment \ diff --git a/stubs/resampy/METADATA.toml b/stubs/resampy/METADATA.toml index fc703115f..5ffaff579 100644 --- a/stubs/resampy/METADATA.toml +++ b/stubs/resampy/METADATA.toml @@ -1,4 +1,4 @@ version = "0.4.*" upstream_repository = "https://github.com/bmcfee/resampy" # Requires a version of numpy with a `py.typed` file -requires = ["numpy>=1.20"] +dependencies = ["numpy>=1.20"] diff --git a/stubs/s2clientprotocol/METADATA.toml b/stubs/s2clientprotocol/METADATA.toml index 6631acf0a..346c68995 100644 --- a/stubs/s2clientprotocol/METADATA.toml +++ b/stubs/s2clientprotocol/METADATA.toml @@ -3,5 +3,5 @@ # When updating, also re-run the script version = "5.*" upstream_repository = "https://github.com/Blizzard/s2client-proto" -requires = ["types-protobuf"] +dependencies = ["types-protobuf"] extra_description = "Partially generated using [mypy-protobuf==3.6.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.6.0) and libprotoc 27.2 on [s2client-proto 5.0.12.91115.0](https://github.com/Blizzard/s2client-proto/tree/c04df4adbe274858a4eb8417175ee32ad02fd609)." diff --git a/stubs/seaborn/METADATA.toml b/stubs/seaborn/METADATA.toml index 617bc4ef5..fc0d27d7d 100644 --- a/stubs/seaborn/METADATA.toml +++ b/stubs/seaborn/METADATA.toml @@ -1,4 +1,4 @@ version = "0.13.2" # Requires a version of numpy and matplotlib with a `py.typed` file -requires = ["matplotlib>=3.8", "numpy>=1.20", "pandas-stubs"] +dependencies = ["matplotlib>=3.8", "numpy>=1.20", "pandas-stubs"] upstream_repository = "https://github.com/mwaskom/seaborn" diff --git a/stubs/setuptools/METADATA.toml b/stubs/setuptools/METADATA.toml index 1c1e95de1..cef335f1e 100644 --- a/stubs/setuptools/METADATA.toml +++ b/stubs/setuptools/METADATA.toml @@ -8,4 +8,4 @@ it is no longer included with `types-setuptools`. [tool.stubtest] # darwin is equivalent to linux for OS-specific methods ci_platforms = ["linux", "win32"] -stubtest_requirements = ["tomli"] +stubtest_dependencies = ["tomli"] diff --git a/stubs/shapely/METADATA.toml b/stubs/shapely/METADATA.toml index 023f0b416..51f0a5f9f 100644 --- a/stubs/shapely/METADATA.toml +++ b/stubs/shapely/METADATA.toml @@ -1,4 +1,4 @@ version = "2.1.*" # Requires a version of numpy with a `py.typed` file -requires = ["numpy>=1.20"] +dependencies = ["numpy>=1.20"] upstream_repository = "https://github.com/shapely/shapely" diff --git a/stubs/simple-websocket/METADATA.toml b/stubs/simple-websocket/METADATA.toml index 9b307e6bd..31e3d56b0 100644 --- a/stubs/simple-websocket/METADATA.toml +++ b/stubs/simple-websocket/METADATA.toml @@ -1,3 +1,3 @@ version = "1.1.*" upstream_repository = "https://github.com/miguelgrinberg/simple-websocket" -requires = ["wsproto"] +dependencies = ["wsproto"] diff --git a/stubs/slumber/METADATA.toml b/stubs/slumber/METADATA.toml index e408f2381..8d68695b2 100644 --- a/stubs/slumber/METADATA.toml +++ b/stubs/slumber/METADATA.toml @@ -1,3 +1,3 @@ version = "0.7.*" upstream_repository = "https://github.com/samgiles/slumber" -requires = ["types-requests"] +dependencies = ["types-requests"] diff --git a/stubs/tensorflow/METADATA.toml b/stubs/tensorflow/METADATA.toml index a207ca056..3ac4c530b 100644 --- a/stubs/tensorflow/METADATA.toml +++ b/stubs/tensorflow/METADATA.toml @@ -3,14 +3,14 @@ version = "~=2.18.0" upstream_repository = "https://github.com/tensorflow/tensorflow" # requires a version of numpy with a `py.typed` file -requires = ["numpy>=1.20", "types-protobuf", "types-requests"] +dependencies = ["numpy>=1.20", "types-protobuf", "types-requests"] extra_description = "Partially generated using [mypy-protobuf==3.6.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.6.0) and libprotoc 27.2 on `tensorflow==2.18.0`." partial_stub = true [tool.stubtest] ignore_missing_stub = true # TODO: Support/update to keras 3.7 -stubtest_requirements = ["keras==3.6.*"] +stubtest_dependencies = ["keras==3.6.*"] # tensorflow 2.19 doesn't support Python 3.13: # https://github.com/tensorflow/tensorflow/issues/78774 skip = true diff --git a/stubs/tqdm/METADATA.toml b/stubs/tqdm/METADATA.toml index 0c79774d8..f1ebe9b5a 100644 --- a/stubs/tqdm/METADATA.toml +++ b/stubs/tqdm/METADATA.toml @@ -1,10 +1,10 @@ version = "4.67.3" upstream_repository = "https://github.com/tqdm/tqdm" -requires = ["types-requests"] +dependencies = ["types-requests"] [tool.stubtest] extras = ["slack", "telegram"] # Add `"tensorflow"` to this list when there's a tensorflow release supporting # Python 3.13: https://github.com/tensorflow/tensorflow/issues/78774. # Also remove tqdm.keras from @tests/stubtest_allowlist.txt. -stubtest_requirements = ["dask", "pandas", "rich"] +stubtest_dependencies = ["dask", "pandas", "rich"] diff --git a/stubs/yt-dlp/METADATA.toml b/stubs/yt-dlp/METADATA.toml index 1981804ad..4c7c84862 100644 --- a/stubs/yt-dlp/METADATA.toml +++ b/stubs/yt-dlp/METADATA.toml @@ -1,3 +1,3 @@ version = "2026.3.17" upstream_repository = "https://github.com/yt-dlp/yt-dlp" -requires = ["websockets"] +dependencies = ["websockets"] diff --git a/tests/regr_test.py b/tests/regr_test.py index b37509ad9..da1496145 100755 --- a/tests/regr_test.py +++ b/tests/regr_test.py @@ -125,7 +125,7 @@ def setup_testcase_dir(package: DistributionTests, tempdir: Path, verbosity: Ver return # HACK: we want to run these test cases in an isolated environment -- - # we want mypy to see all stub packages listed in the "requires" field of METADATA.toml + # we want mypy to see all stub packages listed in the "dependencies" field of METADATA.toml # (and all stub packages required by those stub packages, etc. etc.), # but none of the other stubs in typeshed. # diff --git a/tests/stubtest_third_party.py b/tests/stubtest_third_party.py index 17f2f2308..bb69d1232 100755 --- a/tests/stubtest_third_party.py +++ b/tests/stubtest_third_party.py @@ -83,7 +83,7 @@ def run_stubtest(dist: Path, *, verbose: bool = False, ci_platforms_only: bool = dists_to_install = [dist_req, get_mypy_req()] # Internal requirements are added to MYPYPATH dists_to_install.extend(str(r) for r in requirements.external_pkgs) - dists_to_install.extend(stubtest_settings.stubtest_requirements) + dists_to_install.extend(stubtest_settings.stubtest_dependencies) # Since the "gdb" Python package is available only inside GDB, it is not # possible to install it through pip, so stub tests cannot install it.