From 6da2e85894bbcbd6933be9c1963e2b8c34fe3d1f Mon Sep 17 00:00:00 2001 From: Stella Huang Date: Wed, 15 Apr 2026 13:41:29 -0700 Subject: [PATCH] Update typeshed to bd18cc640cba4dadc51ac9a5157b79ff6adf5de3 --- .../typeshed-fallback/commit.txt | 2 +- .../typeshed-fallback/stdlib/_bisect.pyi | 58 ++- .../typeshed-fallback/stdlib/_codecs.pyi | 4 +- .../typeshed-fallback/stdlib/_operator.pyi | 79 ++-- .../typeshed-fallback/stdlib/_pickle.pyi | 5 +- .../typeshed-fallback/stdlib/_socket.pyi | 4 +- .../typeshed-fallback/stdlib/_sqlite3.pyi | 12 +- .../typeshed-fallback/stdlib/_ssl.pyi | 7 +- .../stdlib/_typeshed/__init__.pyi | 6 + .../typeshed-fallback/stdlib/argparse.pyi | 36 +- .../stdlib/asyncio/base_tasks.pyi | 16 +- .../stdlib/asyncio/unix_events.pyi | 80 ++-- .../typeshed-fallback/stdlib/builtins.pyi | 6 - .../typeshed-fallback/stdlib/code.pyi | 1 + .../typeshed-fallback/stdlib/codecs.pyi | 4 +- .../stdlib/concurrent/futures/process.pyi | 2 +- .../concurrent/interpreters/__init__.pyi | 2 +- .../concurrent/interpreters/_crossinterp.pyi | 2 +- .../concurrent/interpreters/_queues.pyi | 2 +- .../typeshed-fallback/stdlib/configparser.pyi | 19 +- .../typeshed-fallback/stdlib/contextlib.pyi | 18 +- .../stdlib/email/message.pyi | 10 +- .../stdlib/importlib/metadata/__init__.pyi | 3 +- .../stdlib/json/__init__.pyi | 6 +- .../stdlib/lib2to3/fixes/fix_except.pyi | 2 +- .../stdlib/lib2to3/fixes/fix_import.pyi | 2 +- .../stdlib/lib2to3/fixes/fix_imports.pyi | 2 +- .../stdlib/lib2to3/fixes/fix_metaclass.pyi | 2 +- .../stdlib/lib2to3/fixes/fix_renames.pyi | 2 +- .../stdlib/lib2to3/fixes/fix_urllib.pyi | 2 +- .../stdlib/lib2to3/refactor.pyi | 4 +- .../typeshed-fallback/stdlib/mmap.pyi | 2 +- .../typeshed-fallback/stdlib/os/__init__.pyi | 42 +- .../stdlib/pathlib/__init__.pyi | 10 +- .../typeshed-fallback/stdlib/pickle.pyi | 5 +- .../typeshed-fallback/stdlib/signal.pyi | 3 +- .../stdlib/sqlite3/__init__.pyi | 4 +- .../typeshed-fallback/stdlib/ssl.pyi | 16 +- .../typeshed-fallback/stdlib/statistics.pyi | 4 +- .../typeshed-fallback/stdlib/tarfile.pyi | 108 ++--- .../typeshed-fallback/stdlib/threading.pyi | 4 +- .../stdlib/tkinter/__init__.pyi | 4 +- .../typeshed-fallback/stdlib/tkinter/ttk.pyi | 5 + .../typeshed-fallback/stdlib/tokenize.pyi | 4 +- .../typeshed-fallback/stdlib/traceback.pyi | 10 +- .../stdlib/typing_extensions.pyi | 2 +- .../stdlib/unittest/main.pyi | 4 +- .../stdlib/xml/etree/ElementPath.pyi | 6 +- .../stdlib/xml/etree/ElementTree.pyi | 10 +- .../stubs/Authlib/METADATA.toml | 6 +- .../httpx_client/oauth1_client.pyi | 2 +- .../httpx_client/oauth2_client.pyi | 4 +- .../stubs/Deprecated/METADATA.toml | 4 +- .../stubs/Flask-Cors/METADATA.toml | 4 +- .../stubs/Flask-Migrate/METADATA.toml | 4 +- .../stubs/Flask-SocketIO/METADATA.toml | 4 +- .../stubs/JACK-Client/METADATA.toml | 12 +- .../stubs/JACK-Client/jack/__init__.pyi | 2 +- .../stubs/Jetson.GPIO/METADATA.toml | 2 +- .../stubs/Markdown/METADATA.toml | 2 +- .../stubs/PyAutoGUI/METADATA.toml | 4 +- .../stubs/PyMeeus/METADATA.toml | 2 +- .../stubs/PyMySQL/METADATA.toml | 2 +- .../stubs/PyScreeze/METADATA.toml | 8 +- .../stubs/PyScreeze/pyscreeze/__init__.pyi | 8 +- .../stubs/PySocks/METADATA.toml | 2 +- .../stubs/PyYAML/METADATA.toml | 2 +- .../stubs/Pygments/METADATA.toml | 11 +- .../stubs/Pygments/pygments/__init__.pyi | 15 +- .../stubs/Pygments/pygments/cmdline.pyi | 7 +- .../stubs/Pygments/pygments/console.pyi | 16 +- .../stubs/Pygments/pygments/filter.pyi | 29 +- .../Pygments/pygments/filters/__init__.pyi | 94 ++-- .../stubs/Pygments/pygments/formatter.pyi | 67 ++- .../Pygments/pygments/formatters/__init__.pyi | 26 ++ .../Pygments/pygments/formatters/bbcode.pyi | 13 +- .../Pygments/pygments/formatters/groff.pyi | 18 + .../Pygments/pygments/formatters/html.pyi | 11 +- .../Pygments/pygments/formatters/img.pyi | 33 +- .../Pygments/pygments/formatters/irc.pyi | 11 +- .../Pygments/pygments/formatters/latex.pyi | 11 +- .../Pygments/pygments/formatters/other.pyi | 21 +- .../pygments/formatters/pangomarkup.pyi | 11 +- .../Pygments/pygments/formatters/rtf.pyi | 13 +- .../Pygments/pygments/formatters/svg.pyi | 11 +- .../Pygments/pygments/formatters/terminal.pyi | 13 +- .../pygments/formatters/terminal256.pyi | 19 +- .../stubs/Pygments/pygments/lexer.pyi | 41 +- .../Pygments/pygments/lexers/__init__.pyi | 8 +- .../stubs/Pygments/pygments/modeline.pyi | 4 +- .../stubs/Pygments/pygments/plugin.pyi | 9 +- .../stubs/Pygments/pygments/regexopt.pyi | 16 +- .../stubs/Pygments/pygments/scanner.pyi | 22 +- .../stubs/Pygments/pygments/sphinxext.pyi | 13 +- .../stubs/Pygments/pygments/style.pyi | 33 +- .../stubs/Pygments/pygments/token.pyi | 8 +- .../stubs/Pygments/pygments/unistring.pyi | 105 +++-- .../stubs/Pygments/pygments/util.pyi | 61 ++- .../stubs/RPi.GPIO/METADATA.toml | 6 +- .../stubs/RPi.GPIO/RPi/GPIO/__init__.pyi | 3 +- .../stubs/Send2Trash/METADATA.toml | 2 +- .../stubs/TgCrypto/METADATA.toml | 2 +- .../stubs/WTForms/METADATA.toml | 4 +- .../stubs/WTForms/wtforms/fields/choices.pyi | 2 +- .../stubs/WebOb/METADATA.toml | 2 +- .../stubs/WebOb/webob/_types.pyi | 4 +- .../stubs/WebOb/webob/request.pyi | 2 +- .../stubs/aiofiles/METADATA.toml | 4 +- .../aiofiles/aiofiles/threadpool/__init__.pyi | 5 +- .../antlr4-python3-runtime/METADATA.toml | 4 +- .../antlr4/ParserRuleContext.pyi | 2 +- .../antlr4/RuleContext.pyi | 2 +- .../stubs/assertpy/METADATA.toml | 2 +- .../stubs/atheris/METADATA.toml | 6 +- .../stubs/auth0-python/METADATA.toml | 4 +- .../stubs/aws-xray-sdk/METADATA.toml | 2 +- .../stubs/behave/METADATA.toml | 6 + .../stubs/behave/behave/__init__.pyi | 13 + .../stubs/behave/behave/fixture.pyi | 15 + .../stubs/behave/behave/runner.pyi | 38 ++ .../stubs/behave/behave/step_registry.pyi | 20 + .../stubs/binaryornot/METADATA.toml | 3 +- .../stubs/bleach/METADATA.toml | 4 +- .../stubs/bleach/bleach/html5lib_shim.pyi | 4 +- .../stubs/boltons/METADATA.toml | 2 +- .../stubs/boltons/boltons/cacheutils.pyi | 4 +- .../stubs/boltons/boltons/dictutils.pyi | 12 +- .../stubs/boltons/boltons/fileutils.pyi | 2 +- .../stubs/boltons/boltons/iterutils.pyi | 12 +- .../stubs/boltons/boltons/jsonutils.pyi | 8 +- .../stubs/boltons/boltons/setutils.pyi | 6 +- .../stubs/boltons/boltons/strutils.pyi | 2 +- .../stubs/boltons/boltons/timeutils.pyi | 2 +- .../stubs/braintree/METADATA.toml | 2 +- .../braintree/paginated_collection.pyi | 2 +- .../braintree/resource_collection.pyi | 2 +- .../stubs/cachetools/METADATA.toml | 2 +- .../stubs/cachetools/cachetools/__init__.pyi | 4 +- .../stubs/cachetools/cachetools/func.pyi | 11 +- .../stubs/capturer/METADATA.toml | 2 +- .../stubs/cffi/METADATA.toml | 8 +- .../typeshed-fallback/stubs/cffi/cffi/api.pyi | 2 +- .../stubs/cffi/cffi/model.pyi | 4 +- .../stubs/channels/METADATA.toml | 10 +- .../stubs/channels/channels/consumer.pyi | 4 +- .../stubs/chevron/METADATA.toml | 2 +- .../stubs/click-default-group/METADATA.toml | 4 +- .../stubs/click-log/METADATA.toml | 4 +- .../stubs/click-shell/METADATA.toml | 4 +- .../stubs/click-spinner/METADATA.toml | 2 +- .../stubs/click-web/METADATA.toml | 4 +- .../stubs/colorama/METADATA.toml | 4 +- .../stubs/colorful/METADATA.toml | 2 +- .../stubs/console-menu/METADATA.toml | 2 +- .../consolemenu/menu_component.pyi | 12 +- .../stubs/convertdate/METADATA.toml | 2 +- .../stubs/croniter/METADATA.toml | 4 +- .../stubs/croniter/croniter/__init__.pyi | 21 + .../stubs/croniter/croniter/croniter.pyi | 64 ++- .../stubs/datauri/METADATA.toml | 2 +- .../stubs/dateparser/METADATA.toml | 4 +- .../dateparser/dateparser/search/__init__.pyi | 4 +- .../dateparser/dateparser/timezone_parser.pyi | 6 +- .../stubs/decorator/METADATA.toml | 2 +- .../stubs/defusedxml/METADATA.toml | 4 +- .../stubs/dirhash/METADATA.toml | 2 +- .../stubs/dirhash/dirhash/__init__.pyi | 2 +- .../stubs/django-filter/METADATA.toml | 8 +- .../stubs/django-import-export/METADATA.toml | 4 +- .../import_export/widgets.pyi | 9 +- .../stubs/docker/METADATA.toml | 4 +- .../stubs/docker/docker/api/build.pyi | 2 +- .../stubs/docker/docker/api/swarm.pyi | 87 +++- .../stubs/docker/docker/models/configs.pyi | 2 +- .../stubs/docker/docker/models/containers.pyi | 79 ++-- .../stubs/docker/docker/models/networks.pyi | 4 +- .../stubs/docker/docker/models/plugins.pyi | 22 +- .../stubs/docker/docker/models/services.pyi | 2 +- .../stubs/docker/docker/models/volumes.pyi | 2 +- .../docker/transport/basehttpadapter.pyi | 13 + .../stubs/docker/docker/transport/sshconn.pyi | 10 +- .../stubs/docker/docker/types/base.pyi | 8 +- .../stubs/docker/docker/types/containers.pyi | 90 ++-- .../stubs/docker/docker/types/daemon.pyi | 4 +- .../stubs/docker/docker/types/healthcheck.pyi | 39 +- .../stubs/docker/docker/types/networks.pyi | 17 +- .../stubs/docker/docker/types/services.pyi | 38 +- .../stubs/dockerfile-parse/METADATA.toml | 2 +- .../stubs/docutils/METADATA.toml | 2 +- .../stubs/docutils/docutils/__init__.pyi | 3 +- .../stubs/docutils/docutils/statemachine.pyi | 2 +- .../stubs/editdistance/METADATA.toml | 2 +- .../stubs/entrypoints/METADATA.toml | 2 +- .../stubs/ephem/METADATA.toml | 2 +- .../stubs/ephem/ephem/_libastro.pyi | 8 +- .../stubs/et_xmlfile/METADATA.toml | 2 +- .../stubs/fanstatic/METADATA.toml | 6 +- .../stubs/first/METADATA.toml | 2 +- .../stubs/flake8-bugbear/METADATA.toml | 2 +- .../stubs/flake8-builtins/METADATA.toml | 4 +- .../stubs/flake8-docstrings/METADATA.toml | 4 +- .../stubs/flake8-rst-docstrings/METADATA.toml | 2 +- .../flake8_rst_docstrings.pyi | 2 +- .../stubs/flake8-simplify/METADATA.toml | 2 +- .../flake8_simplify/__init__.pyi | 2 +- .../stubs/flake8-typing-imports/METADATA.toml | 2 +- .../stubs/flake8/METADATA.toml | 4 +- .../stubs/flake8/flake8/discover_files.pyi | 2 +- .../stubs/flake8/flake8/plugins/finder.pyi | 2 +- .../flake8/flake8/plugins/pycodestyle.pyi | 4 +- .../stubs/flake8/flake8/plugins/pyflakes.pyi | 2 +- .../stubs/flake8/flake8/processor.pyi | 4 +- .../stubs/flake8/flake8/statistics.pyi | 2 +- .../stubs/flake8/flake8/style_guide.pyi | 6 +- .../stubs/fpdf2/METADATA.toml | 8 +- .../stubs/fpdf2/fpdf/_fonttools_shims.pyi | 3 +- .../stubs/fpdf2/fpdf/drawing.pyi | 4 +- .../stubs/fpdf2/fpdf/encryption.pyi | 2 +- .../stubs/fpdf2/fpdf/fonts.pyi | 2 +- .../typeshed-fallback/stubs/gdb/METADATA.toml | 8 +- .../stubs/geopandas/METADATA.toml | 8 +- .../stubs/gevent/METADATA.toml | 14 +- .../stubs/gevent/gevent/_types.pyi | 12 +- .../stubs/google-cloud-ndb/METADATA.toml | 6 +- .../google/cloud/ndb/_cache.pyi | 8 +- .../stubs/greenlet/METADATA.toml | 4 +- .../stubs/grpcio-channelz/METADATA.toml | 4 +- .../grpcio-health-checking/METADATA.toml | 4 +- .../stubs/grpcio-reflection/METADATA.toml | 4 +- .../stubs/grpcio-status/METADATA.toml | 4 +- .../stubs/grpcio/METADATA.toml | 6 +- .../stubs/gunicorn/METADATA.toml | 12 +- .../stubs/gunicorn/gunicorn/asgi/__init__.pyi | 3 +- .../stubs/gunicorn/gunicorn/asgi/message.pyi | 50 --- .../stubs/gunicorn/gunicorn/asgi/parser.pyi | 157 +++++++ .../stubs/gunicorn/gunicorn/asgi/protocol.pyi | 34 ++ .../gunicorn/gunicorn/asgi/websocket.pyi | 7 +- .../stubs/gunicorn/gunicorn/config.pyi | 13 + .../stubs/gunicorn/gunicorn/ctl/handlers.pyi | 114 ++++- .../stubs/gunicorn/gunicorn/glogging.pyi | 2 + .../stubs/gunicorn/gunicorn/http/body.pyi | 2 +- .../stubs/gunicorn/gunicorn/http/errors.pyi | 8 +- .../stubs/gunicorn/gunicorn/http/wsgi.pyi | 20 +- .../stubs/gunicorn/gunicorn/http2/stream.pyi | 1 + .../stubs/gunicorn/gunicorn/pidfile.pyi | 3 + .../stubs/gunicorn/gunicorn/util.pyi | 4 +- .../gunicorn/gunicorn/workers/gthread.pyi | 8 + .../stubs/hdbcli/METADATA.toml | 2 +- .../stubs/hnswlib/METADATA.toml | 4 +- .../stubs/html5lib/METADATA.toml | 4 +- .../stubs/httplib2/METADATA.toml | 2 +- .../stubs/httplib2/httplib2/__init__.pyi | 4 +- .../stubs/hvac/METADATA.toml | 4 +- .../stubs/ibm-db/METADATA.toml | 2 +- .../stubs/icalendar/METADATA.toml | 8 +- .../stubs/inifile/METADATA.toml | 2 +- .../stubs/jmespath/METADATA.toml | 2 +- .../stubs/jsonnet/METADATA.toml | 4 +- .../stubs/jsonschema/METADATA.toml | 4 +- .../stubs/jsonschema/jsonschema/_utils.pyi | 19 +- .../jsonschema/jsonschema/validators.pyi | 10 +- .../stubs/jwcrypto/METADATA.toml | 6 +- .../stubs/jwcrypto/jwcrypto/jwa.pyi | 1 + .../stubs/jwcrypto/jwcrypto/jwe.pyi | 29 +- .../stubs/jwcrypto/jwcrypto/jwk.pyi | 13 +- .../stubs/jwcrypto/jwcrypto/jws.pyi | 9 +- .../stubs/jwcrypto/jwcrypto/jwt.pyi | 5 +- .../stubs/jwcrypto/jwcrypto/version.pyi | 3 + .../stubs/keyboard/METADATA.toml | 4 +- .../stubs/keyboard/keyboard/__init__.pyi | 2 +- .../stubs/ldap3/METADATA.toml | 12 +- .../stubs/ldap3/ldap3/protocol/novell.pyi | 2 +- .../stubs/ldap3/ldap3/protocol/rfc4511.pyi | 24 +- .../stubs/lunardate/METADATA.toml | 2 +- .../stubs/lupa/METADATA.toml | 2 +- .../stubs/lzstring/METADATA.toml | 2 +- .../stubs/m3u8/METADATA.toml | 2 +- .../stubs/mock/METADATA.toml | 2 +- .../stubs/mypy-extensions/METADATA.toml | 2 +- .../stubs/mysqlclient/METADATA.toml | 4 +- .../stubs/nanoid/METADATA.toml | 2 +- .../stubs/nanoleafapi/METADATA.toml | 2 +- .../stubs/netaddr/METADATA.toml | 2 +- .../stubs/netifaces/METADATA.toml | 2 +- .../stubs/networkx/METADATA.toml | 6 +- .../algorithms/assortativity/pairs.pyi | 6 +- .../networkx/networkx/algorithms/boundary.pyi | 22 +- .../networkx/networkx/algorithms/bridges.pyi | 10 +- .../algorithms/centrality/flow_matrix.pyi | 2 +- .../networkx/networkx/algorithms/chains.pyi | 2 +- .../networkx/networkx/algorithms/chordal.pyi | 2 +- .../networkx/networkx/algorithms/clique.pyi | 4 +- .../algorithms/coloring/greedy_coloring.pyi | 6 +- .../networkx/algorithms/community/kclique.pyi | 2 +- .../community/label_propagation.pyi | 2 +- .../networkx/algorithms/community/louvain.pyi | 2 +- .../connectivity/disjoint_paths.pyi | 4 +- .../connectivity/edge_augmentation.pyi | 2 +- .../connectivity/edge_kcomponents.pyi | 6 +- .../algorithms/connectivity/kcutsets.pyi | 2 +- .../networkx/networkx/algorithms/dag.pyi | 12 +- .../networkx/networkx/algorithms/euler.pyi | 6 +- .../algorithms/flow/networksimplex.pyi | 4 +- .../algorithms/isomorphism/ismags.pyi | 4 +- .../algorithms/isomorphism/isomorphvf2.pyi | 12 +- .../algorithms/lowest_common_ancestors.pyi | 4 +- .../networkx/algorithms/planarity.pyi | 5 +- .../algorithms/shortest_paths/unweighted.pyi | 2 +- .../networkx/algorithms/similarity.pyi | 2 +- .../networkx/algorithms/simple_paths.pyi | 2 +- .../networkx/networkx/algorithms/triads.pyi | 2 +- .../networkx/networkx/classes/function.pyi | 22 +- .../stubs/networkx/networkx/classes/graph.pyi | 3 +- .../networkx/networkx/readwrite/adjlist.pyi | 2 +- .../networkx/networkx/readwrite/edgelist.pyi | 2 +- .../networkx/networkx/readwrite/gexf.pyi | 2 +- .../stubs/networkx/networkx/readwrite/gml.pyi | 2 +- .../networkx/networkx/readwrite/graphml.pyi | 4 +- .../networkx/readwrite/multiline_adjlist.pyi | 2 +- .../networkx/networkx/readwrite/pajek.pyi | 2 +- .../stubs/networkx/networkx/utils/configs.pyi | 2 +- .../stubs/networkx/networkx/utils/rcm.pyi | 2 +- .../stubs/oauthlib/METADATA.toml | 2 +- .../stubs/oauthlib/oauthlib/common.pyi | 30 ++ .../oauthlib/oauth1/rfc5849/__init__.pyi | 30 +- .../oauth1/rfc5849/endpoints/base.pyi | 6 +- .../oauthlib/oauth1/rfc5849/errors.pyi | 8 +- .../oauthlib/oauth1/rfc5849/parameters.pyi | 4 +- .../oauthlib/oauth1/rfc5849/utils.pyi | 8 +- .../oauthlib/oauth2/rfc6749/errors.pyi | 4 +- .../stubs/oauthlib/oauthlib/signals.pyi | 18 +- .../stubs/objgraph/METADATA.toml | 2 +- .../stubs/olefile/METADATA.toml | 2 +- .../stubs/openpyxl/METADATA.toml | 2 +- .../openpyxl/openpyxl/chart/reference.pyi | 4 +- .../openpyxl/comments/comment_sheet.pyi | 2 +- .../openpyxl/descriptors/sequence.pyi | 8 +- .../openpyxl/openpyxl/packaging/manifest.pyi | 2 +- .../openpyxl/packaging/relationship.pyi | 2 +- .../openpyxl/openpyxl/reader/workbook.pyi | 2 +- .../stubs/openpyxl/openpyxl/styles/colors.pyi | 2 +- .../stubs/openpyxl/openpyxl/utils/cell.pyi | 4 +- .../openpyxl/openpyxl/utils/dataframe.pyi | 4 +- .../openpyxl/workbook/defined_name.pyi | 2 +- .../openpyxl/worksheet/_read_only.pyi | 4 +- .../openpyxl/openpyxl/worksheet/_reader.pyi | 2 +- .../openpyxl/openpyxl/worksheet/_writer.pyi | 4 +- .../openpyxl/worksheet/cell_range.pyi | 4 +- .../openpyxl/openpyxl/worksheet/worksheet.pyi | 24 +- .../openpyxl/xml/_functions_overloads.pyi | 20 +- .../stubs/opentracing/METADATA.toml | 2 +- .../stubs/paramiko/METADATA.toml | 6 +- .../stubs/paramiko/paramiko/util.pyi | 5 +- .../stubs/parsimonious/METADATA.toml | 2 +- .../stubs/passpy/METADATA.toml | 2 +- .../stubs/peewee/METADATA.toml | 8 +- .../typeshed-fallback/stubs/peewee/peewee.pyi | 12 +- .../stubs/pep8-naming/METADATA.toml | 2 +- .../stubs/pexpect/METADATA.toml | 2 +- .../stubs/pika/METADATA.toml | 8 +- .../pika/adapters/blocking_connection.pyi | 2 +- .../stubs/polib/METADATA.toml | 2 +- .../stubs/pony/METADATA.toml | 4 +- .../stubs/pony/pony/flask/__init__.pyi | 3 +- .../stubs/portpicker/METADATA.toml | 2 +- .../stubs/protobuf/METADATA.toml | 10 +- .../stubs/protobuf/google/_upb/_message.pyi | 413 +++++++++--------- .../stubs/protobuf/google/protobuf/any.pyi | 13 + .../protobuf/google/protobuf/descriptor.pyi | 272 ++++++------ .../google/protobuf/descriptor_database.pyi | 10 +- .../google/protobuf/descriptor_pool.pyi | 46 +- .../protobuf/google/protobuf/duration.pyi | 16 + .../google/protobuf/internal/builder.pyi | 9 +- .../google/protobuf/internal/containers.pyi | 71 +-- .../google/protobuf/internal/decoder.pyi | 27 +- .../protobuf/internal/enum_type_wrapper.pyi | 3 +- .../protobuf/internal/extension_dict.pyi | 4 +- .../google/protobuf/internal/field_mask.pyi | 14 + .../protobuf/internal/message_listener.pyi | 2 +- .../internal/python_edition_defaults.pyi | 0 .../protobuf/internal/python_message.pyi | 6 +- .../protobuf/internal/testing_refleaks.pyi | 21 + .../protobuf/internal/type_checkers.pyi | 46 +- .../protobuf/internal/well_known_types.pyi | 36 +- .../google/protobuf/internal/wire_format.pyi | 92 ++-- .../protobuf/google/protobuf/json_format.pyi | 7 +- .../protobuf/google/protobuf/message.pyi | 23 +- .../google/protobuf/message_factory.pyi | 8 +- .../stubs/protobuf/google/protobuf/proto.pyi | 14 + .../google/protobuf/proto_builder.pyi | 8 + .../protobuf/google/protobuf/proto_json.pyi | 21 + .../protobuf/google/protobuf/proto_text.pyi | 32 ++ .../protobuf/google/protobuf/reflection.pyi | 12 +- .../google/protobuf/service_reflection.pyi | 7 + .../google/protobuf/symbol_database.pyi | 5 +- .../google/protobuf/text_encoding.pyi | 2 + .../protobuf/google/protobuf/text_format.pyi | 20 +- .../protobuf/google/protobuf/timestamp.pyi | 16 + .../google/protobuf/unknown_fields.pyi | 9 + .../stubs/psutil/METADATA.toml | 4 +- .../stubs/psutil/psutil/_pswindows.pyi | 12 +- .../stubs/psycopg2/METADATA.toml | 4 +- .../stubs/punq/METADATA.toml | 2 +- .../stubs/pyasn1/METADATA.toml | 2 +- .../stubs/pyasn1/pyasn1/codec/streaming.pyi | 6 +- .../stubs/pyasn1/pyasn1/type/base.pyi | 2 +- .../stubs/pyasn1/pyasn1/type/namedval.pyi | 2 +- .../stubs/pyasn1/pyasn1/type/univ.pyi | 14 +- .../stubs/pyaudio/METADATA.toml | 8 +- .../stubs/pycocotools/METADATA.toml | 4 +- .../stubs/pycurl/METADATA.toml | 4 +- .../typeshed-fallback/stubs/pycurl/pycurl.pyi | 10 +- .../stubs/pyfarmhash/METADATA.toml | 2 +- .../stubs/pyflakes/METADATA.toml | 2 +- .../stubs/pyinstaller/METADATA.toml | 2 +- .../PyInstaller/depend/imphookapi.pyi | 2 +- .../lib/modulegraph/modulegraph.pyi | 3 +- .../stubs/pyjks/METADATA.toml | 4 +- .../stubs/pyluach/METADATA.toml | 2 +- .../stubs/pynput/METADATA.toml | 4 +- .../stubs/pyperclip/METADATA.toml | 6 +- .../stubs/pyserial/METADATA.toml | 4 +- .../stubs/pysftp/METADATA.toml | 6 +- .../stubs/pysftp/pysftp/__init__.pyi | 4 +- .../stubs/pytest-lazy-fixture/METADATA.toml | 2 +- .../stubs/python-crontab/METADATA.toml | 4 +- .../stubs/python-crontab/cronlog.pyi | 2 +- .../stubs/python-dateutil/METADATA.toml | 2 +- .../dateutil/parser/_parser.pyi | 2 +- .../dateutil/parser/isoparser.pyi | 2 +- .../stubs/python-dateutil/dateutil/rrule.pyi | 4 +- .../python-dateutil/dateutil/tz/_common.pyi | 3 +- .../stubs/python-dateutil/dateutil/tz/tz.pyi | 12 +- .../stubs/python-dateutil/dateutil/utils.pyi | 5 +- .../stubs/python-http-client/METADATA.toml | 2 +- .../stubs/python-jenkins/METADATA.toml | 4 +- .../stubs/python-jose/METADATA.toml | 4 +- .../stubs/python-nmap/METADATA.toml | 2 +- .../stubs/python-xlib/METADATA.toml | 2 +- .../stubs/pytz/METADATA.toml | 2 +- .../stubs/pywin32/METADATA.toml | 6 +- .../stubs/pywin32/_win32typing.pyi | 26 +- .../stubs/pywin32/pythoncom.pyi | 4 +- .../stubs/pywin32/pythonwin/dde.pyi | 10 +- .../stubs/pywin32/pythonwin/win32ui.pyi | 14 +- .../stubs/pywin32/pythonwin/win32uiole.pyi | 2 +- .../stubs/pywin32/win32/lib/win2kras.pyi | 2 +- .../pywin32/win32/lib/win32gui_struct.pyi | 25 +- .../stubs/pywin32/win32/win32api.pyi | 12 +- .../stubs/pywin32/win32/win32event.pyi | 2 +- .../stubs/pywin32/win32/win32file.pyi | 4 +- .../stubs/pywin32/win32/win32gui.pyi | 50 +-- .../stubs/pywin32/win32/win32inet.pyi | 8 +- .../stubs/pywin32/win32/win32net.pyi | 10 +- .../stubs/pywin32/win32/win32pdh.pyi | 3 +- .../stubs/pywin32/win32/win32process.pyi | 8 +- .../stubs/pywin32/win32/win32ras.pyi | 6 +- .../stubs/pywin32/win32/win32security.pyi | 15 +- .../stubs/pywin32/win32/win32trace.pyi | 20 +- .../pywin32/win32com/client/__init__.pyi | 49 +-- .../stubs/pywin32/win32com/client/build.pyi | 84 ++-- .../stubs/pywin32/win32com/client/dynamic.pyi | 46 +- .../pywin32/win32com/client/gencache.pyi | 60 ++- .../stubs/pywin32/win32com/olectl.pyi | 102 ++--- .../stubs/pywin32/win32com/server/connect.pyi | 19 +- .../pywin32/win32com/server/exception.pyi | 30 +- .../stubs/pywin32/win32com/server/policy.pyi | 15 +- .../stubs/pywin32/win32com/server/util.pyi | 32 +- .../stubs/pywin32/win32com/storagecon.pyi | 228 +++++----- .../stubs/pywin32/win32com/universal.pyi | 25 +- .../stubs/pywin32/win32com/util.pyi | 2 +- .../stubs/pywin32/win32comext/adsi/adsi.pyi | 2 +- .../pywin32/win32comext/axdebug/axdebug.pyi | 6 +- .../pywin32/win32comext/ifilter/ifilter.pyi | 6 +- .../stubs/pywin32/win32comext/mapi/mapi.pyi | 2 +- .../stubs/pywin32/win32comext/shell/shell.pyi | 14 +- .../stubs/pyxdg/METADATA.toml | 2 +- .../stubs/qrbill/METADATA.toml | 4 +- .../stubs/qrcode/METADATA.toml | 4 +- .../stubs/qrcode/qrcode/_types.pyi | 3 +- .../stubs/qrcode/qrcode/image/pure.pyi | 4 +- .../stubs/qrcode/qrcode/util.pyi | 2 +- .../stubs/ratelimit/METADATA.toml | 2 +- .../stubs/regex/METADATA.toml | 4 +- .../stubs/reportlab/METADATA.toml | 4 +- .../reportlab/reportlab/lib/rl_safe_eval.pyi | 2 +- .../stubs/reportlab/reportlab/lib/utils.pyi | 4 +- .../stubs/requests-oauthlib/METADATA.toml | 4 +- .../stubs/requests/METADATA.toml | 8 +- .../stubs/requests/requests/compat.pyi | 3 + .../stubs/requests/requests/exceptions.pyi | 2 +- .../stubs/requests/requests/utils.pyi | 2 +- .../stubs/resampy/METADATA.toml | 4 + .../stubs/resampy/resampy/__init__.pyi | 2 + .../stubs/resampy/resampy/core.pyi | 36 ++ .../stubs/resampy/resampy/filters.pyi | 26 ++ .../stubs/resampy/resampy/version.pyi | 4 + .../stubs/retry/METADATA.toml | 2 +- .../stubs/rfc3339-validator/METADATA.toml | 2 +- .../stubs/s2clientprotocol/METADATA.toml | 6 +- .../stubs/seaborn/METADATA.toml | 4 +- .../stubs/seaborn/seaborn/axisgrid.pyi | 2 +- .../stubs/setuptools/METADATA.toml | 8 +- .../setuptools/setuptools/command/test.pyi | 6 +- .../stubs/setuptools/setuptools/installer.pyi | 6 +- .../stubs/shapely/METADATA.toml | 4 +- .../stubs/simple-websocket/METADATA.toml | 4 +- .../stubs/simplejson/METADATA.toml | 2 +- .../stubs/singledispatch/METADATA.toml | 2 +- .../typeshed-fallback/stubs/six/METADATA.toml | 2 +- .../stubs/slumber/METADATA.toml | 4 +- .../stubs/str2bool/METADATA.toml | 2 +- .../stubs/tabulate/METADATA.toml | 4 +- .../stubs/tabulate/tabulate/__init__.pyi | 11 +- .../stubs/tabulate/tabulate/version.pyi | 6 - .../stubs/tensorflow/METADATA.toml | 12 +- .../stubs/tensorflow/tensorflow/_aliases.pyi | 4 +- .../tensorflow/config/experimental.pyi | 3 +- .../stubs/tinycss2/METADATA.toml | 3 + .../stubs/tinycss2/tinycss2/__init__.pyi | 17 + .../stubs/tinycss2/tinycss2/ast.pyi | 160 +++++++ .../stubs/tinycss2/tinycss2/bytes.pyi | 14 + .../stubs/tinycss2/tinycss2/color3.pyi | 12 + .../stubs/tinycss2/tinycss2/color4.pyi | 19 + .../stubs/tinycss2/tinycss2/color5.pyi | 17 + .../stubs/tinycss2/tinycss2/nth.pyi | 11 + .../stubs/tinycss2/tinycss2/parser.pyi | 18 + .../stubs/tinycss2/tinycss2/serializer.pyi | 11 + .../stubs/tinycss2/tinycss2/tokenizer.pyi | 3 + .../stubs/toml/METADATA.toml | 2 +- .../stubs/toposort/METADATA.toml | 2 +- .../stubs/tqdm/METADATA.toml | 6 +- .../stubs/tqdm/tqdm/contrib/__init__.pyi | 4 +- .../stubs/tqdm/tqdm/contrib/itertools.pyi | 2 +- .../stubs/translationstring/METADATA.toml | 2 +- .../stubs/ttkthemes/METADATA.toml | 2 +- .../stubs/tzdata/METADATA.toml | 4 +- .../stubs/uWSGI/METADATA.toml | 6 +- .../stubs/uWSGI/uwsgidecorators.pyi | 14 +- .../stubs/unidiff/METADATA.toml | 2 +- .../stubs/untangle/METADATA.toml | 2 +- .../stubs/usersettings/METADATA.toml | 2 +- .../stubs/vobject/METADATA.toml | 2 +- .../stubs/waitress/METADATA.toml | 4 +- .../stubs/waitress/waitress/rfc7230.pyi | 12 +- .../stubs/watchpoints/METADATA.toml | 2 +- .../stubs/webencodings/METADATA.toml | 2 +- .../stubs/whatthepatch/METADATA.toml | 2 +- .../stubs/workalendar/METADATA.toml | 2 +- .../stubs/wurlitzer/METADATA.toml | 2 +- .../stubs/www-authenticate/METADATA.toml | 2 +- .../stubs/xdgenvpy/METADATA.toml | 2 +- .../stubs/xlrd/METADATA.toml | 2 +- .../stubs/xmldiff/METADATA.toml | 2 +- .../stubs/xmltodict/METADATA.toml | 2 +- .../stubs/yt-dlp/METADATA.toml | 6 +- .../stubs/zstd/METADATA.toml | 2 +- .../stubs/zxcvbn/METADATA.toml | 2 +- 558 files changed, 4182 insertions(+), 2459 deletions(-) create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/groff.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/behave/METADATA.toml create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/behave/behave/__init__.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/behave/behave/fixture.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/behave/behave/runner.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/behave/behave/step_registry.pyi delete mode 100644 packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/message.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/parser.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/version.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/any.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/duration.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/field_mask.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/python_edition_defaults.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/testing_refleaks.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/proto.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/proto_builder.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/proto_json.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/proto_text.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/service_reflection.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/text_encoding.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/timestamp.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/unknown_fields.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/resampy/METADATA.toml create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/resampy/resampy/__init__.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/resampy/resampy/core.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/resampy/resampy/filters.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/resampy/resampy/version.pyi delete mode 100644 packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate/version.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/tinycss2/METADATA.toml create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/__init__.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/ast.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/bytes.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/color3.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/color4.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/color5.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/nth.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/parser.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/serializer.pyi create mode 100644 packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/tokenizer.pyi diff --git a/packages/pyright-internal/typeshed-fallback/commit.txt b/packages/pyright-internal/typeshed-fallback/commit.txt index 656d1525683d..268dbf22cc05 100644 --- a/packages/pyright-internal/typeshed-fallback/commit.txt +++ b/packages/pyright-internal/typeshed-fallback/commit.txt @@ -1 +1 @@ -b0401bc7dfbaa8eb0c989c0916d7783dfba7a194 +bd18cc640cba4dadc51ac9a5157b79ff6adf5de3 diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_bisect.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_bisect.pyi index 58488e3d15af..5ac43b3e0641 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_bisect.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_bisect.pyi @@ -1,5 +1,5 @@ import sys -from _typeshed import SupportsLenAndGetItem, SupportsRichComparisonT +from _typeshed import SupportsGetItem, SupportsLenAndGetItem, SupportsRichComparisonT from collections.abc import Callable, MutableSequence from typing import TypeVar, overload @@ -16,6 +16,14 @@ if sys.version_info >= (3, 10): key: None = None, ) -> int: ... @overload + def bisect_left( + a: SupportsGetItem[int, SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int, hi: int, *, key: None = None + ) -> int: ... + @overload + def bisect_left( + a: SupportsGetItem[int, SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, *, hi: int, key: None = None + ) -> int: ... + @overload def bisect_left( a: SupportsLenAndGetItem[_T], x: SupportsRichComparisonT, @@ -25,6 +33,19 @@ if sys.version_info >= (3, 10): key: Callable[[_T], SupportsRichComparisonT], ) -> int: ... @overload + def bisect_left( + a: SupportsGetItem[int, _T], x: SupportsRichComparisonT, lo: int, hi: int, *, key: Callable[[_T], SupportsRichComparisonT] + ) -> int: ... + @overload + def bisect_left( + a: SupportsGetItem[int, _T], + x: SupportsRichComparisonT, + lo: int = 0, + *, + hi: int, + key: Callable[[_T], SupportsRichComparisonT], + ) -> int: ... + @overload def bisect_right( a: SupportsLenAndGetItem[SupportsRichComparisonT], x: SupportsRichComparisonT, @@ -34,6 +55,14 @@ if sys.version_info >= (3, 10): key: None = None, ) -> int: ... @overload + def bisect_right( + a: SupportsGetItem[int, SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int, hi: int, *, key: None = None + ) -> int: ... + @overload + def bisect_right( + a: SupportsGetItem[int, SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, *, hi: int, key: None = None + ) -> int: ... + @overload def bisect_right( a: SupportsLenAndGetItem[_T], x: SupportsRichComparisonT, @@ -43,6 +72,19 @@ if sys.version_info >= (3, 10): key: Callable[[_T], SupportsRichComparisonT], ) -> int: ... @overload + def bisect_right( + a: SupportsGetItem[int, _T], x: SupportsRichComparisonT, lo: int, hi: int, *, key: Callable[[_T], SupportsRichComparisonT] + ) -> int: ... + @overload + def bisect_right( + a: SupportsGetItem[int, _T], + x: SupportsRichComparisonT, + lo: int = 0, + *, + hi: int, + key: Callable[[_T], SupportsRichComparisonT], + ) -> int: ... + @overload def insort_left( a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, @@ -70,12 +112,26 @@ if sys.version_info >= (3, 10): ) -> None: ... else: + @overload def bisect_left( a: SupportsLenAndGetItem[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None ) -> int: ... + @overload + def bisect_left(a: SupportsGetItem[int, SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int, hi: int) -> int: ... + @overload + def bisect_left( + a: SupportsGetItem[int, SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, *, hi: int + ) -> int: ... + @overload def bisect_right( a: SupportsLenAndGetItem[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None ) -> int: ... + @overload + def bisect_right(a: SupportsGetItem[int, SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int, hi: int) -> int: ... + @overload + def bisect_right( + a: SupportsGetItem[int, SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, *, hi: int + ) -> int: ... def insort_left( a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_codecs.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_codecs.pyi index 89f97edb9ba8..89cb78c33571 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_codecs.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_codecs.pyi @@ -77,7 +77,9 @@ def ascii_decode(data: ReadableBuffer, errors: str | None = None, /) -> tuple[st def ascii_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... def charmap_decode(data: ReadableBuffer, errors: str | None = None, mapping: _CharMap | None = None, /) -> tuple[str, int]: ... def charmap_encode(str: str, errors: str | None = None, mapping: _CharMap | None = None, /) -> tuple[bytes, int]: ... -def escape_decode(data: str | ReadableBuffer, errors: str | None = None, /) -> tuple[str, int]: ... + +# Docs say this accepts a bytes-like object, but in practice it also accepts str. +def escape_decode(data: str | ReadableBuffer, errors: str | None = None, /) -> tuple[bytes, int]: ... def escape_encode(data: bytes, errors: str | None = None, /) -> tuple[bytes, int]: ... def latin_1_decode(data: ReadableBuffer, errors: str | None = None, /) -> tuple[str, int]: ... def latin_1_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_operator.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_operator.pyi index e1ef5c4bf067..e7d85f811531 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_operator.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_operator.pyi @@ -1,5 +1,15 @@ import sys -from _typeshed import SupportsGetItem +from _typeshed import ( + SupportsAdd, + SupportsGetItem, + SupportsMod, + SupportsMul, + SupportsRAdd, + SupportsRMod, + SupportsRMul, + SupportsRSub, + SupportsSub, +) from collections.abc import Callable, Container, Iterable, MutableMapping, MutableSequence, Sequence from operator import attrgetter as attrgetter, itemgetter as itemgetter, methodcaller as methodcaller from typing import Any, AnyStr, Protocol, SupportsAbs, SupportsIndex, TypeVar, overload, type_check_only @@ -8,6 +18,7 @@ from typing_extensions import ParamSpec, TypeAlias, TypeIs _R = TypeVar("_R") _T = TypeVar("_T") _T_co = TypeVar("_T_co", covariant=True) +_T_contra = TypeVar("_T_contra", contravariant=True) _K = TypeVar("_K") _V = TypeVar("_V") _P = ParamSpec("_P") @@ -58,24 +69,36 @@ def truth(a: object, /) -> bool: ... def is_(a: object, b: object, /) -> bool: ... def is_not(a: object, b: object, /) -> bool: ... def abs(a: SupportsAbs[_T], /) -> _T: ... -def add(a: Any, b: Any, /) -> Any: ... -def and_(a: Any, b: Any, /) -> Any: ... -def floordiv(a: Any, b: Any, /) -> Any: ... +@overload +def add(a: SupportsAdd[_T_contra, _T_co], b: _T_contra, /) -> _T_co: ... +@overload +def add(a: _T_contra, b: SupportsRAdd[_T_contra, _T_co], /) -> _T_co: ... +def and_(a, b, /): ... +def floordiv(a, b, /): ... def index(a: SupportsIndex, /) -> int: ... def inv(a: _SupportsInversion[_T_co], /) -> _T_co: ... def invert(a: _SupportsInversion[_T_co], /) -> _T_co: ... -def lshift(a: Any, b: Any, /) -> Any: ... -def mod(a: Any, b: Any, /) -> Any: ... -def mul(a: Any, b: Any, /) -> Any: ... -def matmul(a: Any, b: Any, /) -> Any: ... +def lshift(a, b, /): ... +@overload +def mod(a: SupportsMod[_T_contra, _T_co], b: _T_contra, /) -> _T_co: ... +@overload +def mod(a: _T_contra, b: SupportsRMod[_T_contra, _T_co], /) -> _T_co: ... +@overload +def mul(a: SupportsMul[_T_contra, _T_co], b: _T_contra, /) -> _T_co: ... +@overload +def mul(a: _T_contra, b: SupportsRMul[_T_contra, _T_co], /) -> _T_co: ... +def matmul(a, b, /): ... def neg(a: _SupportsNeg[_T_co], /) -> _T_co: ... -def or_(a: Any, b: Any, /) -> Any: ... +def or_(a, b, /): ... def pos(a: _SupportsPos[_T_co], /) -> _T_co: ... -def pow(a: Any, b: Any, /) -> Any: ... -def rshift(a: Any, b: Any, /) -> Any: ... -def sub(a: Any, b: Any, /) -> Any: ... -def truediv(a: Any, b: Any, /) -> Any: ... -def xor(a: Any, b: Any, /) -> Any: ... +def pow(a, b, /): ... +def rshift(a, b, /): ... +@overload +def sub(a: SupportsSub[_T_contra, _T_co], b: _T_contra, /) -> _T_co: ... +@overload +def sub(a: _T_contra, b: SupportsRSub[_T_contra, _T_co], /) -> _T_co: ... +def truediv(a, b, /): ... +def xor(a, b, /): ... def concat(a: Sequence[_T], b: Sequence[_T], /) -> Sequence[_T]: ... def contains(a: Container[object], b: object, /) -> bool: ... def countOf(a: Iterable[object], b: object, /) -> int: ... @@ -97,20 +120,20 @@ def setitem(a: MutableSequence[_T], b: slice[int | None], c: Sequence[_T], /) -> @overload def setitem(a: MutableMapping[_K, _V], b: _K, c: _V, /) -> None: ... def length_hint(obj: object, default: int = 0, /) -> int: ... -def iadd(a: Any, b: Any, /) -> Any: ... -def iand(a: Any, b: Any, /) -> Any: ... -def iconcat(a: Any, b: Any, /) -> Any: ... -def ifloordiv(a: Any, b: Any, /) -> Any: ... -def ilshift(a: Any, b: Any, /) -> Any: ... -def imod(a: Any, b: Any, /) -> Any: ... -def imul(a: Any, b: Any, /) -> Any: ... -def imatmul(a: Any, b: Any, /) -> Any: ... -def ior(a: Any, b: Any, /) -> Any: ... -def ipow(a: Any, b: Any, /) -> Any: ... -def irshift(a: Any, b: Any, /) -> Any: ... -def isub(a: Any, b: Any, /) -> Any: ... -def itruediv(a: Any, b: Any, /) -> Any: ... -def ixor(a: Any, b: Any, /) -> Any: ... +def iadd(a, b, /): ... +def iand(a, b, /): ... +def iconcat(a, b, /): ... +def ifloordiv(a, b, /): ... +def ilshift(a, b, /): ... +def imod(a, b, /): ... +def imul(a, b, /): ... +def imatmul(a, b, /): ... +def ior(a, b, /): ... +def ipow(a, b, /): ... +def irshift(a, b, /): ... +def isub(a, b, /): ... +def itruediv(a, b, /): ... +def ixor(a, b, /): ... if sys.version_info >= (3, 11): def call(obj: Callable[_P, _R], /, *args: _P.args, **kwargs: _P.kwargs) -> _R: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_pickle.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_pickle.pyi index 544f787172d6..4294de4c2c7f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_pickle.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_pickle.pyi @@ -61,7 +61,6 @@ class PicklerMemoProxy: class Pickler: fast: bool dispatch_table: Mapping[type, Callable[[Any], _ReducedType]] - reducer_override: Callable[[Any], Any] bin: bool # undocumented def __init__( self, @@ -79,6 +78,10 @@ class Pickler: # this method has no default implementation for Python < 3.13 def persistent_id(self, obj: Any, /) -> Any: ... + # The following method is not defined on _Pickler, but can be defined on + # sub-classes. Should return `NotImplemented` if pickling the supplied + # object is not supported and returns the same types as `__reduce__()`. + def reducer_override(self, obj: object, /) -> _ReducedType: ... @type_check_only class UnpicklerMemoProxy: diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_socket.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_socket.pyi index 372b35f22f17..918bffc7f908 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_socket.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_socket.pyi @@ -741,7 +741,7 @@ class socket: def proto(self) -> int: ... # F811: "Redefinition of unused `timeout`" @property - def timeout(self) -> float | None: ... # noqa: F811 + def timeout(self) -> float | None: ... if sys.platform == "win32": def __init__( self, family: int = ..., type: int = ..., proto: int = ..., fileno: SupportsIndex | bytes | None = None @@ -838,7 +838,7 @@ def inet_ntop(address_family: int, packed_ip: ReadableBuffer, /) -> str: ... def getdefaulttimeout() -> float | None: ... # F811: "Redefinition of unused `timeout`" -def setdefaulttimeout(timeout: float | None, /) -> None: ... # noqa: F811 +def setdefaulttimeout(timeout: float | None, /) -> None: ... if sys.platform != "win32": def sethostname(name: str, /) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_sqlite3.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_sqlite3.pyi index 50006dcf4032..5361584d6b18 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_sqlite3.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_sqlite3.pyi @@ -19,7 +19,7 @@ from sqlite3 import ( _IsolationLevel, ) from typing import Any, Final, Literal, TypeVar, overload -from typing_extensions import TypeAlias +from typing_extensions import TypeAlias, deprecated if sys.version_info >= (3, 11): from sqlite3 import Blob as Blob @@ -171,7 +171,7 @@ if sys.version_info >= (3, 11): SQLITE_IOERR_VNODE: Final = 6922 SQLITE_IOERR_WRITE: Final = 778 SQLITE_LIMIT_ATTACHED: Final = 7 - SQLITE_LIMIT_COLUMN: Final = 22 + SQLITE_LIMIT_COLUMN: Final = 2 SQLITE_LIMIT_COMPOUND_SELECT: Final = 4 SQLITE_LIMIT_EXPR_DEPTH: Final = 3 SQLITE_LIMIT_FUNCTION_ARG: Final = 6 @@ -299,7 +299,11 @@ def enable_callback_tracebacks(enable: bool, /) -> None: ... if sys.version_info < (3, 12): # takes a pos-or-keyword argument because there is a C wrapper - def enable_shared_cache(do_enable: int) -> None: ... + @deprecated( + "Deprecated since Python 3.10; removed in Python 3.12. " + "Open database in URI mode using `cache=shared` parameter instead." + ) + def enable_shared_cache(do_enable: int) -> None: ... # undocumented if sys.version_info >= (3, 10): def register_adapter(type: type[_T], adapter: _Adapter[_T], /) -> None: ... @@ -310,4 +314,4 @@ else: def register_converter(name: str, converter: _Converter, /) -> None: ... if sys.version_info < (3, 10): - OptimizedUnicode = str + OptimizedUnicode = str # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_ssl.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_ssl.pyi index 73a43f29c8c5..e84b24e8f4db 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_ssl.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_ssl.pyi @@ -55,6 +55,7 @@ if sys.version_info < (3, 12): def RAND_pseudo_bytes(n: int, /) -> tuple[bytes, bool]: ... if sys.version_info < (3, 10): + @deprecated("Unsupported by OpenSSL since 1.1.1; removed in Python 3.10.") def RAND_egd(path: str) -> None: ... def RAND_status() -> bool: ... @@ -182,8 +183,8 @@ CERT_REQUIRED: Final = 2 # verify flags VERIFY_DEFAULT: Final = 0 -VERIFY_CRL_CHECK_LEAF: Final = 0x4 -VERIFY_CRL_CHECK_CHAIN: Final = 0x8 +VERIFY_CRL_CHECK_LEAF: Final = 0x04 +VERIFY_CRL_CHECK_CHAIN: Final = 0x0C VERIFY_X509_STRICT: Final = 0x20 VERIFY_X509_TRUSTED_FIRST: Final = 0x8000 if sys.version_info >= (3, 10): @@ -229,7 +230,7 @@ PROTOCOL_TLSv1_1: Final = 4 PROTOCOL_TLSv1_2: Final = 5 # protocol options -OP_ALL: Final = 0x80000050 +OP_ALL: Final[int] OP_NO_SSLv2: Final = 0x0 OP_NO_SSLv3: Final = 0x2000000 OP_NO_TLSv1: Final = 0x4000000 diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_typeshed/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_typeshed/__init__.pyi index 89e93ab02706..c006322b8145 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_typeshed/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_typeshed/__init__.pyi @@ -126,6 +126,12 @@ class SupportsMul(Protocol[_T_contra, _T_co]): class SupportsRMul(Protocol[_T_contra, _T_co]): def __rmul__(self, x: _T_contra, /) -> _T_co: ... +class SupportsMod(Protocol[_T_contra, _T_co]): + def __mod__(self, other: _T_contra, /) -> _T_co: ... + +class SupportsRMod(Protocol[_T_contra, _T_co]): + def __rmod__(self, other: _T_contra, /) -> _T_co: ... + class SupportsDivMod(Protocol[_T_contra, _T_co]): def __divmod__(self, other: _T_contra, /) -> _T_co: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/argparse.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/argparse.pyi index 066896603914..e1ad7cbc4570 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/argparse.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/argparse.pyi @@ -83,7 +83,7 @@ class _ActionsContainer: const: Any = ..., default: Any = ..., type: _ActionType = ..., - choices: Iterable[_T] | None = ..., + choices: Iterable[Any] | None = ..., # choices must match the type specified required: bool = ..., help: str | None = ..., metavar: str | tuple[str, ...] | None = ..., @@ -168,7 +168,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): usage: str | None = None, description: str | None = None, epilog: str | None = None, - parents: Sequence[ArgumentParser] = [], + parents: Iterable[ArgumentParser] = [], formatter_class: _FormatterClass = ..., prefix_chars: str = "-", fromfile_prefix_chars: str | None = None, @@ -188,7 +188,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): usage: str | None = None, description: str | None = None, epilog: str | None = None, - parents: Sequence[ArgumentParser] = [], + parents: Iterable[ArgumentParser] = [], formatter_class: _FormatterClass = ..., prefix_chars: str = "-", fromfile_prefix_chars: str | None = None, @@ -200,9 +200,9 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): ) -> None: ... @overload - def parse_args(self, args: Sequence[str] | None = None, namespace: None = None) -> Namespace: ... + def parse_args(self, args: Iterable[str] | None = None, namespace: None = None) -> Namespace: ... @overload - def parse_args(self, args: Sequence[str] | None, namespace: _N) -> _N: ... + def parse_args(self, args: Iterable[str] | None, namespace: _N) -> _N: ... @overload def parse_args(self, *, namespace: _N) -> _N: ... @overload @@ -239,26 +239,26 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): def format_usage(self) -> str: ... def format_help(self) -> str: ... @overload - def parse_known_args(self, args: Sequence[str] | None = None, namespace: None = None) -> tuple[Namespace, list[str]]: ... + def parse_known_args(self, args: Iterable[str] | None = None, namespace: None = None) -> tuple[Namespace, list[str]]: ... @overload - def parse_known_args(self, args: Sequence[str] | None, namespace: _N) -> tuple[_N, list[str]]: ... + def parse_known_args(self, args: Iterable[str] | None, namespace: _N) -> tuple[_N, list[str]]: ... @overload def parse_known_args(self, *, namespace: _N) -> tuple[_N, list[str]]: ... def convert_arg_line_to_args(self, arg_line: str) -> list[str]: ... def exit(self, status: int = 0, message: str | None = None) -> NoReturn: ... def error(self, message: str) -> NoReturn: ... @overload - def parse_intermixed_args(self, args: Sequence[str] | None = None, namespace: None = None) -> Namespace: ... + def parse_intermixed_args(self, args: Iterable[str] | None = None, namespace: None = None) -> Namespace: ... @overload - def parse_intermixed_args(self, args: Sequence[str] | None, namespace: _N) -> _N: ... + def parse_intermixed_args(self, args: Iterable[str] | None, namespace: _N) -> _N: ... @overload def parse_intermixed_args(self, *, namespace: _N) -> _N: ... @overload def parse_known_intermixed_args( - self, args: Sequence[str] | None = None, namespace: None = None + self, args: Iterable[str] | None = None, namespace: None = None ) -> tuple[Namespace, list[str]]: ... @overload - def parse_known_intermixed_args(self, args: Sequence[str] | None, namespace: _N) -> tuple[_N, list[str]]: ... + def parse_known_intermixed_args(self, args: Iterable[str] | None, namespace: _N) -> tuple[_N, list[str]]: ... @overload def parse_known_intermixed_args(self, *, namespace: _N) -> tuple[_N, list[str]]: ... # undocumented @@ -344,7 +344,7 @@ class HelpFormatter: def _metavar_formatter(self, action: Action, default_metavar: str) -> Callable[[int], tuple[str, ...]]: ... def _format_args(self, action: Action, default_metavar: str) -> str: ... def _expand_help(self, action: Action) -> str: ... - def _iter_indented_subactions(self, action: Action) -> Generator[Action, None, None]: ... + def _iter_indented_subactions(self, action: Action) -> Generator[Action]: ... def _split_lines(self, text: str, width: int) -> list[str]: ... def _fill_text(self, text: str, width: int, indent: str) -> str: ... def _get_help_string(self, action: Action) -> str | None: ... @@ -783,13 +783,13 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]): *, deprecated: bool = False, help: str | None = ..., - aliases: Sequence[str] = ..., + aliases: Iterable[str] = ..., # Kwargs from ArgumentParser constructor prog: str | None = ..., usage: str | None = ..., description: str | None = ..., epilog: str | None = ..., - parents: Sequence[_ArgumentParserT] = ..., + parents: Iterable[_ArgumentParserT] = ..., formatter_class: _FormatterClass = ..., prefix_chars: str = ..., fromfile_prefix_chars: str | None = ..., @@ -809,13 +809,13 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]): *, deprecated: bool = False, help: str | None = ..., - aliases: Sequence[str] = ..., + aliases: Iterable[str] = ..., # Kwargs from ArgumentParser constructor prog: str | None = ..., usage: str | None = ..., description: str | None = ..., epilog: str | None = ..., - parents: Sequence[_ArgumentParserT] = ..., + parents: Iterable[_ArgumentParserT] = ..., formatter_class: _FormatterClass = ..., prefix_chars: str = ..., fromfile_prefix_chars: str | None = ..., @@ -832,13 +832,13 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]): name: str, *, help: str | None = ..., - aliases: Sequence[str] = ..., + aliases: Iterable[str] = ..., # Kwargs from ArgumentParser constructor prog: str | None = ..., usage: str | None = ..., description: str | None = ..., epilog: str | None = ..., - parents: Sequence[_ArgumentParserT] = ..., + parents: Iterable[_ArgumentParserT] = ..., formatter_class: _FormatterClass = ..., prefix_chars: str = ..., fromfile_prefix_chars: str | None = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/base_tasks.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/base_tasks.pyi index 42e952ffacaf..5b010a9efe3d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/base_tasks.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/base_tasks.pyi @@ -1,9 +1,17 @@ +import sys from _typeshed import StrOrBytesPath from types import FrameType from typing import Any -from . import tasks +from .tasks import Task -def _task_repr_info(task: tasks.Task[Any]) -> list[str]: ... # undocumented -def _task_get_stack(task: tasks.Task[Any], limit: int | None) -> list[FrameType]: ... # undocumented -def _task_print_stack(task: tasks.Task[Any], limit: int | None, file: StrOrBytesPath) -> None: ... # undocumented +def _task_repr_info(task: Task[Any]) -> list[str]: ... # undocumented + +if sys.version_info >= (3, 13): + def _task_repr(task: Task[Any]) -> str: ... # undocumented + +elif sys.version_info >= (3, 11): + def _task_repr(self: Task[Any]) -> str: ... # undocumented + +def _task_get_stack(task: Task[Any], limit: int | None) -> list[FrameType]: ... # undocumented +def _task_print_stack(task: Task[Any], limit: int | None, file: StrOrBytesPath) -> None: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/unix_events.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/unix_events.pyi index 9071ee9a2fa7..54a2a039749e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/unix_events.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/asyncio/unix_events.pyi @@ -205,6 +205,35 @@ if sys.platform != "win32": def remove_child_handler(self, pid: int) -> bool: ... def attach_loop(self, loop: events.AbstractEventLoop | None) -> None: ... + @deprecated("Deprecated since Python 3.12; removed in Python 3.14.") + class ThreadedChildWatcher(AbstractChildWatcher): + def is_active(self) -> Literal[True]: ... + def close(self) -> None: ... + def __enter__(self) -> Self: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None + ) -> None: ... + def __del__(self) -> None: ... + def add_child_handler( + self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts] + ) -> None: ... + def remove_child_handler(self, pid: int) -> bool: ... + def attach_loop(self, loop: events.AbstractEventLoop | None) -> None: ... + + @deprecated("Deprecated since Python 3.12; removed in Python 3.14.") + class PidfdChildWatcher(AbstractChildWatcher): + def __enter__(self) -> Self: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None + ) -> None: ... + def is_active(self) -> bool: ... + def close(self) -> None: ... + def attach_loop(self, loop: events.AbstractEventLoop | None) -> None: ... + def add_child_handler( + self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts] + ) -> None: ... + def remove_child_handler(self, pid: int) -> bool: ... + else: class MultiLoopChildWatcher(AbstractChildWatcher): def is_active(self) -> bool: ... @@ -219,30 +248,29 @@ if sys.platform != "win32": def remove_child_handler(self, pid: int) -> bool: ... def attach_loop(self, loop: events.AbstractEventLoop | None) -> None: ... - if sys.version_info < (3, 14): - class ThreadedChildWatcher(AbstractChildWatcher): - def is_active(self) -> Literal[True]: ... - def close(self) -> None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None - ) -> None: ... - def __del__(self) -> None: ... - def add_child_handler( - self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts] - ) -> None: ... - def remove_child_handler(self, pid: int) -> bool: ... - def attach_loop(self, loop: events.AbstractEventLoop | None) -> None: ... + class ThreadedChildWatcher(AbstractChildWatcher): + def is_active(self) -> Literal[True]: ... + def close(self) -> None: ... + def __enter__(self) -> Self: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None + ) -> None: ... + def __del__(self) -> None: ... + def add_child_handler( + self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts] + ) -> None: ... + def remove_child_handler(self, pid: int) -> bool: ... + def attach_loop(self, loop: events.AbstractEventLoop | None) -> None: ... - class PidfdChildWatcher(AbstractChildWatcher): - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None - ) -> None: ... - def is_active(self) -> bool: ... - def close(self) -> None: ... - def attach_loop(self, loop: events.AbstractEventLoop | None) -> None: ... - def add_child_handler( - self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts] - ) -> None: ... - def remove_child_handler(self, pid: int) -> bool: ... + class PidfdChildWatcher(AbstractChildWatcher): + def __enter__(self) -> Self: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None + ) -> None: ... + def is_active(self) -> bool: ... + def close(self) -> None: ... + def attach_loop(self, loop: events.AbstractEventLoop | None) -> None: ... + def add_child_handler( + self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts] + ) -> None: ... + def remove_child_handler(self, pid: int) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/builtins.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/builtins.pyi index a22bb400adfe..5657ac74a9ac 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/builtins.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/builtins.pyi @@ -1240,13 +1240,7 @@ class dict(MutableMapping[_KT, _VT]): def __reversed__(self) -> Iterator[_KT]: ... __hash__: ClassVar[None] # type: ignore[assignment] def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - @overload - def __or__(self, value: dict[_KT, _VT], /) -> dict[_KT, _VT]: ... - @overload def __or__(self, value: dict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]: ... - @overload - def __ror__(self, value: dict[_KT, _VT], /) -> dict[_KT, _VT]: ... - @overload def __ror__(self, value: dict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]: ... # dict.__ior__ should be kept roughly in line with MutableMapping.update() @overload # type: ignore[misc] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/code.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/code.pyi index 0b13c8a5016d..478d5aaa320f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/code.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/code.pyi @@ -24,6 +24,7 @@ class InteractiveConsole(InteractiveInterpreter): buffer: list[str] # undocumented filename: str # undocumented if sys.version_info >= (3, 13): + local_exit: bool # undocumented def __init__( self, locals: dict[str, Any] | None = None, filename: str = "", *, local_exit: bool = False ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/codecs.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/codecs.pyi index 4dfe3fd9e851..9164a4a626d4 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/codecs.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/codecs.pyi @@ -196,8 +196,8 @@ def open( filename: str, mode: str = "r", encoding: str | None = None, errors: str = "strict", buffering: int = -1 ) -> StreamReaderWriter: ... def EncodedFile(file: _Stream, data_encoding: str, file_encoding: str | None = None, errors: str = "strict") -> StreamRecoder: ... -def iterencode(iterator: Iterable[str], encoding: str, errors: str = "strict") -> Generator[bytes, None, None]: ... -def iterdecode(iterator: Iterable[bytes], encoding: str, errors: str = "strict") -> Generator[str, None, None]: ... +def iterencode(iterator: Iterable[str], encoding: str, errors: str = "strict") -> Generator[bytes]: ... +def iterdecode(iterator: Iterable[bytes], encoding: str, errors: str = "strict") -> Generator[str]: ... BOM: Final[Literal[b"\xff\xfe", b"\xfe\xff"]] # depends on `sys.byteorder` BOM_BE: Final = b"\xfe\xff" diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/futures/process.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/futures/process.pyi index 071b3aba5d33..282bafa0b611 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/futures/process.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/futures/process.pyi @@ -97,7 +97,7 @@ class _SafeQueue(Queue[Future[Any]]): def _on_queue_feeder_error(self, e: Exception, obj: _CallItem) -> None: ... -def _get_chunks(*iterables: Any, chunksize: int) -> Generator[tuple[Any, ...], None, None]: ... +def _get_chunks(*iterables: Any, chunksize: int) -> Generator[tuple[Any, ...]]: ... def _process_chunk(fn: Callable[..., _T], chunk: Iterable[tuple[Any, ...]]) -> list[_T]: ... if sys.version_info >= (3, 11): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/interpreters/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/interpreters/__init__.pyi index 3839e6bef09b..171fadb2202b 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/interpreters/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/interpreters/__init__.pyi @@ -5,7 +5,7 @@ from collections.abc import Callable from typing import Any, Literal, TypeVar from typing_extensions import ParamSpec, Self -if sys.version_info >= (3, 13): # needed to satisfy pyright checks for Python <3.13 +if sys.version_info >= (3, 14): # needed to satisfy pyright checks for Python <= 3.13 from _interpreters import ( InterpreterError as InterpreterError, InterpreterNotFoundError as InterpreterNotFoundError, diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/interpreters/_crossinterp.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/interpreters/_crossinterp.pyi index 7cf1ea34786e..50fe7cf0b4ba 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/interpreters/_crossinterp.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/interpreters/_crossinterp.pyi @@ -3,7 +3,7 @@ from collections.abc import Callable from typing import Final, NewType from typing_extensions import Never, Self, TypeAlias -if sys.version_info >= (3, 13): # needed to satisfy pyright checks for Python <3.13 +if sys.version_info >= (3, 14): # needed to satisfy pyright checks for Python <= 3.13 from _interpqueues import _UnboundOp class ItemInterpreterDestroyed(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/interpreters/_queues.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/interpreters/_queues.pyi index bdf08d93d1e0..b4a4fd56dd45 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/interpreters/_queues.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/concurrent/interpreters/_queues.pyi @@ -3,7 +3,7 @@ import sys from typing import Final, SupportsIndex from typing_extensions import Self -if sys.version_info >= (3, 13): # needed to satisfy pyright checks for Python <3.13 +if sys.version_info >= (3, 14): # needed to satisfy pyright checks for Python <= 3.13 from _interpqueues import QueueError as QueueError, QueueNotFoundError as QueueNotFoundError from . import _crossinterp diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/configparser.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/configparser.pyi index 1909d80e3d18..9b3f02324b7f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/configparser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/configparser.pyi @@ -1,8 +1,8 @@ import sys -from _typeshed import MaybeNone, StrOrBytesPath, SupportsWrite +from _typeshed import BytesPath, GenericPath, MaybeNone, StrOrBytesPath, StrPath, SupportsWrite from collections.abc import Callable, ItemsView, Iterable, Iterator, Mapping, MutableMapping, Sequence from re import Pattern -from typing import Any, ClassVar, Final, Literal, TypeVar, overload, type_check_only +from typing import Any, AnyStr, ClassVar, Final, Literal, TypeVar, overload, type_check_only from typing_extensions import TypeAlias, deprecated if sys.version_info >= (3, 14): @@ -269,7 +269,14 @@ class RawConfigParser(_Parser): def has_section(self, section: _SectionName) -> bool: ... def options(self, section: _SectionName) -> list[str]: ... def has_option(self, section: _SectionName, option: str) -> bool: ... - def read(self, filenames: StrOrBytesPath | Iterable[StrOrBytesPath], encoding: str | None = None) -> list[str]: ... + @overload + def read(self, filenames: GenericPath[AnyStr], encoding: str | None = None) -> list[AnyStr]: ... + @overload + def read(self, filenames: Iterable[StrPath], encoding: str | None = None) -> list[str]: ... + @overload + def read(self, filenames: Iterable[BytesPath], encoding: str | None = None) -> list[bytes]: ... + @overload + def read(self, filenames: Iterable[StrOrBytesPath], encoding: str | None = None) -> list[str | bytes]: ... def read_file(self, f: Iterable[str], source: str | None = None) -> None: ... def read_string(self, string: str, source: str = "") -> None: ... def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]], source: str = "") -> None: ... @@ -282,19 +289,19 @@ class RawConfigParser(_Parser): def getint(self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None) -> int: ... @overload def getint( - self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ... + self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T ) -> int | _T: ... @overload def getfloat(self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None) -> float: ... @overload def getfloat( - self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ... + self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T ) -> float | _T: ... @overload def getboolean(self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None) -> bool: ... @overload def getboolean( - self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ... + self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T ) -> bool | _T: ... def _get_conv( self, diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/contextlib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/contextlib.pyi index 4ea50e5eb34c..dff34474d2f5 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/contextlib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/contextlib.pyi @@ -178,9 +178,15 @@ class _BaseExitStack(Generic[_ExitT_co]): def callback(self, callback: Callable[_P, _T], /, *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ... def pop_all(self) -> Self: ... -# In reality this is a subclass of `AbstractContextManager`; -# see #7961 for why we don't do that in the stub -class ExitStack(_BaseExitStack[_ExitT_co], metaclass=abc.ABCMeta): +# this class is to avoid putting `metaclass=abc.ABCMeta` on the implementations directly, as this would make them +# appear explicitly abstract to some tools. this is due to the implementations not subclassing `AbstractContextManager` +# see note on the subclasses +@type_check_only +class _BaseExitStackAbstract(_BaseExitStack[_ExitT_co], metaclass=abc.ABCMeta): ... + +# In reality this is a subclass of `AbstractContextManager`, but we can't provide `Self` as the argument for `__enter__` +# https://discuss.python.org/t/self-as-typevar-default/90939 +class ExitStack(_BaseExitStackAbstract[_ExitT_co]): def close(self) -> None: ... def __enter__(self) -> Self: ... def __exit__( @@ -192,9 +198,9 @@ _ExitCoroFunc: TypeAlias = Callable[ ] _ACM_EF = TypeVar("_ACM_EF", bound=AbstractAsyncContextManager[Any, Any] | _ExitCoroFunc) -# In reality this is a subclass of `AbstractAsyncContextManager`; -# see #7961 for why we don't do that in the stub -class AsyncExitStack(_BaseExitStack[_ExitT_co], metaclass=abc.ABCMeta): +# In reality this is a subclass of `AbstractContextManager`, but we can't provide `Self` as the argument for `__enter__` +# https://discuss.python.org/t/self-as-typevar-default/90939 +class AsyncExitStack(_BaseExitStackAbstract[_ExitT_co]): async def enter_async_context(self, cm: AbstractAsyncContextManager[_T, _ExitT_co]) -> _T: ... def push_async_exit(self, exit: _ACM_EF) -> _ACM_EF: ... def push_async_callback( diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/message.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/message.pyi index 794882b140e6..08ba88b4ee6d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/message.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/message.pyi @@ -130,7 +130,7 @@ class Message(Generic[_HeaderT_co, _HeaderParamT_contra]): def get_charsets(self, failobj: None = None) -> list[str | None]: ... @overload def get_charsets(self, failobj: _T) -> list[str | _T]: ... - def walk(self) -> Generator[Self, None, None]: ... + def walk(self) -> Generator[Self]: ... def get_content_disposition(self) -> str | None: ... def as_string(self, unixfrom: bool = False, maxheaderlen: int = 0, policy: Policy[Any] | None = None) -> str: ... def as_bytes(self, unixfrom: bool = False, policy: Policy[Any] | None = None) -> bytes: ... @@ -151,13 +151,15 @@ class Message(Generic[_HeaderT_co, _HeaderParamT_contra]): class MIMEPart(Message[_HeaderRegistryT_co, _HeaderRegistryParamT_contra]): def __init__(self, policy: Policy[Any] | None = None) -> None: ... - def get_body(self, preferencelist: Sequence[str] = ("related", "html", "plain")) -> MIMEPart[_HeaderRegistryT_co] | None: ... + def get_body( + self, preferencelist: Sequence[str] = ("related", "html", "plain") + ) -> MIMEPart[_HeaderRegistryT_co, _HeaderRegistryParamT_contra] | None: ... def attach(self, payload: Self) -> None: ... # type: ignore[override] # The attachments are created via type(self) in the attach method. It's theoretically # possible to sneak other attachment types into a MIMEPart instance, but could cause # cause unforseen consequences. def iter_attachments(self) -> Iterator[Self]: ... - def iter_parts(self) -> Iterator[MIMEPart[_HeaderRegistryT_co]]: ... + def iter_parts(self) -> Iterator[MIMEPart[_HeaderRegistryT_co, _HeaderRegistryParamT_contra]]: ... def get_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> Any: ... def set_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> None: ... def make_related(self, boundary: str | None = None) -> None: ... @@ -171,4 +173,4 @@ class MIMEPart(Message[_HeaderRegistryT_co, _HeaderRegistryParamT_contra]): def as_string(self, unixfrom: bool = False, maxheaderlen: int | None = None, policy: Policy[Any] | None = None) -> str: ... def is_attachment(self) -> bool: ... -class EmailMessage(MIMEPart): ... +class EmailMessage(MIMEPart[_HeaderRegistryT_co, _HeaderRegistryParamT_contra]): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi index 9286e92331c8..bb1b22f11a62 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi @@ -10,7 +10,7 @@ from importlib.abc import MetaPathFinder from os import PathLike from pathlib import Path from re import Pattern -from typing import Any, ClassVar, Generic, NamedTuple, TypeVar, overload +from typing import Any, ClassVar, Generic, NamedTuple, TypeVar, overload, type_check_only from typing_extensions import Self, TypeAlias, deprecated, disjoint_base _T = TypeVar("_T") @@ -54,6 +54,7 @@ elif sys.version_info >= (3, 11): _EntryPointBase = DeprecatedTuple else: + @type_check_only class _EntryPointBase(NamedTuple): name: str value: str diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/json/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/json/__init__.pyi index 63e9718ee151..454a235ecf70 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/json/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/json/__init__.pyi @@ -1,6 +1,6 @@ from _typeshed import SupportsRead, SupportsWrite from collections.abc import Callable -from typing import Any +from typing import Any, Literal from .decoder import JSONDecodeError as JSONDecodeError, JSONDecoder as JSONDecoder from .encoder import JSONEncoder as JSONEncoder @@ -58,4 +58,6 @@ def load( object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = None, **kwds: Any, ) -> Any: ... -def detect_encoding(b: bytes | bytearray) -> str: ... # undocumented +def detect_encoding( + b: bytes | bytearray, +) -> Literal["utf-8", "utf-8-sig", "utf-16", "utf-16-be", "utf-16-le", "utf-32", "utf-32-be", "utf-32-le"]: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_except.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_except.pyi index 30930a2c381e..0d856e6b0b7d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_except.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_except.pyi @@ -6,7 +6,7 @@ from ..pytree import Base _N = TypeVar("_N", bound=Base) -def find_excepts(nodes: Iterable[_N]) -> Generator[tuple[_N, _N], None, None]: ... +def find_excepts(nodes: Iterable[_N]) -> Generator[tuple[_N, _N]]: ... class FixExcept(fixer_base.BaseFix): BM_compatible: ClassVar[Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_import.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_import.pyi index bf4b2d00925e..2daa18327ec0 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_import.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_import.pyi @@ -5,7 +5,7 @@ from typing import ClassVar, Literal from .. import fixer_base from ..pytree import Node -def traverse_imports(names) -> Generator[str, None, None]: ... +def traverse_imports(names) -> Generator[str]: ... class FixImport(fixer_base.BaseFix): BM_compatible: ClassVar[Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_imports.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_imports.pyi index c747af529f44..d86ebbe215a1 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_imports.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_imports.pyi @@ -8,7 +8,7 @@ from ..pytree import Node MAPPING: Final[dict[str, str]] def alternates(members): ... -def build_pattern(mapping=...) -> Generator[str, None, None]: ... +def build_pattern(mapping=...) -> Generator[str]: ... class FixImports(fixer_base.BaseFix): BM_compatible: ClassVar[Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_metaclass.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_metaclass.pyi index 1b1ec82032b4..6ad25e9aac36 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_metaclass.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_metaclass.pyi @@ -8,7 +8,7 @@ def has_metaclass(parent): ... def fixup_parse_tree(cls_node) -> None: ... def fixup_simple_stmt(parent, i, stmt_node) -> None: ... def remove_trailing_newline(node) -> None: ... -def find_metas(cls_node) -> Generator[tuple[Base, int, Base], None, None]: ... +def find_metas(cls_node) -> Generator[tuple[Base, int, Base]]: ... def fixup_indent(suite) -> None: ... class FixMetaclass(fixer_base.BaseFix): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_renames.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_renames.pyi index 652d8f15ea1a..f095b3083ba8 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_renames.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_renames.pyi @@ -7,7 +7,7 @@ MAPPING: Final[dict[str, dict[str, str]]] LOOKUP: Final[dict[tuple[str, str], str]] def alternates(members): ... -def build_pattern() -> Generator[str, None, None]: ... +def build_pattern() -> Generator[str]: ... class FixRenames(fixer_base.BaseFix): BM_compatible: ClassVar[Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_urllib.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_urllib.pyi index abdcc0f62970..ab84114f90ea 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_urllib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/fixes/fix_urllib.pyi @@ -5,7 +5,7 @@ from .fix_imports import FixImports MAPPING: Final[dict[str, list[tuple[Literal["urllib.request", "urllib.parse", "urllib.error"], list[str]]]]] -def build_pattern() -> Generator[str, None, None]: ... +def build_pattern() -> Generator[str]: ... class FixUrllib(FixImports): def build_pattern(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/refactor.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/refactor.pyi index a7f382540648..c33347ede38f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/refactor.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/lib2to3/refactor.pyi @@ -69,8 +69,8 @@ class RefactoringTool: def parse_block(self, block: Iterable[str], lineno: int, indent: int) -> Node: ... def wrap_toks( self, block: Iterable[str], lineno: int, indent: int - ) -> Generator[tuple[int, str, tuple[int, int], tuple[int, int], str], None, None]: ... - def gen_lines(self, block: Iterable[str], indent: int) -> Generator[str, None, None]: ... + ) -> Generator[tuple[int, str, tuple[int, int], tuple[int, int], str]]: ... + def gen_lines(self, block: Iterable[str], indent: int) -> Generator[str]: ... class MultiprocessingUnsupported(Exception): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/mmap.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/mmap.pyi index 005020b8b6b3..12425f703aa1 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/mmap.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/mmap.pyi @@ -34,7 +34,7 @@ PAGESIZE: Final[int] @disjoint_base class mmap: if sys.platform == "win32": - def __new__(self, fileno: int, length: int, tagname: str | None = None, access: int = 0, offset: int = 0) -> Self: ... + def __new__(cls, fileno: int, length: int, tagname: str | None = None, access: int = 0, offset: int = 0) -> Self: ... else: if sys.version_info >= (3, 13): def __new__( diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/os/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/os/__init__.pyi index 9e02fbf9e106..66a9d1dd3bc6 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/os/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/os/__init__.pyi @@ -614,9 +614,12 @@ if sys.platform == "darwin" and sys.version_info >= (3, 12): SEEK_SET: Final = 0 SEEK_CUR: Final = 1 SEEK_END: Final = 2 -if sys.platform != "win32": +if sys.platform == "linux": SEEK_DATA: Final = 3 SEEK_HOLE: Final = 4 +elif sys.platform == "darwin": + SEEK_HOLE: Final = 3 + SEEK_DATA: Final = 4 O_RDONLY: Final[int] O_WRONLY: Final[int] @@ -826,11 +829,9 @@ class stat_result(structseq[float], tuple[int, int, int, int, int, int, int, flo # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) if sys.version_info >= (3, 12) and sys.platform == "win32": @property - @deprecated( - """\ + @deprecated("""\ Use st_birthtime instead to retrieve the file creation time. \ -In the future, this property will contain the last metadata change time.""" - ) +In the future, this property will contain the last metadata change time.""") def st_ctime(self) -> float: ... else: @property @@ -1531,7 +1532,36 @@ else: def WSTOPSIG(status: int) -> int: ... def WTERMSIG(status: int) -> int: ... - if sys.version_info >= (3, 13): + if sys.version_info >= (3, 15): + def posix_spawn( + path: StrOrBytesPath, + argv: _ExecVArgs, + env: _ExecEnv | None, + /, + *, + file_actions: Sequence[tuple[Any, ...]] | None = (), + setpgroup: int | None = None, # None allowed starting in 3.15 + resetids: bool = False, + setsid: bool = False, + setsigmask: Iterable[int] = (), + setsigdef: Iterable[int] = (), + scheduler: tuple[Any, sched_param] | None = None, # None allowed starting in 3.15 + ) -> int: ... + def posix_spawnp( + path: StrOrBytesPath, + argv: _ExecVArgs, + env: _ExecEnv | None, + /, + *, + file_actions: Sequence[tuple[Any, ...]] | None = (), + setpgroup: int | None = None, # None allowed starting in 3.15 + resetids: bool = False, + setsid: bool = False, + setsigmask: Iterable[int] = (), + setsigdef: Iterable[int] = (), + scheduler: tuple[Any, sched_param] | None = None, # None allowed starting in 3.15 + ) -> int: ... + elif sys.version_info >= (3, 13): def posix_spawn( path: StrOrBytesPath, argv: _ExecVArgs, diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/pathlib/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/pathlib/__init__.pyi index 26dde2accd8d..4f094130665c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/pathlib/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/pathlib/__init__.pyi @@ -189,11 +189,11 @@ class Path(PurePath): self, pattern: str, *, case_sensitive: bool | None = None, recurse_symlinks: bool = False ) -> Iterator[Self]: ... elif sys.version_info >= (3, 12): - def glob(self, pattern: str, *, case_sensitive: bool | None = None) -> Generator[Self, None, None]: ... - def rglob(self, pattern: str, *, case_sensitive: bool | None = None) -> Generator[Self, None, None]: ... + def glob(self, pattern: str, *, case_sensitive: bool | None = None) -> Generator[Self]: ... + def rglob(self, pattern: str, *, case_sensitive: bool | None = None) -> Generator[Self]: ... else: - def glob(self, pattern: str) -> Generator[Self, None, None]: ... - def rglob(self, pattern: str) -> Generator[Self, None, None]: ... + def glob(self, pattern: str) -> Generator[Self]: ... + def rglob(self, pattern: str) -> Generator[Self]: ... if sys.version_info >= (3, 12): def exists(self, *, follow_symlinks: bool = True) -> bool: ... @@ -208,7 +208,7 @@ class Path(PurePath): if sys.version_info >= (3, 12): def is_junction(self) -> bool: ... - def iterdir(self) -> Generator[Self, None, None]: ... + def iterdir(self) -> Generator[Self]: ... def lchmod(self, mode: int) -> None: ... def lstat(self) -> stat_result: ... def mkdir(self, mode: int = 0o777, parents: bool = False, exist_ok: bool = False) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/pickle.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/pickle.pyi index 0f486b1d0046..03ba6c12cd4a 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/pickle.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/pickle.pyi @@ -208,7 +208,6 @@ class _Pickler: dispatch_table: Mapping[type, Callable[[Any], _ReducedType]] bin: bool # undocumented dispatch: ClassVar[dict[type, Callable[[Unpickler, Any], None]]] # undocumented, _Pickler only - reducer_override: Callable[[Any], Any] def __init__( self, file: SupportsWrite[bytes], @@ -220,6 +219,10 @@ class _Pickler: def dump(self, obj: Any) -> None: ... def clear_memo(self) -> None: ... def persistent_id(self, obj: Any) -> Any: ... + # The following method is not defined on _Pickler, but can be defined on + # sub-classes. Should return `NotImplemented` if pickling the supplied + # object is not supported and returns the same types as `__reduce__()`. + def reducer_override(self, obj: object, /) -> _ReducedType: ... class _Unpickler: dispatch: ClassVar[dict[int, Callable[[Unpickler], None]]] # undocumented, _Unpickler only diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/signal.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/signal.pyi index c2668bd8b32d..3bf1d3129378 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/signal.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/signal.pyi @@ -9,7 +9,6 @@ from typing_extensions import Never, TypeAlias NSIG: int class Signals(IntEnum): - SIGABRT = 6 SIGFPE = 8 SIGILL = 4 SIGINT = 2 @@ -17,10 +16,12 @@ class Signals(IntEnum): SIGTERM = 15 if sys.platform == "win32": + SIGABRT = 22 SIGBREAK = 21 CTRL_C_EVENT = 0 CTRL_BREAK_EVENT = 1 else: + SIGABRT = 6 SIGALRM = 14 SIGBUS = 7 SIGCHLD = 17 diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/sqlite3/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/sqlite3/__init__.pyi index 62b4055e118e..86ae7bccdb11 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/sqlite3/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/sqlite3/__init__.pyi @@ -365,9 +365,9 @@ class Connection: def executescript(self, sql_script: str, /) -> Cursor: ... def interrupt(self) -> None: ... if sys.version_info >= (3, 13): - def iterdump(self, *, filter: str | None = None) -> Generator[str, None, None]: ... + def iterdump(self, *, filter: str | None = None) -> Generator[str]: ... else: - def iterdump(self) -> Generator[str, None, None]: ... + def iterdump(self) -> Generator[str]: ... def rollback(self) -> None: ... def set_authorizer( diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/ssl.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/ssl.pyi index 2053005f1ba6..57952cf19bbe 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/ssl.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/ssl.pyi @@ -103,14 +103,14 @@ CERT_OPTIONAL: Final = VerifyMode.CERT_OPTIONAL CERT_REQUIRED: Final = VerifyMode.CERT_REQUIRED class VerifyFlags(enum.IntFlag): - VERIFY_DEFAULT = 0 - VERIFY_CRL_CHECK_LEAF = 4 - VERIFY_CRL_CHECK_CHAIN = 12 - VERIFY_X509_STRICT = 32 - VERIFY_X509_TRUSTED_FIRST = 32768 + VERIFY_DEFAULT = 0x00 + VERIFY_CRL_CHECK_LEAF = 0x04 + VERIFY_CRL_CHECK_CHAIN = 0x0C + VERIFY_X509_STRICT = 0x20 + VERIFY_X509_TRUSTED_FIRST = 0x8000 if sys.version_info >= (3, 10): - VERIFY_ALLOW_PROXY_CERTS = 64 - VERIFY_X509_PARTIAL_CHAIN = 524288 + VERIFY_ALLOW_PROXY_CERTS = 0x40 + VERIFY_X509_PARTIAL_CHAIN = 0x80000 VERIFY_DEFAULT: Final = VerifyFlags.VERIFY_DEFAULT VERIFY_CRL_CHECK_LEAF: Final = VerifyFlags.VERIFY_CRL_CHECK_LEAF @@ -144,7 +144,7 @@ PROTOCOL_TLS_CLIENT: Final = _SSLMethod.PROTOCOL_TLS_CLIENT PROTOCOL_TLS_SERVER: Final = _SSLMethod.PROTOCOL_TLS_SERVER class Options(enum.IntFlag): - OP_ALL = 2147483728 + OP_ALL: int OP_NO_SSLv2 = 0 OP_NO_SSLv3 = 33554432 OP_NO_TLSv1 = 67108864 diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/statistics.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/statistics.pyi index 188bed3375bf..d9f282b99b66 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/statistics.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/statistics.pyi @@ -3,7 +3,7 @@ from _typeshed import SupportsRichComparisonT from collections.abc import Callable, Hashable, Iterable, Sequence, Sized from decimal import Decimal from fractions import Fraction -from typing import Literal, NamedTuple, Protocol, SupportsFloat, SupportsIndex, TypeVar +from typing import Literal, NamedTuple, Protocol, SupportsFloat, SupportsIndex, TypeVar, type_check_only from typing_extensions import Self, TypeAlias __all__ = [ @@ -44,7 +44,9 @@ _Seed: TypeAlias = int | float | str | bytes | bytearray # noqa: Y041 # Used in linear_regression _T_co = TypeVar("_T_co", covariant=True) +@type_check_only class _SizedIterable(Iterable[_T_co], Sized, Protocol[_T_co]): ... + class StatisticsError(ValueError): ... if sys.version_info >= (3, 11): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tarfile.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tarfile.pyi index 6e68c370f3aa..7d6bb341db31 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tarfile.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tarfile.pyi @@ -128,8 +128,8 @@ class TarFile: errors: str fileobject: type[ExFileObject] # undocumented pax_headers: Mapping[str, str] - debug: int - errorlevel: int + debug: Literal[0, 1, 2, 3] + errorlevel: Literal[0, 1, 2] offset: int # undocumented extraction_filter: _FilterFunction | None if sys.version_info >= (3, 13): @@ -146,8 +146,8 @@ class TarFile: encoding: str | None = None, errors: str = "surrogateescape", pax_headers: Mapping[str, str] | None = None, - debug: int | None = None, - errorlevel: int | None = None, + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 copybufsize: int | None = None, # undocumented stream: bool = False, ) -> None: ... @@ -164,8 +164,8 @@ class TarFile: encoding: str | None = None, errors: str = "surrogateescape", pax_headers: Mapping[str, str] | None = None, - debug: int | None = None, - errorlevel: int | None = None, + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 copybufsize: int | None = None, # undocumented ) -> None: ... @@ -190,8 +190,8 @@ class TarFile: encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 ) -> Self: ... if sys.version_info >= (3, 14): @overload @@ -210,8 +210,8 @@ class TarFile: encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 level: None = None, options: Mapping[int, int] | None = None, zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None, @@ -233,8 +233,8 @@ class TarFile: encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 ) -> Self: ... @overload @classmethod @@ -252,8 +252,8 @@ class TarFile: encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 ) -> Self: ... @overload @classmethod @@ -271,8 +271,8 @@ class TarFile: encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 compresslevel: int = 9, ) -> Self: ... @overload @@ -291,8 +291,8 @@ class TarFile: encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 compresslevel: int = 9, ) -> Self: ... @overload @@ -311,8 +311,8 @@ class TarFile: encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ..., ) -> Self: ... @overload @@ -331,8 +331,8 @@ class TarFile: encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ..., ) -> Self: ... if sys.version_info >= (3, 14): @@ -352,8 +352,8 @@ class TarFile: encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 options: Mapping[int, int] | None = None, zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None, ) -> Self: ... @@ -373,8 +373,8 @@ class TarFile: encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 options: Mapping[int, int] | None = None, zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None, ) -> Self: ... @@ -395,8 +395,8 @@ class TarFile: encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 ) -> Self: ... @overload @classmethod @@ -414,8 +414,8 @@ class TarFile: encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 ) -> Self: ... @overload @classmethod @@ -433,8 +433,8 @@ class TarFile: encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 ) -> Self: ... @overload @classmethod @@ -452,8 +452,8 @@ class TarFile: encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 ) -> Self: ... @overload @classmethod @@ -471,8 +471,8 @@ class TarFile: encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 compresslevel: int = 9, ) -> Self: ... @overload @@ -491,8 +491,8 @@ class TarFile: encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 compresslevel: int = 9, ) -> Self: ... @classmethod @@ -509,8 +509,8 @@ class TarFile: ignore_zeros: bool | None = ..., encoding: str | None = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 ) -> Self: ... @overload @classmethod @@ -527,8 +527,8 @@ class TarFile: ignore_zeros: bool | None = ..., encoding: str | None = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 ) -> Self: ... @overload @classmethod @@ -545,8 +545,8 @@ class TarFile: ignore_zeros: bool | None = ..., encoding: str | None = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 ) -> Self: ... @overload @classmethod @@ -563,8 +563,8 @@ class TarFile: ignore_zeros: bool | None = ..., encoding: str | None = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 ) -> Self: ... @overload @classmethod @@ -581,8 +581,8 @@ class TarFile: ignore_zeros: bool | None = ..., encoding: str | None = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 ) -> Self: ... @classmethod def xzopen( @@ -598,8 +598,8 @@ class TarFile: ignore_zeros: bool | None = ..., encoding: str | None = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 ) -> Self: ... if sys.version_info >= (3, 14): @overload @@ -619,8 +619,8 @@ class TarFile: ignore_zeros: bool | None = ..., encoding: str | None = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 ) -> Self: ... @overload @classmethod @@ -639,8 +639,8 @@ class TarFile: ignore_zeros: bool | None = ..., encoding: str | None = ..., pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., + debug: Literal[0, 1, 2, 3] | None = None, # default 0 + errorlevel: Literal[0, 1, 2] | None = None, # default 1 ) -> Self: ... def getmember(self, name: str) -> TarInfo: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/threading.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/threading.pyi index abc7fe7e8124..03c8865d3c0a 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/threading.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/threading.pyi @@ -3,7 +3,7 @@ import sys from _thread import _ExceptHookArgs, get_native_id as get_native_id from _typeshed import ProfileFunction, TraceFunction from collections.abc import Callable, Iterable, Mapping -from contextvars import ContextVar +from contextvars import Context from types import TracebackType from typing import Any, Final, TypeVar, final from typing_extensions import deprecated @@ -87,7 +87,7 @@ class Thread: kwargs: Mapping[str, Any] | None = None, *, daemon: bool | None = None, - context: ContextVar[Any] | None = None, + context: Context | None = None, ) -> None: ... else: def __init__( diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/__init__.pyi index 90225a8a3652..a70ef2351f3d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/__init__.pyi @@ -1153,7 +1153,9 @@ class Grid: ipady: float | str = ..., padx: float | str | tuple[float | str, float | str] = ..., pady: float | str | tuple[float | str, float | str] = ..., - sticky: str = ..., # consists of letters 'n', 's', 'w', 'e', may contain repeats, may be empty + sticky: ( + str | list[str] | tuple[str, ...] + ) = ..., # consists of letters 'n', 's', 'w', 'e', may contain repeats, may be empty in_: Misc = ..., **kw: Any, # allow keyword argument named 'in', see #4836 ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/ttk.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/ttk.pyi index 7143c7cce592..0a6837201035 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/ttk.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tkinter/ttk.pyi @@ -57,6 +57,7 @@ _VsapiStatespec: TypeAlias = tuple[Unpack[tuple[str, ...]], int] _P = ParamSpec("_P") _T = TypeVar("_T") +@type_check_only class _Layout(TypedDict, total=False): side: Literal["left", "right", "top", "bottom"] sticky: str # consists of letters 'n', 's', 'w', 'e', may contain repeats, may be empty @@ -68,6 +69,7 @@ class _Layout(TypedDict, total=False): _LayoutSpec: TypeAlias = list[tuple[str, _Layout | None]] # Keep these in sync with the appropriate methods in Style +@type_check_only class _ElementCreateImageKwargs(TypedDict, total=False): border: _Padding height: float | str @@ -82,12 +84,15 @@ _ElementCreateArgsCrossPlatform: TypeAlias = ( | tuple[Literal["from"], str] # (fromelement is optional) ) if sys.platform == "win32" and sys.version_info >= (3, 13): + @type_check_only class _ElementCreateVsapiKwargsPadding(TypedDict, total=False): padding: _Padding + @type_check_only class _ElementCreateVsapiKwargsMargin(TypedDict, total=False): padding: _Padding + @type_check_only class _ElementCreateVsapiKwargsSize(TypedDict): width: float | str height: float | str diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tokenize.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tokenize.pyi index 00a24b4eea07..0df8062d5689 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tokenize.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tokenize.pyi @@ -151,8 +151,8 @@ class Untokenizer: # Returns str, unless the ENCODING token is present, in which case it returns bytes. def untokenize(iterable: Iterable[_Token]) -> str | Any: ... def detect_encoding(readline: Callable[[], bytes | bytearray]) -> tuple[str, Sequence[bytes]]: ... -def tokenize(readline: Callable[[], bytes | bytearray]) -> Generator[TokenInfo, None, None]: ... -def generate_tokens(readline: Callable[[], str]) -> Generator[TokenInfo, None, None]: ... +def tokenize(readline: Callable[[], bytes | bytearray]) -> Generator[TokenInfo]: ... +def generate_tokens(readline: Callable[[], str]) -> Generator[TokenInfo]: ... def open(filename: FileDescriptorOrPath) -> TextIO: ... def group(*choices: str) -> str: ... # undocumented def any(*choices: str) -> str: ... # undocumented diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/traceback.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/traceback.pyi index 4305706afa20..f9d88f25afd9 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/traceback.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/traceback.pyi @@ -111,7 +111,7 @@ def walk_tb(tb: TracebackType | None) -> Iterator[tuple[FrameType, int]]: ... if sys.version_info >= (3, 11): class _ExceptionPrintContext: def indent(self) -> str: ... - def emit(self, text_gen: str | Iterable[str], margin_char: str | None = None) -> Generator[str, None, None]: ... + def emit(self, text_gen: str | Iterable[str], margin_char: str | None = None) -> Generator[str]: ... class TracebackException: __cause__: TracebackException | None @@ -232,14 +232,14 @@ class TracebackException: def __eq__(self, other: object) -> bool: ... __hash__: ClassVar[None] # type: ignore[assignment] if sys.version_info >= (3, 11): - def format(self, *, chain: bool = True, _ctx: _ExceptionPrintContext | None = None) -> Generator[str, None, None]: ... + def format(self, *, chain: bool = True, _ctx: _ExceptionPrintContext | None = None) -> Generator[str]: ... else: - def format(self, *, chain: bool = True) -> Generator[str, None, None]: ... + def format(self, *, chain: bool = True) -> Generator[str]: ... if sys.version_info >= (3, 13): - def format_exception_only(self, *, show_group: bool = False, _depth: int = 0) -> Generator[str, None, None]: ... + def format_exception_only(self, *, show_group: bool = False, _depth: int = 0) -> Generator[str]: ... else: - def format_exception_only(self) -> Generator[str, None, None]: ... + def format_exception_only(self) -> Generator[str]: ... if sys.version_info >= (3, 11): def print(self, *, file: SupportsWrite[str] | None = None, chain: bool = True) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/typing_extensions.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/typing_extensions.pyi index 16cf0611a58a..406005cc4c56 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/typing_extensions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/typing_extensions.pyi @@ -220,7 +220,7 @@ def runtime_checkable(cls: _TC) -> _TC: ... runtime = runtime_checkable Final: _SpecialForm -def final(f: _F) -> _F: ... +def final(f: _T) -> _T: ... def disjoint_base(cls: _TC) -> _TC: ... Literal: _SpecialForm diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/main.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/main.pyi index 23ead1638ecc..e1aeac32c591 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/main.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/main.pyi @@ -18,7 +18,7 @@ class _TestRunner(Protocol): # not really documented class TestProgram: result: unittest.result.TestResult - module: None | str | ModuleType + module: ModuleType | None verbosity: int failfast: bool | None catchbreak: bool | None @@ -30,7 +30,7 @@ class TestProgram: durations: unittest.result._DurationsType | None def __init__( self, - module: None | str | ModuleType = "__main__", + module: ModuleType | str | None = "__main__", defaultTest: str | Iterable[str] | None = None, argv: list[str] | None = None, testRunner: type[_TestRunner] | _TestRunner | None = None, diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementPath.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementPath.pyi index 80f3c55c1489..5c03dd014b63 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementPath.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementPath.pyi @@ -8,10 +8,10 @@ xpath_tokenizer_re: Final[Pattern[str]] _Token: TypeAlias = tuple[str, str] _Next: TypeAlias = Callable[[], _Token] -_Callback: TypeAlias = Callable[[_SelectorContext, Iterable[Element]], Generator[Element, None, None]] +_Callback: TypeAlias = Callable[[_SelectorContext, Iterable[Element]], Generator[Element]] _T = TypeVar("_T") -def xpath_tokenizer(pattern: str, namespaces: dict[str, str] | None = None) -> Generator[_Token, None, None]: ... +def xpath_tokenizer(pattern: str, namespaces: dict[str, str] | None = None) -> Generator[_Token]: ... def get_parent_map(context: _SelectorContext) -> dict[Element, Element]: ... def prepare_child(next: _Next, token: _Token) -> _Callback: ... def prepare_star(next: _Next, token: _Token) -> _Callback: ... @@ -32,7 +32,7 @@ def iterfind( # type: ignore[overload-overlap] elem: Element[Any], path: Literal[""], namespaces: dict[str, str] | None = None ) -> None: ... @overload -def iterfind(elem: Element[Any], path: str, namespaces: dict[str, str] | None = None) -> Generator[Element, None, None]: ... +def iterfind(elem: Element[Any], path: str, namespaces: dict[str, str] | None = None) -> Generator[Element]: ... def find(elem: Element[Any], path: str, namespaces: dict[str, str] | None = None) -> Element | None: ... def findall(elem: Element[Any], path: str, namespaces: dict[str, str] | None = None) -> list[Element]: ... @overload diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi index d728fb975bfb..6340a44bd51c 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi @@ -106,12 +106,12 @@ class Element(Generic[_Tag]): def get(self, key: str, default: _T) -> str | _T: ... def insert(self, index: int, subelement: Element[Any], /) -> None: ... def items(self) -> ItemsView[str, str]: ... - def iter(self, tag: str | None = None) -> Generator[Element, None, None]: ... + def iter(self, tag: str | None = None) -> Generator[Element]: ... @overload def iterfind(self, path: Literal[""], namespaces: dict[str, str] | None = None) -> None: ... # type: ignore[overload-overlap] @overload - def iterfind(self, path: str, namespaces: dict[str, str] | None = None) -> Generator[Element, None, None]: ... - def itertext(self) -> Generator[str, None, None]: ... + def iterfind(self, path: str, namespaces: dict[str, str] | None = None) -> Generator[Element]: ... + def itertext(self) -> Generator[str]: ... def keys(self) -> dict_keys[str, str]: ... # makeelement returns the type of self in Python impl, but not in C impl def makeelement(self, tag: _OtherTag, attrib: dict[str, str], /) -> Element[_OtherTag]: ... @@ -159,7 +159,7 @@ class ElementTree(Generic[_Root]): def getroot(self) -> _Root: ... def _setroot(self, element: Element[Any]) -> None: ... def parse(self, source: _FileRead, parser: XMLParser | None = None) -> Element: ... - def iter(self, tag: str | None = None) -> Generator[Element, None, None]: ... + def iter(self, tag: str | None = None) -> Generator[Element]: ... def find(self, path: str, namespaces: dict[str, str] | None = None) -> Element | None: ... @overload def findtext(self, path: str, default: None = None, namespaces: dict[str, str] | None = None) -> str | None: ... @@ -169,7 +169,7 @@ class ElementTree(Generic[_Root]): @overload def iterfind(self, path: Literal[""], namespaces: dict[str, str] | None = None) -> None: ... # type: ignore[overload-overlap] @overload - def iterfind(self, path: str, namespaces: dict[str, str] | None = None) -> Generator[Element, None, None]: ... + def iterfind(self, path: str, namespaces: dict[str, str] | None = None) -> Generator[Element]: ... def write( self, file_or_filename: _FileWrite, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Authlib/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Authlib/METADATA.toml index f7778c178069..2a6015c665f1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Authlib/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Authlib/METADATA.toml @@ -1,3 +1,3 @@ -version = "1.6.9" -upstream_repository = "https://github.com/authlib/authlib" -requires = ["cryptography"] +version = "1.6.10" +upstream-repository = "https://github.com/authlib/authlib" +dependencies = ["cryptography"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Authlib/authlib/integrations/httpx_client/oauth1_client.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Authlib/authlib/integrations/httpx_client/oauth1_client.pyi index 1160db3b44c9..253da19d57ac 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Authlib/authlib/integrations/httpx_client/oauth1_client.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Authlib/authlib/integrations/httpx_client/oauth1_client.pyi @@ -12,7 +12,7 @@ _Request: TypeAlias = Incomplete # actual type is httpx.Request # Inherits from httpx.Auth class OAuth1Auth(ClientAuth): requires_request_body: bool - def auth_flow(self, request: _Request) -> Generator[_Request, _Response, None]: ... + def auth_flow(self, request: _Request) -> Generator[_Request, _Response]: ... # Inherits from httpx.AsyncClient class AsyncOAuth1Client(_OAuth1Client): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Authlib/authlib/integrations/httpx_client/oauth2_client.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Authlib/authlib/integrations/httpx_client/oauth2_client.pyi index 79d45bd3c2af..e5610e67a9ef 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Authlib/authlib/integrations/httpx_client/oauth2_client.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Authlib/authlib/integrations/httpx_client/oauth2_client.pyi @@ -16,12 +16,12 @@ _Request: TypeAlias = Incomplete # actual type is httpx.Request # Inherits from httpx.Auth class OAuth2Auth(TokenAuth): requires_request_body: bool - def auth_flow(self, request: _Request) -> Generator[_Request, _Response, None]: ... + def auth_flow(self, request: _Request) -> Generator[_Request, _Response]: ... # Inherits from httpx.Auth class OAuth2ClientAuth(ClientAuth): requires_request_body: bool - def auth_flow(self, request: _Request) -> Generator[_Request, _Response, None]: ... + def auth_flow(self, request: _Request) -> Generator[_Request, _Response]: ... # Inherits from httpx.AsyncClient class AsyncOAuth2Client(_OAuth2Client): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Deprecated/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Deprecated/METADATA.toml index fefce48a34ce..43db3066d9b7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Deprecated/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Deprecated/METADATA.toml @@ -1,3 +1,3 @@ version = "~=1.3.1" -upstream_repository = "https://github.com/laurent-laporte-pro/deprecated" -requires = [] +upstream-repository = "https://github.com/laurent-laporte-pro/deprecated" +dependencies = [] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/METADATA.toml index cacf48ed4dbd..5e71c765653b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/METADATA.toml @@ -1,4 +1,4 @@ version = "6.0.*" -upstream_repository = "https://github.com/corydolphin/flask-cors" +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/packages/pyright-internal/typeshed-fallback/stubs/Flask-Migrate/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Migrate/METADATA.toml index 6c2b99083ced..526b6c3e0d03 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Flask-Migrate/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Migrate/METADATA.toml @@ -1,4 +1,4 @@ version = "4.1.*" -upstream_repository = "https://github.com/miguelgrinberg/Flask-Migrate" +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/packages/pyright-internal/typeshed-fallback/stubs/Flask-SocketIO/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Flask-SocketIO/METADATA.toml index 1fc858c968a4..ef14c192a276 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Flask-SocketIO/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Flask-SocketIO/METADATA.toml @@ -1,3 +1,3 @@ version = "5.6.*" -requires = ["Flask>=0.9"] -upstream_repository = "https://github.com/miguelgrinberg/flask-socketio" +dependencies = ["Flask>=0.9"] +upstream-repository = "https://github.com/miguelgrinberg/flask-socketio" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/METADATA.toml index b37b5b295512..40a0bac719cf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/METADATA.toml @@ -1,12 +1,12 @@ version = "0.5.*" -upstream_repository = "https://github.com/spatialaudio/jackclient-python" +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 -ci_platforms = ["darwin", "linux"] -apt_dependencies = ["libjack-dev"] -brew_dependencies = ["jack"] +ci-platforms = ["darwin", "linux"] +apt-dependencies = ["libjack-dev"] +brew-dependencies = ["jack"] # No need to install on the CI. Leaving here as information for Windows contributors. -# choco_dependencies = ["jack"] +# choco-dependencies = ["jack"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/jack/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/jack/__init__.pyi index a9aab4df7bde..963959b0448e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/jack/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/jack/__init__.pyi @@ -237,7 +237,7 @@ class OwnMidiPort(MidiPort, OwnPort): def max_event_size(self) -> int: ... @property def lost_midi_events(self) -> int: ... - def incoming_midi_events(self) -> Generator[tuple[int, _CBufferType], None, None]: ... + def incoming_midi_events(self) -> Generator[tuple[int, _CBufferType]]: ... def clear_buffer(self) -> None: ... def write_midi_event(self, time: int, event: bytes | Sequence[int] | _CBufferType) -> None: ... def reserve_midi_event(self, time: int, size: int) -> _CBufferType: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/METADATA.toml index b353483b67af..9afedb7c6c2b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/METADATA.toml @@ -1,2 +1,2 @@ version = "2.1.12" -upstream_repository = "https://github.com/NVIDIA/jetson-gpio" +upstream-repository = "https://github.com/NVIDIA/jetson-gpio" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/METADATA.toml index c29279ee2404..1e61a2413cbb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/METADATA.toml @@ -1,2 +1,2 @@ version = "~=3.10.2" -upstream_repository = "https://github.com/Python-Markdown/markdown" +upstream-repository = "https://github.com/Python-Markdown/markdown" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyAutoGUI/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/PyAutoGUI/METADATA.toml index 66c268a999ac..32947c6d216d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyAutoGUI/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyAutoGUI/METADATA.toml @@ -1,3 +1,3 @@ version = "0.9.*" -upstream_repository = "https://github.com/asweigart/pyautogui" -requires = ["types-PyScreeze"] +upstream-repository = "https://github.com/asweigart/pyautogui" +dependencies = ["types-PyScreeze"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyMeeus/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/PyMeeus/METADATA.toml index edd8e1ea4bbc..f8508a58ef40 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyMeeus/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyMeeus/METADATA.toml @@ -1,2 +1,2 @@ version = "0.5.*" -upstream_repository = "https://github.com/architest/pymeeus" +upstream-repository = "https://github.com/architest/pymeeus" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/METADATA.toml index 5712897f5e72..55b5654668ef 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyMySQL/METADATA.toml @@ -1,2 +1,2 @@ version = "1.1.*" -upstream_repository = "https://github.com/PyMySQL/PyMySQL" +upstream-repository = "https://github.com/PyMySQL/PyMySQL" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/METADATA.toml index 723e24d731c9..e14ea274756e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/METADATA.toml @@ -1,11 +1,11 @@ version = "1.0.1" -upstream_repository = "https://github.com/asweigart/pyscreeze" -requires = ["Pillow>=10.3.0"] +upstream-repository = "https://github.com/asweigart/pyscreeze" +dependencies = ["Pillow>=10.3.0"] [tool.stubtest] # Linux has extra constants, win32 has different definitions -ci_platforms = ["linux", "win32"] +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/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/pyscreeze/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/pyscreeze/__init__.pyi index 1405bfba0f23..df9e1b3f6a20 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/pyscreeze/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/pyscreeze/__init__.pyi @@ -108,7 +108,7 @@ def locateAllOnScreen( region: tuple[int, int, int, int] | None = None, step: int = 1, confidence: ConvertibleToFloat = 0.999, -) -> Generator[Box, None, None]: ... +) -> Generator[Box]: ... # _locateAll_pillow @overload @@ -120,7 +120,7 @@ def locateAllOnScreen( region: tuple[int, int, int, int] | None = None, step: int = 1, confidence: None = None, -) -> Generator[Box, None, None]: ... +) -> Generator[Box]: ... # _locateAll_opencv @overload @@ -202,7 +202,7 @@ def locateAll( region: tuple[int, int, int, int] | None = None, step: int = 1, confidence: ConvertibleToFloat = 0.999, -) -> Generator[Box, None, None]: ... +) -> Generator[Box]: ... # _locateAll_pillow @overload @@ -214,4 +214,4 @@ def locateAll( region: tuple[int, int, int, int] | None = None, step: int = 1, confidence: None = None, -) -> Generator[Box, None, None]: ... +) -> Generator[Box]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PySocks/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/PySocks/METADATA.toml index e99f8028c0fe..2c0e6928c02f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PySocks/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/PySocks/METADATA.toml @@ -1,2 +1,2 @@ version = "1.7.1" -upstream_repository = "https://github.com/Anorov/PySocks" +upstream-repository = "https://github.com/Anorov/PySocks" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/METADATA.toml index c31b588e644c..036c3b255825 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyYAML/METADATA.toml @@ -1,2 +1,2 @@ version = "6.0.*" -upstream_repository = "https://github.com/yaml/pyyaml" +upstream-repository = "https://github.com/yaml/pyyaml" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/METADATA.toml index f6fea02473cc..41f7ee57a067 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/METADATA.toml @@ -1,8 +1,7 @@ -version = "2.19.*" -upstream_repository = "https://github.com/pygments/pygments" -requires = ["types-docutils"] -partial_stub = true +version = "2.20.*" +upstream-repository = "https://github.com/pygments/pygments" +dependencies = ["types-docutils"] +partial-stub = true [tool.stubtest] -stubtest_requirements = ["sphinx"] -ignore_missing_stub = true +stubtest-dependencies = ["sphinx"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/__init__.pyi index 03d982778a29..ca3371f873b1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/__init__.pyi @@ -1,6 +1,6 @@ from _typeshed import SupportsWrite -from collections.abc import Iterator -from typing import TypeVar, overload +from collections.abc import Iterable, Iterator +from typing import Final, TypeVar, overload from pygments.formatter import Formatter from pygments.lexer import Lexer @@ -8,15 +8,16 @@ from pygments.token import _TokenType _T = TypeVar("_T", str, bytes) -__version__: str +__version__: Final[str] +__docformat__: Final = "restructuredtext" __all__ = ["lex", "format", "highlight"] def lex(code: str, lexer: Lexer) -> Iterator[tuple[_TokenType, str]]: ... @overload -def format(tokens, formatter: Formatter[_T], outfile: SupportsWrite[_T]) -> None: ... +def format(tokens: Iterable[tuple[_TokenType, str]], formatter: Formatter[_T], outfile: SupportsWrite[_T]) -> None: ... @overload -def format(tokens, formatter: Formatter[_T], outfile: None = None) -> _T: ... +def format(tokens: Iterable[tuple[_TokenType, str]], formatter: Formatter[_T], outfile: None = None) -> _T: ... @overload -def highlight(code, lexer, formatter: Formatter[_T], outfile: SupportsWrite[_T]) -> None: ... +def highlight(code: str, lexer: Lexer, formatter: Formatter[_T], outfile: SupportsWrite[_T]) -> None: ... @overload -def highlight(code, lexer, formatter: Formatter[_T], outfile: None = None) -> _T: ... +def highlight(code: str, lexer: Lexer, formatter: Formatter[_T], outfile: None = None) -> _T: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/cmdline.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/cmdline.pyi index 446595b76ffb..a99805b67040 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/cmdline.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/cmdline.pyi @@ -1,8 +1,9 @@ import argparse +from collections.abc import Sequence -def main_inner(parser, argns): ... +def main_inner(parser: argparse.ArgumentParser, argns: argparse.Namespace) -> int: ... class HelpFormatter(argparse.HelpFormatter): - def __init__(self, prog, indent_increment: int = 2, max_help_position: int = 16, width=None) -> None: ... + def __init__(self, prog: str, indent_increment: int = 2, max_help_position: int = 16, width: int | None = None) -> None: ... -def main(args=...): ... +def main(args: Sequence[str] | None = ...) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/console.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/console.pyi index ea9baa94f987..d76f250ab6fe 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/console.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/console.pyi @@ -1,10 +1,10 @@ -from _typeshed import Incomplete +from typing import Final -esc: str -codes: Incomplete -dark_colors: Incomplete -light_colors: Incomplete +esc: Final = "\x1b[" +codes: Final[dict[str, str]] +dark_colors: Final[list[str]] +light_colors: Final[list[str]] -def reset_color(): ... -def colorize(color_key, text): ... -def ansiformat(attr, text): ... +def reset_color() -> str: ... +def colorize(color_key: str, text: str) -> str: ... +def ansiformat(attr: str, text: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/filter.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/filter.pyi index 917273f6bcc7..6f05bbdddeb0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/filter.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/filter.pyi @@ -1,18 +1,29 @@ -from _typeshed import Incomplete from collections.abc import Iterable, Iterator +from typing import Any, ClassVar, Protocol, type_check_only from pygments.lexer import Lexer from pygments.token import _TokenType -def apply_filters(stream, filters, lexer=None): ... -def simplefilter(f): ... +@type_check_only +class _SimpleFilterFunction(Protocol): + # Function that can looked up as a method on a FunctionFilter subclass. + def __call__( + self, self_: FunctionFilter, lexer: Lexer | None, stream: Iterable[tuple[_TokenType, str]], options: dict[str, Any], / + ) -> Iterator[tuple[_TokenType, str]]: ... + +def apply_filters( + stream: Iterable[tuple[_TokenType, str]], filters: Iterable[Filter], lexer: Lexer | None = None +) -> Iterator[tuple[_TokenType, str]]: ... +def simplefilter(f: _SimpleFilterFunction) -> type[FunctionFilter]: ... class Filter: - options: Incomplete - def __init__(self, **options) -> None: ... - def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... + options: dict[str, Any] # Arbitrary values used by subclasses. + def __init__(self, **options: Any) -> None: ... # ditto. + def filter(self, lexer: Lexer | None, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... class FunctionFilter(Filter): - function: Incomplete - def __init__(self, **options) -> None: ... - def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... + # Set to None in class, but overridden with a non-None value in the subclasses created by @simplefilter. + function: ClassVar[_SimpleFilterFunction] + # 'options' gets passed as a dict to 'function'; valid types depends on the wrapped function's signature. + def __init__(self, **options: Any) -> None: ... + def filter(self, lexer: Lexer | None, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/filters/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/filters/__init__.pyi index ee98372d3fad..b43a8e9ef047 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/filters/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/filters/__init__.pyi @@ -1,58 +1,86 @@ -from _typeshed import Incomplete -from collections.abc import Generator, Iterable, Iterator +from _typeshed import ConvertibleToInt +from collections.abc import Callable, Generator, Iterable, Iterator +from re import Pattern +from typing import Any, ClassVar, Final, Literal from pygments.filter import Filter from pygments.lexer import Lexer from pygments.token import _TokenType -def find_filter_class(filtername): ... -def get_filter_by_name(filtername, **options): ... +def find_filter_class(filtername: str) -> type[Filter] | None: ... + +# Keyword arguments are forwarded to the filter class. +def get_filter_by_name(filtername: str, **options: Any) -> Filter: ... def get_all_filters() -> Generator[str]: ... class CodeTagFilter(Filter): - tag_re: Incomplete - def __init__(self, **options) -> None: ... - def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... + tag_re: Pattern[str] + # Arbitrary additional keyword arguments are permitted and are stored in self.options. + def __init__( + self, *, codetags: str | list[str] | tuple[str, ...] = ["XXX", "TODO", "FIXME", "BUG", "NOTE"], **options: Any + ) -> None: ... + def filter(self, lexer: Lexer | None, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... class SymbolFilter(Filter): - latex_symbols: Incomplete - isabelle_symbols: Incomplete - lang_map: Incomplete - symbols: Incomplete - def __init__(self, **options) -> None: ... - def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... + latex_symbols: ClassVar[dict[str, str]] + isabelle_symbols: ClassVar[dict[str, str]] + lang_map: ClassVar[dict[Literal["isabelle", "latex"], dict[str, str]]] + symbols: dict[str, str] # One of latex_symbols or isabelle_symbols. + # Arbitrary additional keyword arguments are permitted and are stored in self.options. + def __init__(self, *, lang: Literal["isabelle", "latex"] = "isabelle", **options: Any) -> None: ... + def filter(self, lexer: Lexer | None, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... class KeywordCaseFilter(Filter): - convert: Incomplete - def __init__(self, **options) -> None: ... - def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... + convert: Callable[[str], str] + # Arbitrary additional keyword arguments are permitted and are stored in self.options. + def __init__(self, *, case: Literal["lower", "upper", "capitalize"] = "lower", **options: Any) -> None: ... + def filter(self, lexer: Lexer | None, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... class NameHighlightFilter(Filter): - names: Incomplete - tokentype: Incomplete - def __init__(self, **options) -> None: ... - def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... + names: set[str] + tokentype: _TokenType + # Arbitrary additional keyword arguments are permitted and are stored in self.options. + def __init__( + self, *, names: str | list[str] | tuple[str, ...] = [], tokentype: str | _TokenType | None = None, **options: Any + ) -> None: ... + def filter(self, lexer: Lexer | None, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... class ErrorToken(Exception): ... class RaiseOnErrorTokenFilter(Filter): - exception: Incomplete - def __init__(self, **options) -> None: ... - def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... + exception: type[Exception] + # Arbitrary additional keyword arguments are permitted and are stored in self.options. + def __init__(self, *, excclass: type[Exception] = ..., **options: Any) -> None: ... + def filter(self, lexer: Lexer | None, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... class VisibleWhitespaceFilter(Filter): - wstt: Incomplete - def __init__(self, **options) -> None: ... - def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... + spaces: str + tabs: str + newlines: str + wstt: bool + def __init__( + self, + *, + spaces: str | bool = False, + tabs: str | bool = False, + newlines: str | bool = False, + tabsize: ConvertibleToInt = 8, + wstokentype: bool | int | str = True, # Any value accepted by get_bool_opt. + # Arbitrary additional keyword arguments are permitted and are stored in self.options. + **options: Any, + ) -> None: ... + def filter(self, lexer: Lexer | None, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... class GobbleFilter(Filter): - n: Incomplete - def __init__(self, **options) -> None: ... - def gobble(self, value, left): ... - def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... + n: int + # Arbitrary additional keyword arguments are permitted and are stored in self.options. + def __init__(self, *, n: ConvertibleToInt = 0, **options: Any) -> None: ... + def gobble(self, value: str, left: int) -> tuple[str, int]: ... + def filter(self, lexer: Lexer | None, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... class TokenMergeFilter(Filter): - def __init__(self, **options) -> None: ... - def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... + # Arbitrary additional keyword arguments are permitted and are stored in self.options. + def __init__(self, **options: Any) -> None: ... + def filter(self, lexer: Lexer | None, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... -FILTERS: Incomplete +FILTERS: Final[dict[str, type[Filter]]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatter.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatter.pyi index 254f68529f33..32dfdba8ad96 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatter.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatter.pyi @@ -1,23 +1,58 @@ -from _typeshed import Incomplete -from typing import Generic, TypeVar, overload +import types +from _typeshed import SupportsWrite +from collections.abc import Iterable, Sequence +from typing import Any, ClassVar, Generic, TypeVar, overload + +from pygments.style import Style +from pygments.token import _TokenType _T = TypeVar("_T", str, bytes) +__all__ = ["Formatter"] + class Formatter(Generic[_T]): - name: Incomplete - aliases: Incomplete - filenames: Incomplete - unicodeoutput: bool - style: Incomplete - full: Incomplete - title: Incomplete - encoding: Incomplete - options: Incomplete + name: ClassVar[str] # Set to None, but always overridden with a non-None value in subclasses. + aliases: ClassVar[Sequence[str]] # Not intended to be mutable + filenames: ClassVar[Sequence[str]] # Not intended to be mutable + unicodeoutput: ClassVar[bool] + style: type[Style] + full: bool + title: str + encoding: str | None + options: dict[str, Any] # arbitrary values used by subclasses @overload - def __init__(self: Formatter[str], *, encoding: None = None, outencoding: None = None, **options) -> None: ... + def __init__( + self: Formatter[str], + *, + style: type[Style] | str = "default", + full: bool = False, + title: str = "", + encoding: None = None, + outencoding: None = None, + **options: Any, # arbitrary values used by subclasses + ) -> None: ... @overload - def __init__(self: Formatter[bytes], *, encoding: str, outencoding: None = None, **options) -> None: ... + def __init__( + self: Formatter[bytes], + *, + style: type[Style] | str = "default", + full: bool = False, + title: str = "", + encoding: str, + outencoding: None = None, + **options: Any, # arbitrary values used by subclasses + ) -> None: ... @overload - def __init__(self: Formatter[bytes], *, encoding: None = None, outencoding: str, **options) -> None: ... - def get_style_defs(self, arg: str = ""): ... - def format(self, tokensource, outfile): ... + def __init__( + self: Formatter[bytes], + *, + style: type[Style] | str = "default", + full: bool = False, + title: str = "", + encoding: None = None, + outencoding: str, + **options: Any, # arbitrary values used by subclasses + ) -> None: ... + def __class_getitem__(cls, name: Any) -> types.GenericAlias: ... + def get_style_defs(self, arg: str = "") -> str: ... + def format(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[_T]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/__init__.pyi index f1b275f58f0f..5fdd2e310cf3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/__init__.pyi @@ -3,6 +3,7 @@ from collections.abc import Generator from ..formatter import Formatter from .bbcode import BBCodeFormatter as BBCodeFormatter +from .groff import GroffFormatter as GroffFormatter from .html import HtmlFormatter as HtmlFormatter from .img import ( BmpImageFormatter as BmpImageFormatter, @@ -19,6 +20,31 @@ from .svg import SvgFormatter as SvgFormatter from .terminal import TerminalFormatter as TerminalFormatter from .terminal256 import Terminal256Formatter as Terminal256Formatter, TerminalTrueColorFormatter as TerminalTrueColorFormatter +__all__ = [ + "get_formatter_by_name", + "get_formatter_for_filename", + "get_all_formatters", + "load_formatter_from_file", + "BBCodeFormatter", + "BmpImageFormatter", + "GifImageFormatter", + "GroffFormatter", + "HtmlFormatter", + "IRCFormatter", + "ImageFormatter", + "JpgImageFormatter", + "LatexFormatter", + "NullFormatter", + "PangoMarkupFormatter", + "RawTokenFormatter", + "RtfFormatter", + "SvgFormatter", + "Terminal256Formatter", + "TerminalFormatter", + "TerminalTrueColorFormatter", + "TestcaseFormatter", +] + def get_all_formatters() -> Generator[type[Formatter[Incomplete]]]: ... def get_formatter_by_name(_alias, **options): ... def load_formatter_from_file(filename, formattername: str = "CustomFormatter", **options): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/bbcode.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/bbcode.pyi index 26758a014638..2e596b6ec396 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/bbcode.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/bbcode.pyi @@ -1,13 +1,14 @@ -from _typeshed import Incomplete +from _typeshed import SupportsWrite +from collections.abc import Iterable from typing import TypeVar from pygments.formatter import Formatter +from pygments.token import _TokenType _T = TypeVar("_T", str, bytes) +__all__ = ["BBCodeFormatter"] + class BBCodeFormatter(Formatter[_T]): - name: str - aliases: Incomplete - filenames: Incomplete - styles: Incomplete - def format_unencoded(self, tokensource, outfile) -> None: ... + styles: dict[_TokenType, tuple[str, str]] + def format_unencoded(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[str]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/groff.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/groff.pyi new file mode 100644 index 000000000000..d6b936a2dff5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/groff.pyi @@ -0,0 +1,18 @@ +from _typeshed import SupportsWrite +from collections.abc import Iterable +from typing import TypeVar + +from pygments.formatter import Formatter +from pygments.token import _TokenType + +__all__ = ["GroffFormatter"] + +_T = TypeVar("_T", str, bytes) + +class GroffFormatter(Formatter[_T]): + monospaced: bool + linenos: bool + wrap: int + styles: dict[_TokenType, tuple[str, str]] + def __init__(self, **options) -> None: ... + def format_unencoded(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[str]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/html.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/html.pyi index 5d5c78f4bebd..1354b930341a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/html.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/html.pyi @@ -1,14 +1,15 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, SupportsWrite +from collections.abc import Iterable from typing import TypeVar from pygments.formatter import Formatter +from pygments.token import _TokenType _T = TypeVar("_T", str, bytes) +__all__ = ["HtmlFormatter"] + class HtmlFormatter(Formatter[_T]): - name: str - aliases: Incomplete - filenames: Incomplete title: Incomplete nowrap: Incomplete noclasses: Incomplete @@ -39,4 +40,4 @@ class HtmlFormatter(Formatter[_T]): def get_linenos_style_defs(self): ... def get_css_prefix(self, arg): ... def wrap(self, source): ... - def format_unencoded(self, tokensource, outfile) -> None: ... + def format_unencoded(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[str]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/img.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/img.pyi index 68b30d1890bc..26c8c131d5c8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/img.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/img.pyi @@ -1,9 +1,11 @@ -from _typeshed import Incomplete -from typing import TypeVar +from _typeshed import Incomplete, SupportsWrite +from collections.abc import Iterable +from typing_extensions import Never from pygments.formatter import Formatter +from pygments.token import _TokenType -_T = TypeVar("_T", str, bytes) +__all__ = ["ImageFormatter", "GifImageFormatter", "JpgImageFormatter", "BmpImageFormatter"] class PilNotAvailable(ImportError): ... class FontNotFound(Exception): ... @@ -20,11 +22,7 @@ class FontManager: def get_font(self, bold, oblique): ... def get_style(self, style): ... -class ImageFormatter(Formatter[_T]): - name: str - aliases: Incomplete - filenames: Incomplete - unicodeoutput: bool +class ImageFormatter(Formatter[bytes]): default_image_format: str encoding: str styles: Incomplete @@ -47,23 +45,14 @@ class ImageFormatter(Formatter[_T]): hl_lines: Incomplete hl_color: Incomplete drawables: Incomplete - def get_style_defs(self, arg: str = "") -> None: ... - def format(self, tokensource, outfile) -> None: ... + def get_style_defs(self, arg: str = "") -> Never: ... + def format(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[bytes]) -> None: ... -class GifImageFormatter(ImageFormatter[_T]): - name: str - aliases: Incomplete - filenames: Incomplete +class GifImageFormatter(ImageFormatter): default_image_format: str -class JpgImageFormatter(ImageFormatter[_T]): - name: str - aliases: Incomplete - filenames: Incomplete +class JpgImageFormatter(ImageFormatter): default_image_format: str -class BmpImageFormatter(ImageFormatter[_T]): - name: str - aliases: Incomplete - filenames: Incomplete +class BmpImageFormatter(ImageFormatter): default_image_format: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/irc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/irc.pyi index 00b45e671e70..0d34575c9ae8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/irc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/irc.pyi @@ -1,15 +1,16 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, SupportsWrite +from collections.abc import Iterable from typing import TypeVar from pygments.formatter import Formatter +from pygments.token import _TokenType _T = TypeVar("_T", str, bytes) +__all__ = ["IRCFormatter"] + class IRCFormatter(Formatter[_T]): - name: str - aliases: Incomplete - filenames: Incomplete darkbg: Incomplete colorscheme: Incomplete linenos: Incomplete - def format_unencoded(self, tokensource, outfile) -> None: ... + def format_unencoded(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[str]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/latex.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/latex.pyi index be793c6662b2..b1c4b7d3fe2e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/latex.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/latex.pyi @@ -1,15 +1,16 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, SupportsWrite +from collections.abc import Iterable from typing import TypeVar from pygments.formatter import Formatter from pygments.lexer import Lexer +from pygments.token import _TokenType _T = TypeVar("_T", str, bytes) +__all__ = ["LatexFormatter"] + class LatexFormatter(Formatter[_T]): - name: str - aliases: Incomplete - filenames: Incomplete docclass: Incomplete preamble: Incomplete linenos: Incomplete @@ -25,7 +26,7 @@ class LatexFormatter(Formatter[_T]): right: Incomplete envname: Incomplete def get_style_defs(self, arg: str = ""): ... - def format_unencoded(self, tokensource, outfile) -> None: ... + def format_unencoded(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[str]) -> None: ... class LatexEmbeddedLexer(Lexer): left: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/other.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/other.pyi index 44b16833aaf4..c30244da9e39 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/other.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/other.pyi @@ -1,27 +1,22 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, SupportsWrite +from collections.abc import Iterable from typing import TypeVar from pygments.formatter import Formatter +from pygments.token import _TokenType _T = TypeVar("_T", str, bytes) +__all__ = ["NullFormatter", "RawTokenFormatter", "TestcaseFormatter"] + class NullFormatter(Formatter[_T]): - name: str - aliases: Incomplete - filenames: Incomplete - def format(self, tokensource, outfile) -> None: ... + def format(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[_T]) -> None: ... class RawTokenFormatter(Formatter[bytes]): - name: str - aliases: Incomplete - filenames: Incomplete - unicodeoutput: bool encoding: str compress: Incomplete error_color: Incomplete - def format(self, tokensource, outfile) -> None: ... + def format(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[bytes]) -> None: ... class TestcaseFormatter(Formatter[_T]): - name: str - aliases: Incomplete - def format(self, tokensource, outfile) -> None: ... + def format(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[_T]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/pangomarkup.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/pangomarkup.pyi index aadc1747327c..331eab16ca9a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/pangomarkup.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/pangomarkup.pyi @@ -1,13 +1,14 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, SupportsWrite +from collections.abc import Iterable from typing import TypeVar from pygments.formatter import Formatter +from pygments.token import _TokenType _T = TypeVar("_T", str, bytes) +__all__ = ["PangoMarkupFormatter"] + class PangoMarkupFormatter(Formatter[_T]): - name: str - aliases: Incomplete - filenames: Incomplete styles: Incomplete - def format_unencoded(self, tokensource, outfile) -> None: ... + def format_unencoded(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[str]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/rtf.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/rtf.pyi index da95cd0d1dfd..dc374aaf4bcb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/rtf.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/rtf.pyi @@ -1,14 +1,17 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, SupportsWrite +from collections.abc import Iterable from typing import TypeVar from pygments.formatter import Formatter +from pygments.token import _TokenType _T = TypeVar("_T", str, bytes) +__all__ = ["RtfFormatter"] + class RtfFormatter(Formatter[_T]): - name: str - aliases: Incomplete - filenames: Incomplete fontface: Incomplete fontsize: Incomplete - def format_unencoded(self, tokensource, outfile) -> None: ... + @staticmethod + def hex_to_rtf_color(hex_color: str) -> str: ... + def format_unencoded(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[str]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/svg.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/svg.pyi index 8f98d0bbf1cb..900deb19f58c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/svg.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/svg.pyi @@ -1,14 +1,15 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, SupportsWrite +from collections.abc import Iterable from typing import TypeVar from pygments.formatter import Formatter +from pygments.token import _TokenType _T = TypeVar("_T", str, bytes) +__all__ = ["SvgFormatter"] + class SvgFormatter(Formatter[_T]): - name: str - aliases: Incomplete - filenames: Incomplete nowrap: Incomplete fontfamily: Incomplete fontsize: Incomplete @@ -20,4 +21,4 @@ class SvgFormatter(Formatter[_T]): linenostart: Incomplete linenostep: Incomplete linenowidth: Incomplete - def format_unencoded(self, tokensource, outfile) -> None: ... + def format_unencoded(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[str]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/terminal.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/terminal.pyi index 90ca462d6b72..c7c82cbdf257 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/terminal.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/terminal.pyi @@ -1,16 +1,17 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, SupportsWrite +from collections.abc import Iterable from typing import TypeVar from pygments.formatter import Formatter +from pygments.token import _TokenType _T = TypeVar("_T", str, bytes) +__all__ = ["TerminalFormatter"] + class TerminalFormatter(Formatter[_T]): - name: str - aliases: Incomplete - filenames: Incomplete darkbg: Incomplete colorscheme: Incomplete linenos: Incomplete - def format(self, tokensource, outfile): ... - def format_unencoded(self, tokensource, outfile) -> None: ... + def format(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[_T]) -> None: ... + def format_unencoded(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[str]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/terminal256.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/terminal256.pyi index 33f17c176f78..092a121f95aa 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/terminal256.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/formatters/terminal256.pyi @@ -1,10 +1,14 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, SupportsWrite +from collections.abc import Iterable from typing import TypeVar from pygments.formatter import Formatter +from pygments.token import _TokenType _T = TypeVar("_T", str, bytes) +__all__ = ["Terminal256Formatter", "TerminalTrueColorFormatter"] + class EscapeSequence: fg: Incomplete bg: Incomplete @@ -18,9 +22,6 @@ class EscapeSequence: def reset_string(self): ... class Terminal256Formatter(Formatter[_T]): - name: str - aliases: Incomplete - filenames: Incomplete xterm_colors: Incomplete best_match: Incomplete style_string: Incomplete @@ -28,10 +29,8 @@ class Terminal256Formatter(Formatter[_T]): useunderline: Incomplete useitalic: Incomplete linenos: Incomplete - def format(self, tokensource, outfile): ... - def format_unencoded(self, tokensource, outfile) -> None: ... -class TerminalTrueColorFormatter(Terminal256Formatter[_T]): - name: str - aliases: Incomplete - filenames: Incomplete + def format(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[_T]) -> None: ... + def format_unencoded(self, tokensource: Iterable[tuple[_TokenType, str]], outfile: SupportsWrite[str]) -> None: ... + +class TerminalTrueColorFormatter(Terminal256Formatter[_T]): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/lexer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/lexer.pyi index 9d760b95b206..124ba720f15e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/lexer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/lexer.pyi @@ -1,24 +1,41 @@ from _typeshed import Incomplete from collections.abc import Iterable, Iterator, Sequence -from re import RegexFlag -from typing import ClassVar +from re import Pattern, RegexFlag +from typing import ClassVar, Final from pygments.token import _TokenType from pygments.util import Future +__all__ = [ + "Lexer", + "RegexLexer", + "ExtendedRegexLexer", + "DelegatingLexer", + "LexerContext", + "include", + "inherit", + "bygroups", + "using", + "this", + "default", + "words", + "line_re", +] + +line_re: Final[Pattern[str]] + class LexerMeta(type): def __new__(cls, name, bases, d): ... - def analyse_text(self, text: str) -> float: ... # actually defined in class Lexer - # ClassVars of Lexer, but same situation as with StyleMeta and Style - name: str - aliases: Sequence[str] # not intended mutable - filenames: Sequence[str] - alias_filenames: Sequence[str] - mimetypes: Sequence[str] - priority: float - url: str | None class Lexer(metaclass=LexerMeta): + name: ClassVar[str] # Set to None, but always overridden with a non-None value in subclasses. + aliases: ClassVar[Sequence[str]] # not intended to be mutable + filenames: ClassVar[Sequence[str]] + alias_filenames: ClassVar[Sequence[str]] + mimetypes: ClassVar[Sequence[str]] + priority: ClassVar[float] + url: ClassVar[str] # Set to None, but always overridden with a non-None value in subclasses. + version_added: ClassVar[str] # Set to None, but always overridden with a non-None value in subclasses. options: Incomplete stripnl: Incomplete stripall: Incomplete @@ -28,6 +45,8 @@ class Lexer(metaclass=LexerMeta): filters: Incomplete def __init__(self, **options) -> None: ... def add_filter(self, filter_, **options) -> None: ... + @staticmethod # @staticmethod added by special handling in metaclass + def analyse_text(text: str) -> float: ... def get_tokens(self, text: str, unfiltered: bool = False) -> Iterator[tuple[_TokenType, str]]: ... def get_tokens_unprocessed(self, text: str) -> Iterator[tuple[int, _TokenType, str]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/lexers/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/lexers/__init__.pyi index 3463d6a6e452..6309716d9ace 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/lexers/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/lexers/__init__.pyi @@ -1,14 +1,14 @@ from _typeshed import FileDescriptorOrPath, StrPath from collections.abc import Iterator -from pygments.lexer import Lexer, LexerMeta +from pygments.lexer import Lexer def get_all_lexers(plugins: bool = True) -> Iterator[tuple[str, tuple[str, ...], tuple[str, ...], tuple[str, ...]]]: ... -def find_lexer_class(name: str) -> LexerMeta | None: ... -def find_lexer_class_by_name(_alias: str) -> LexerMeta: ... +def find_lexer_class(name: str) -> type[Lexer] | None: ... +def find_lexer_class_by_name(_alias: str) -> type[Lexer]: ... def get_lexer_by_name(_alias: str, **options) -> Lexer: ... def load_lexer_from_file(filename: FileDescriptorOrPath, lexername: str = "CustomLexer", **options) -> Lexer: ... -def find_lexer_class_for_filename(_fn: StrPath, code: str | bytes | None = None) -> LexerMeta | None: ... +def find_lexer_class_for_filename(_fn: StrPath, code: str | bytes | None = None) -> type[Lexer] | None: ... def get_lexer_for_filename(_fn: StrPath, code: str | bytes | None = None, **options) -> Lexer: ... def get_lexer_for_mimetype(_mime: str, **options) -> Lexer: ... def guess_lexer_for_filename(_fn: StrPath, _text: str, **options) -> Lexer: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/modeline.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/modeline.pyi index e13780553c31..bf51d03f825a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/modeline.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/modeline.pyi @@ -1 +1,3 @@ -def get_filetype_from_buffer(buf, max_lines: int = 5): ... +__all__ = ["get_filetype_from_buffer"] + +def get_filetype_from_buffer(buf: str, max_lines: int = 5) -> str | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/plugin.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/plugin.pyi index 25253818d781..a11c89351400 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/plugin.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/plugin.pyi @@ -1,16 +1,17 @@ import sys from _typeshed import Incomplete from collections.abc import Generator +from typing import Final from pygments.filter import Filter from pygments.formatter import Formatter from pygments.lexer import Lexer from pygments.style import Style -LEXER_ENTRY_POINT: str -FORMATTER_ENTRY_POINT: str -STYLE_ENTRY_POINT: str -FILTER_ENTRY_POINT: str +LEXER_ENTRY_POINT: Final = "pygments.lexers" +FORMATTER_ENTRY_POINT: Final = "pygments.formatters" +STYLE_ENTRY_POINT: Final = "pygments.styles" +FILTER_ENTRY_POINT: Final = "pygments.filters" if sys.version_info >= (3, 10): from importlib.metadata import EntryPoints diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/regexopt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/regexopt.pyi index f289a9950759..2429349f90fb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/regexopt.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/regexopt.pyi @@ -1,8 +1,12 @@ -from _typeshed import Incomplete +import re +from collections.abc import Iterable, Sequence +from operator import itemgetter +from typing import Final -CS_ESCAPE: Incomplete -FIRST_ELEMENT: Incomplete +CS_ESCAPE: Final[re.Pattern[str]] +FIRST_ELEMENT: Final[itemgetter[int]] -def make_charset(letters): ... -def regex_opt_inner(strings, open_paren): ... -def regex_opt(strings, prefix: str = "", suffix: str = ""): ... +def commonprefix(m: Iterable[str]) -> str: ... +def make_charset(letters: Iterable[str]) -> str: ... +def regex_opt_inner(strings: Sequence[str], open_paren: str) -> str: ... +def regex_opt(strings: Iterable[str], prefix: str = "", suffix: str = "") -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/scanner.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/scanner.pyi index 29fd64f876f4..1d4557425b9f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/scanner.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/scanner.pyi @@ -1,19 +1,19 @@ -from _typeshed import Incomplete +from re import Match, Pattern, RegexFlag class EndOfText(RuntimeError): ... class Scanner: - data: Incomplete - data_length: Incomplete + data: str + data_length: int start_pos: int pos: int - flags: Incomplete - last: Incomplete - match: Incomplete - def __init__(self, text, flags: int = 0) -> None: ... + flags: int | RegexFlag + last: str | None + match: str | None + def __init__(self, text: str, flags: int | RegexFlag = 0) -> None: ... @property - def eos(self): ... - def check(self, pattern): ... - def test(self, pattern): ... - def scan(self, pattern): ... + def eos(self) -> bool: ... + def check(self, pattern: str | Pattern[str]) -> Match[str] | None: ... + def test(self, pattern: str | Pattern[str]) -> bool: ... + def scan(self, pattern: str | Pattern[str]) -> bool: ... def get_char(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/sphinxext.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/sphinxext.pyi index cf43911fcfe6..f0caf6e2fa52 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/sphinxext.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/sphinxext.pyi @@ -1,14 +1,17 @@ +from typing import Any, Final + from docutils.parsers.rst import Directive -MODULEDOC: str -LEXERDOC: str -FMTERDOC: str -FILTERDOC: str +MODULEDOC: Final[str] +LEXERDOC: Final[str] +FMTERDOC: Final[str] +FILTERDOC: Final[str] class PygmentsDoc(Directive): filenames: set[str] + def document_lexers_overview(self) -> str: ... def document_lexers(self) -> str: ... def document_formatters(self) -> str: ... def document_filters(self) -> str: ... -def setup(app) -> None: ... +def setup(app: Any) -> None: ... # Actual type of 'app' is sphinx.application.Sphinx diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/style.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/style.pyi index 154f822ac480..6ebe3683dcfc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/style.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/style.pyi @@ -1,5 +1,6 @@ -from collections.abc import Iterator, Mapping, Set as AbstractSet -from typing import TypedDict, type_check_only +from _typeshed import Self +from collections.abc import Iterator, Mapping, Sequence, Set as AbstractSet +from typing import Any, ClassVar, TypedDict, type_check_only from pygments.token import _TokenType @@ -20,25 +21,21 @@ class _StyleDict(TypedDict): bgansicolor: str | None class StyleMeta(type): - def __new__(cls, name, bases, dct): ... + def __new__(cls: type[Self], name: str, bases: tuple[type[Any], ...], dct: dict[str, Any]) -> Self: ... def style_for_token(cls, token: _TokenType) -> _StyleDict: ... def styles_token(cls, ttype: _TokenType) -> bool: ... def list_styles(cls) -> list[tuple[_TokenType, _StyleDict]]: ... def __iter__(cls) -> Iterator[tuple[_TokenType, _StyleDict]]: ... def __len__(cls) -> int: ... - # These are a bit tricky. - # Technically should be ClassVar in class Style. - # But then we can't use StyleMeta to denote a style class. - # We need that because Type[Style] is not iterable, for example. - background_color: str - highlight_color: str - line_number_color: str - line_number_background_color: str - line_number_special_color: str - line_number_special_background_color: str - styles: Mapping[_TokenType, str] # not intended to be mutable - name: str - aliases: list[str] - web_style_gallery_exclude: bool -class Style(metaclass=StyleMeta): ... +class Style(metaclass=StyleMeta): + background_color: ClassVar[str] + highlight_color: ClassVar[str] + line_number_color: ClassVar[str] + line_number_background_color: ClassVar[str] + line_number_special_color: ClassVar[str] + line_number_special_background_color: ClassVar[str] + styles: ClassVar[Mapping[_TokenType, str]] # not intended to be mutable + name: ClassVar[str] + aliases: ClassVar[Sequence[str]] # not intended to be mutable + web_style_gallery_exclude: ClassVar[bool] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/token.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/token.pyi index cd63f2b61158..141ff50a1deb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/token.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/token.pyi @@ -1,5 +1,5 @@ from collections.abc import Mapping -from typing import Any +from typing import Any, Final from typing_extensions import Self class _TokenType(tuple[str, ...]): @@ -27,8 +27,8 @@ Operator: _TokenType Comment: _TokenType Generic: _TokenType -def is_token_subtype(ttype, other): ... -def string_to_tokentype(s): ... +def is_token_subtype(ttype: _TokenType, other: _TokenType) -> bool: ... +def string_to_tokentype(s: str | _TokenType) -> _TokenType: ... # dict, but shouldn't be mutated -STANDARD_TYPES: Mapping[_TokenType, str] +STANDARD_TYPES: Final[Mapping[_TokenType, str]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/unistring.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/unistring.pyi index bebf225e3634..895f786c730d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/unistring.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/unistring.pyi @@ -1,38 +1,71 @@ -from _typeshed import Incomplete +from typing import Final, Literal, TypeAlias -Cc: str -Cf: str -Cn: str -Co: str -Cs: str -Ll: str -Lm: str -Lo: str -Lt: str -Lu: str -Mc: str -Me: str -Mn: str -Nd: str -Nl: str -No: str -Pc: str -Pd: str -Pe: str -Pf: str -Pi: str -Po: str -Ps: str -Sc: str -Sk: str -Sm: str -So: str -Zl: str -Zp: str -Zs: str -xid_continue: str -xid_start: str -cats: Incomplete +_Cats: TypeAlias = Literal[ + "Cc", + "Cf", + "Cn", + "Co", + "Cs", + "Ll", + "Lm", + "Lo", + "Lt", + "Lu", + "Mc", + "Me", + "Mn", + "Nd", + "Nl", + "No", + "Pc", + "Pd", + "Pe", + "Pf", + "Pi", + "Po", + "Ps", + "Sc", + "Sk", + "Sm", + "So", + "Zl", + "Zp", + "Zs", +] -def combine(*args): ... -def allexcept(*args): ... +Cc: Final[str] +Cf: Final[str] +Cn: Final[str] +Co: Final[str] +Cs: Final[str] +Ll: Final[str] +Lm: Final[str] +Lo: Final[str] +Lt: Final[str] +Lu: Final[str] +Mc: Final[str] +Me: Final[str] +Mn: Final[str] +Nd: Final[str] +Nl: Final[str] +No: Final[str] +Pc: Final[str] +Pd: Final[str] +Pe: Final[str] +Pf: Final[str] +Pi: Final[str] +Po: Final[str] +Ps: Final[str] +Sc: Final[str] +Sk: Final[str] +Sm: Final[str] +So: Final[str] +Zl: Final[str] +Zp: Final[str] +Zs: Final[str] +xid_continue: Final[str] +xid_start: Final[str] +cats: Final[list[_Cats]] + +def combine(*args: _Cats) -> str: ... +def allexcept(*args: _Cats) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/util.pyi index 6a4076719ece..e2b63b730dd7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Pygments/pygments/util.pyi @@ -1,34 +1,53 @@ -from _typeshed import Incomplete +from collections.abc import Callable, Container, Hashable, Iterable from io import TextIOWrapper +from re import Pattern +from typing import Any, Final, Protocol, TypeVar, type_check_only -split_path_re: Incomplete -doctype_lookup_re: Incomplete -tag_re: Incomplete -xml_decl_re: Incomplete +_T = TypeVar("_T") +_H = TypeVar("_H", bound=Hashable) + +split_path_re: Final[Pattern[str]] +doctype_lookup_re: Final[Pattern[str]] +tag_re: Final[Pattern[str]] +xml_decl_re: Final[Pattern[str]] class ClassNotFound(ValueError): ... class OptionError(Exception): ... -def get_choice_opt(options, optname, allowed, default=None, normcase: bool = False): ... -def get_bool_opt(options, optname, default=None): ... -def get_int_opt(options, optname, default=None): ... -def get_list_opt(options, optname, default=None): ... -def docstring_headline(obj): ... -def make_analysator(f): ... -def shebang_matches(text, regex): ... -def doctype_matches(text, regex): ... -def html_doctype_matches(text): ... -def looks_like_xml(text): ... -def surrogatepair(c): ... -def format_lines(var_name, seq, raw: bool = False, indent_level: int = 0): ... -def duplicates_removed(it, already_seen=()): ... +@type_check_only +class _SupportsGetStrWithDefault(Protocol): + def get(self, item: str, default: Any, /) -> Any: ... + +# 'options' contains the **kwargs of an arbitrary function. +def get_choice_opt( + options: _SupportsGetStrWithDefault, optname: str, allowed: Container[_T], default: _T | None = None, normcase: bool = False +) -> _T: ... +def get_bool_opt(options: _SupportsGetStrWithDefault, optname: str, default: bool | None = None) -> bool: ... +def get_int_opt(options: _SupportsGetStrWithDefault, optname: str, default: int | None = None) -> int: ... + +# Return type and type of 'default' depend on the signature of the function whose **kwargs +# are being processed. +def get_list_opt( + options: _SupportsGetStrWithDefault, optname: str, default: list[Any] | tuple[Any, ...] | None = None +) -> list[Any]: ... +def docstring_headline(obj: object) -> str: ... +def make_analysator(f: Callable[[str], float]) -> Callable[[str], float]: ... +def shebang_matches(text: str, regex: str) -> bool: ... +def doctype_matches(text: str, regex: str) -> bool: ... +def html_doctype_matches(text: str) -> bool: ... +def looks_like_xml(text: str) -> bool: ... +def surrogatepair(c: int) -> int: ... +def format_lines(var_name: str, seq: Iterable[str], raw: bool = False, indent_level: int = 0) -> str: ... +def duplicates_removed(it: Iterable[_H], already_seen: Container[_H] = ()) -> list[_H]: ... class Future: def get(self) -> None: ... -def guess_decode(text): ... -def guess_decode_from_terminal(text, term): ... -def terminal_encoding(term): ... +def guess_decode(text: bytes) -> tuple[str, str]: ... + +# If 'term' has an 'encoding' attribute, it should be a str. Otherwise any object is accepted. +def guess_decode_from_terminal(text: bytes, term: Any) -> tuple[str, str]: ... +def terminal_encoding(term: Any) -> str: ... class UnclosingTextIOWrapper(TextIOWrapper): def close(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/RPi.GPIO/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/RPi.GPIO/METADATA.toml index c70910d69e4e..503497d94a9f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/RPi.GPIO/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/RPi.GPIO/METADATA.toml @@ -1,10 +1,10 @@ version = "0.7.*" -upstream_repository = "https://sourceforge.net/p/raspberry-gpio-python/code/" +upstream-repository = "https://sourceforge.net/p/raspberry-gpio-python/code/" [tool.stubtest] # This package is only supported on Raspberry Pi hardware, which identifies # itself as 'linux'. When run on other hardware, it raises a RuntimeError: # RPi.GPIO failed to import. RuntimeError: This module can only be run on a Raspberry Pi! # https://sourceforge.net/p/raspberry-gpio-python/code/ci/08048dd1894a6b09a104557b6eaa6bb68b6baac5/tree/source/py_gpio.c#l1008 -supported_platforms = [] -ci_platforms = [] +supported-platforms = [] +ci-platforms = [] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/RPi.GPIO/RPi/GPIO/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/RPi.GPIO/RPi/GPIO/__init__.pyi index 861eb9a170da..f35db8b59f0c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/RPi.GPIO/RPi/GPIO/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/RPi.GPIO/RPi/GPIO/__init__.pyi @@ -1,7 +1,8 @@ from collections.abc import Callable -from typing import Final, Literal, TypedDict +from typing import Final, Literal, TypedDict, type_check_only from typing_extensions import TypeAlias +@type_check_only class _RPi_Info(TypedDict): P1_REVISION: int REVISION: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/METADATA.toml index f41db2607366..53406caa9583 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Send2Trash/METADATA.toml @@ -1,2 +1,2 @@ version = "2.1.*" -upstream_repository = "https://github.com/arsenetar/send2trash" +upstream-repository = "https://github.com/arsenetar/send2trash" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/TgCrypto/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/TgCrypto/METADATA.toml index e941624c0da4..d859dd089bf5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/TgCrypto/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/TgCrypto/METADATA.toml @@ -1,2 +1,2 @@ version = "1.2.*" -upstream_repository = "https://github.com/pyrogram/tgcrypto" +upstream-repository = "https://github.com/pyrogram/tgcrypto" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WTForms/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/WTForms/METADATA.toml index a7a4b3a1a41c..62e6a60d86ce 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/WTForms/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/WTForms/METADATA.toml @@ -1,3 +1,3 @@ version = "~= 3.2.1" -upstream_repository = "https://github.com/pallets-eco/wtforms" -requires = ["MarkupSafe"] +upstream-repository = "https://github.com/pallets-eco/wtforms" +dependencies = ["MarkupSafe"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WTForms/wtforms/fields/choices.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WTForms/wtforms/fields/choices.pyi index 06f160738fb2..81a7a6b70575 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/WTForms/wtforms/fields/choices.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/WTForms/wtforms/fields/choices.pyi @@ -46,7 +46,7 @@ class SelectFieldBase(Field): class SelectField(SelectFieldBase): coerce: Callable[[Any], Any] - choices: list[_Choice] | _GroupedChoices + choices: Sequence[_Choice] | _GroupedChoices | None validate_choice: bool def __init__( self, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/METADATA.toml index b3a8d04dff57..ada90c3cf66c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/METADATA.toml @@ -1,2 +1,2 @@ version = "1.8.*" -upstream_repository = "https://github.com/Pylons/webob" +upstream-repository = "https://github.com/Pylons/webob" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/_types.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/_types.pyi index 08fdc54b3dd6..90cd26e1f24f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/_types.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/_types.pyi @@ -1,10 +1,11 @@ -from typing import Protocol, TypeVar, overload +from typing import Protocol, TypeVar, overload, type_check_only from typing_extensions import TypeAlias _T = TypeVar("_T") _GetterReturnType_co = TypeVar("_GetterReturnType_co", covariant=True) _SetterValueType_contra = TypeVar("_SetterValueType_contra", contravariant=True) +@type_check_only class AsymmetricProperty(Protocol[_GetterReturnType_co, _SetterValueType_contra]): @overload def __get__(self, obj: None, type: type[object] | None = ..., /) -> property: ... @@ -12,6 +13,7 @@ class AsymmetricProperty(Protocol[_GetterReturnType_co, _SetterValueType_contra] def __get__(self, obj: object, type: type[object] | None = ..., /) -> _GetterReturnType_co: ... def __set__(self, obj: object, value: _SetterValueType_contra, /) -> None: ... +@type_check_only class AsymmetricPropertyWithDelete( AsymmetricProperty[_GetterReturnType_co, _SetterValueType_contra], Protocol[_GetterReturnType_co, _SetterValueType_contra] ): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/request.pyi index 310c2101ce98..42f31a15ba94 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/request.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/request.pyi @@ -203,7 +203,7 @@ class LegacyRequest(BaseRequest): def uscript_name(self) -> str: ... @uscript_name.setter def uscript_name(self, value: str) -> None: ... - @property # type:ignore[override] + @property # type: ignore[override] def upath_info(self) -> str: ... @upath_info.setter def upath_info(self, value: str) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/METADATA.toml index e3119727954b..c990b4bf835f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/METADATA.toml @@ -1,6 +1,6 @@ version = "25.1.*" -upstream_repository = "https://github.com/Tinche/aiofiles" +upstream-repository = "https://github.com/Tinche/aiofiles" [tool.stubtest] # linux and darwin are equivalent -ci_platforms = ["linux", "win32"] +ci-platforms = ["linux", "win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/__init__.pyi index 71d2f47024ac..51cb1d2fd8bd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/aiofiles/aiofiles/threadpool/__init__.pyi @@ -9,7 +9,8 @@ from _typeshed import ( from asyncio import AbstractEventLoop from collections.abc import Callable from concurrent.futures import Executor -from typing import Literal, overload +from functools import _SingleDispatchCallable +from typing import Any, Literal, overload from typing_extensions import TypeAlias from ..base import AiofilesContextManager @@ -98,6 +99,8 @@ def open( executor: Executor | None = None, ) -> AiofilesContextManager[_UnknownAsyncBinaryIO]: ... +wrap: _SingleDispatchCallable[Any] + stdin: AsyncTextIndirectIOWrapper stdout: AsyncTextIndirectIOWrapper stderr: AsyncTextIndirectIOWrapper diff --git a/packages/pyright-internal/typeshed-fallback/stubs/antlr4-python3-runtime/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/antlr4-python3-runtime/METADATA.toml index 8fc5b261fb0c..65d20d6ee09d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/antlr4-python3-runtime/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/antlr4-python3-runtime/METADATA.toml @@ -1,5 +1,5 @@ version = "4.13.*" -upstream_repository = "https://github.com/antlr/antlr4" +upstream-repository = "https://github.com/antlr/antlr4" [tool.stubtest] -ci_platforms = ["linux", "win32"] +ci-platforms = ["linux", "win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/antlr4-python3-runtime/antlr4/ParserRuleContext.pyi b/packages/pyright-internal/typeshed-fallback/stubs/antlr4-python3-runtime/antlr4/ParserRuleContext.pyi index ba07bd5fbe72..37d5b6c9d36c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/antlr4-python3-runtime/antlr4/ParserRuleContext.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/antlr4-python3-runtime/antlr4/ParserRuleContext.pyi @@ -32,7 +32,7 @@ class ParserRuleContext(RuleContext): def getChild(self, i: int, ttype: type[_GenericType] | None = None) -> _GenericType | None: ... def getChildren( self, predicate: Callable[[ParseTree | TerminalNode], bool] | None = None - ) -> Generator[ParseTree | TerminalNode, None, None]: ... + ) -> Generator[ParseTree | TerminalNode]: ... def getToken(self, ttype: int, i: int) -> TerminalNode | None: ... def getTokens(self, ttype: int) -> list[TerminalNode]: ... def getTypedRuleContext(self, ctxType: type[_ParserRuleContextT], i: int) -> _ParserRuleContextT | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/antlr4-python3-runtime/antlr4/RuleContext.pyi b/packages/pyright-internal/typeshed-fallback/stubs/antlr4-python3-runtime/antlr4/RuleContext.pyi index 925e2f9fab3d..4edbedb1e6d7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/antlr4-python3-runtime/antlr4/RuleContext.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/antlr4-python3-runtime/antlr4/RuleContext.pyi @@ -25,7 +25,7 @@ class RuleContext(RuleNode): def setAltNumber(self, altNumber: int) -> None: ... def getChild(self, i: int) -> Any: ... def getChildCount(self) -> int: ... - def getChildren(self) -> Generator[Any, None, None]: ... + def getChildren(self) -> Generator[Any]: ... def accept(self, visitor: ParseTreeVisitor) -> None: ... def toStringTree(self, ruleNames: list[str] | None = None, recog: Recognizer | None = None) -> str: ... def toString(self, ruleNames: list[str], stop: RuleContext) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/assertpy/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/assertpy/METADATA.toml index 548b8958cc26..506bfdd1124b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/assertpy/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/assertpy/METADATA.toml @@ -1,2 +1,2 @@ version = "1.1.*" -upstream_repository = "https://github.com/assertpy/assertpy" +upstream-repository = "https://github.com/assertpy/assertpy" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/atheris/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/atheris/METADATA.toml index a99a31584640..bab88d8adf00 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/atheris/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/atheris/METADATA.toml @@ -1,6 +1,6 @@ version = "3.0.*" -upstream_repository = "https://github.com/google/atheris" -partial_stub = true +upstream-repository = "https://github.com/google/atheris" +partial-stub = true [tool.stubtest] -ignore_missing_stub = true +ignore-missing-stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/auth0-python/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/auth0-python/METADATA.toml index 4e1606df7422..ca72bbfc9705 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/auth0-python/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/auth0-python/METADATA.toml @@ -1,3 +1,3 @@ version = "4.10.*" -upstream_repository = "https://github.com/auth0/auth0-python" -requires = ["cryptography", "types-requests"] +upstream-repository = "https://github.com/auth0/auth0-python" +dependencies = ["cryptography", "types-requests"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/METADATA.toml index 9dc0897df2d1..015cbb61e4a0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/aws-xray-sdk/METADATA.toml @@ -1,2 +1,2 @@ version = "2.15.*" -upstream_repository = "https://github.com/aws/aws-xray-sdk-python" +upstream-repository = "https://github.com/aws/aws-xray-sdk-python" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/behave/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/behave/METADATA.toml new file mode 100644 index 000000000000..937f37b750e4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/behave/METADATA.toml @@ -0,0 +1,6 @@ +version = "1.3.*" +upstream-repository = "https://github.com/behave/behave" +partial-stub = true + +[tool.stubtest] +ignore-missing-stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/behave/behave/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/behave/behave/__init__.pyi new file mode 100644 index 000000000000..70422a43ef94 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/behave/behave/__init__.pyi @@ -0,0 +1,13 @@ +from behave.fixture import fixture as fixture, use_fixture as use_fixture +from behave.step_registry import ( + Given as Given, + Step as Step, + Then as Then, + When as When, + given as given, + step as step, + then as then, + when as when, +) + +__all__ = ["given", "when", "then", "step", "Given", "When", "Then", "Step", "use_fixture", "fixture"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/behave/behave/fixture.pyi b/packages/pyright-internal/typeshed-fallback/stubs/behave/behave/fixture.pyi new file mode 100644 index 000000000000..b7a257847a1b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/behave/behave/fixture.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete +from collections.abc import Callable +from typing import Any, Concatenate, ParamSpec, TypeVar + +from behave.runner import Context + +_T = TypeVar("_T") +_F = TypeVar("_F", bound=Callable[..., Any]) +_P = ParamSpec("_P") + +def use_fixture( + fixture_func: Callable[Concatenate[Context, _P], _T], context: Context, *fixture_args: _P.args, **fixture_kwargs: _P.kwargs +) -> _T: ... +def fixture(func: _F | None = None, name: str | None = None, pattern: str | None = None) -> _F: ... +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/behave/behave/runner.pyi b/packages/pyright-internal/typeshed-fallback/stubs/behave/behave/runner.pyi new file mode 100644 index 000000000000..a3abfa2d0de2 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/behave/behave/runner.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete +from collections.abc import Callable +from contextlib import AbstractContextManager +from typing import ClassVar, ParamSpec + +_P = ParamSpec("_P") + +class Context: + LAYER_NAMES: ClassVar[list[str]] + FAIL_ON_CLEANUP_ERRORS: ClassVar[bool] + + feature: Incomplete | None + scenario: Incomplete + tags: set[str] + aborted: bool + failed: bool + table: Incomplete | None + text: str | None + config: Incomplete + active_outline: Incomplete + fail_on_cleanup_errors: bool + + def __init__(self, runner) -> None: ... + def __getattr__(self, name: str) -> Incomplete: ... + def __setattr__(self, name: str, value) -> None: ... + def __delattr__(self, name: str) -> None: ... + def __contains__(self, name: str) -> bool: ... + def abort(self, reason: str | None = None) -> None: ... + def use_or_assign_param(self, name: str, value): ... + def use_or_create_param(self, name: str, factory_func: Callable[_P, Incomplete], *args: _P.args, **kwargs: _P.kwargs): ... + def use_with_user_mode(self) -> AbstractContextManager[None]: ... + def execute_steps(self, steps_text: str) -> bool: ... + def add_cleanup(self, cleanup_func: Callable[_P, Incomplete], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + @property + def captured(self): ... + def attach(self, mime_type: str, data: bytes) -> None: ... + +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/behave/behave/step_registry.pyi b/packages/pyright-internal/typeshed-fallback/stubs/behave/behave/step_registry.pyi new file mode 100644 index 000000000000..9b0237896c3d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/behave/behave/step_registry.pyi @@ -0,0 +1,20 @@ +from _typeshed import Incomplete +from collections.abc import Callable +from typing import Concatenate, TypeVar + +from behave.runner import Context + +_F = TypeVar("_F", bound=Callable[Concatenate[Context, ...], None]) + +def given(step_text: str, **kwargs) -> Callable[[_F], _F]: ... +def when(step_text: str, **kwargs) -> Callable[[_F], _F]: ... +def then(step_text: str, **kwargs) -> Callable[[_F], _F]: ... +def step(step_text: str, **kwargs) -> Callable[[_F], _F]: ... + +# Title-case aliases +Given = given +When = when +Then = then +Step = step + +def __getattr__(name: str) -> Incomplete: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/binaryornot/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/binaryornot/METADATA.toml index bc45896c1a04..3146145847b8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/binaryornot/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/binaryornot/METADATA.toml @@ -1,2 +1,3 @@ version = "0.4.*" -upstream_repository = "https://github.com/binaryornot/binaryornot" +upstream-repository = "https://github.com/binaryornot/binaryornot" +obsolete-since = "0.5.0" # Released on 2026-03-07 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/bleach/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/bleach/METADATA.toml index 38c7fd7b5c4d..827e1197d332 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/bleach/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/bleach/METADATA.toml @@ -1,6 +1,6 @@ version = "6.3.*" -requires = ["types-html5lib"] -upstream_repository = "https://github.com/mozilla/bleach" +dependencies = ["types-html5lib"] +upstream-repository = "https://github.com/mozilla/bleach" [tool.stubtest] extras = ["css"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/html5lib_shim.pyi b/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/html5lib_shim.pyi index 1904b538e8dd..d781faa9c7bb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/html5lib_shim.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/bleach/bleach/html5lib_shim.pyi @@ -62,8 +62,8 @@ class BleachHTMLParser(HTMLParser): class BleachHTMLSerializer(HTMLSerializer): escape_rcdata: bool - def escape_base_amp(self, stoken: str) -> Generator[str, None, None]: ... - def serialize(self, treewalker: TreeWalker, encoding: str | None = None) -> Generator[str, None, None]: ... # type: ignore[override] + def escape_base_amp(self, stoken: str) -> Generator[str]: ... + def serialize(self, treewalker: TreeWalker, encoding: str | None = None) -> Generator[str]: ... # type: ignore[override] def convert_entity(value: str) -> str | None: ... def convert_entities(text: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boltons/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/boltons/METADATA.toml index ffd472f488d7..829db8486880 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boltons/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/boltons/METADATA.toml @@ -1,2 +1,2 @@ version = "25.0.*" -upstream_repository = "https://github.com/mahmoud/boltons" +upstream-repository = "https://github.com/mahmoud/boltons" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/cacheutils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/cacheutils.pyi index 40e786e61bd8..8bea29a8b538 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/cacheutils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/cacheutils.pyi @@ -125,9 +125,9 @@ class ThresholdCounter(Generic[_T]): def __contains__(self, key: _T) -> bool: ... def iterkeys(self) -> Iterator[_T]: ... def keys(self) -> list[_T]: ... - def itervalues(self) -> Generator[int, None, None]: ... + def itervalues(self) -> Generator[int]: ... def values(self) -> list[int]: ... - def iteritems(self) -> Generator[tuple[_T, int], None, None]: ... + def iteritems(self) -> Generator[tuple[_T, int]]: ... def items(self) -> list[tuple[_T, int]]: ... def get(self, key: _T, default: int = 0) -> int: ... def update(self, iterable: Iterable[_T] | Mapping[_T, int], **kwargs: Iterable[_T] | Mapping[_T, int]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/dictutils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/dictutils.pyi index 5e609ef9af13..c257fd9b655f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/dictutils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/dictutils.pyi @@ -22,9 +22,9 @@ class OrderedMultiDict(dict[_KT, _VT]): def getlist(self, k: _KT, default: list[_VT] = ...) -> list[_VT]: ... def inverted(self) -> Self: ... def items(self, multi: bool = False) -> list[tuple[_KT, _VT]]: ... # type: ignore[override] - def iteritems(self, multi: bool = False) -> Generator[tuple[_KT, _VT], None, None]: ... - def iterkeys(self, multi: bool = False) -> Generator[_KT, None, None]: ... - def itervalues(self, multi: bool = False) -> Generator[_VT, None, None]: ... + def iteritems(self, multi: bool = False) -> Generator[tuple[_KT, _VT]]: ... + def iterkeys(self, multi: bool = False) -> Generator[_KT]: ... + def itervalues(self, multi: bool = False) -> Generator[_VT]: ... def keys(self, multi: bool = False) -> list[_KT]: ... # type: ignore[override] def pop(self, k: _KT, default: _VT = ...) -> _VT: ... # type: ignore[override] def popall(self, k: _KT, default: _VT = ...) -> list[_VT]: ... @@ -47,8 +47,8 @@ OMD: TypeAlias = OrderedMultiDict[_KT, _VT] MultiDict: TypeAlias = OrderedMultiDict[_KT, _VT] class FastIterOrderedMultiDict(OrderedMultiDict[_KT, _VT]): # undocumented - def iteritems(self, multi: bool = False) -> Generator[tuple[_KT, _VT], None, None]: ... - def iterkeys(self, multi: bool = False) -> Generator[_KT, None, None]: ... + def iteritems(self, multi: bool = False) -> Generator[tuple[_KT, _VT]]: ... + def iterkeys(self, multi: bool = False) -> Generator[_KT]: ... class OneToOne(dict[_KT, _VT]): __slots__ = ("inv",) @@ -77,7 +77,7 @@ class ManyToMany(dict[_KT, frozenset[_VT]]): def __setitem__(self, key: _KT, vals: Iterable[_VT]) -> None: ... def add(self, key: _KT, val: _VT) -> None: ... def get(self, key: _KT, default: frozenset[_VT] = ...) -> frozenset[_VT]: ... # type: ignore[override] - def iteritems(self) -> Generator[tuple[_KT, _VT], None, None]: ... + def iteritems(self) -> Generator[tuple[_KT, _VT]]: ... def keys(self): ... def remove(self, key: _KT, val: _VT) -> None: ... def replace(self, key: _KT, newkey: _KT) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/fileutils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/fileutils.pyi index 1cf22af892e7..8d3bd1882118 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/fileutils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/fileutils.pyi @@ -51,7 +51,7 @@ def iter_find_files( ignored: str | Iterable[str] | None = None, include_dirs: bool = False, max_depth: int | None = None, -) -> Generator[str, None, None]: ... +) -> Generator[str]: ... @overload def copy_tree( src: _StrPathT, dst: _StrPathT, symlinks: bool = False, ignore: Callable[[_StrPathT, list[str]], Iterable[str]] | None = None diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/iterutils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/iterutils.pyi index ba1b7dd0293c..0c16dfa66e59 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/iterutils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/iterutils.pyi @@ -7,24 +7,24 @@ def is_collection(obj) -> bool: ... def split(src, sep=None, maxsplit=None): ... def split_iter(src, sep=None, maxsplit=None) -> Generator[Incomplete, None, Incomplete]: ... def lstrip(iterable, strip_value=None): ... -def lstrip_iter(iterable, strip_value=None) -> Generator[Incomplete, None, None]: ... +def lstrip_iter(iterable, strip_value=None) -> Generator[Incomplete]: ... def rstrip(iterable, strip_value=None): ... -def rstrip_iter(iterable, strip_value=None) -> Generator[Incomplete, None, None]: ... +def rstrip_iter(iterable, strip_value=None) -> Generator[Incomplete]: ... def strip(iterable, strip_value=None): ... def strip_iter(iterable, strip_value=None): ... def chunked(src, size, count=None, **kw): ... def chunked_iter(src, size, **kw) -> Generator[Incomplete, None, Incomplete]: ... def chunk_ranges( input_size: int, chunk_size: int, input_offset: int = 0, overlap_size: int = 0, align: bool = False -) -> Generator[tuple[int, int], None, None]: ... +) -> Generator[tuple[int, int]]: ... def pairwise(src, end=...): ... def pairwise_iter(src, end=...): ... def windowed(src, size, fill=...): ... def windowed_iter(src, size, fill=...): ... -def xfrange(stop, start=None, step: float = 1.0) -> Generator[Incomplete, None, None]: ... +def xfrange(stop, start=None, step: float = 1.0) -> Generator[Incomplete]: ... def frange(stop, start=None, step: float = 1.0): ... def backoff(start, stop, count=None, factor: float = 2.0, jitter: bool = False): ... -def backoff_iter(start, stop, count=None, factor: float = 2.0, jitter: bool = False) -> Generator[Incomplete, None, None]: ... +def backoff_iter(start, stop, count=None, factor: float = 2.0, jitter: bool = False) -> Generator[Incomplete]: ... def bucketize(src, key=..., value_transform=None, key_filter=None): ... def partition(src, key=...): ... def unique(src, key=None): ... @@ -32,7 +32,7 @@ def unique_iter(src, key=None) -> Generator[Incomplete, None, Incomplete]: ... def redundant(src, key=None, groups: bool = False): ... def one(src, default=None, key=None): ... def first(iterable, default=None, key=None): ... -def flatten_iter(iterable) -> Generator[Incomplete, None, None]: ... +def flatten_iter(iterable) -> Generator[Incomplete]: ... def flatten(iterable): ... def same(iterable, ref=...): ... def default_visit(path, key, value): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/jsonutils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/jsonutils.pyi index 0cc1bf7a46dd..276db26ef881 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/jsonutils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/jsonutils.pyi @@ -5,13 +5,11 @@ from typing_extensions import Self @overload def reverse_iter_lines( file_obj: IO[bytes], blocksize: int = 4096, preseek: bool = True, encoding: None = None -) -> Generator[bytes, None, None]: ... +) -> Generator[bytes]: ... @overload -def reverse_iter_lines( - file_obj: IO[str], blocksize: int = 4096, preseek: bool = True, *, encoding: str -) -> Generator[str, None, None]: ... +def reverse_iter_lines(file_obj: IO[str], blocksize: int = 4096, preseek: bool = True, *, encoding: str) -> Generator[str]: ... @overload -def reverse_iter_lines(file_obj: IO[str], blocksize: int, preseek: bool, encoding: str) -> Generator[str, None, None]: ... +def reverse_iter_lines(file_obj: IO[str], blocksize: int, preseek: bool, encoding: str) -> Generator[str]: ... class JSONLIterator: ignore_errors: bool diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/setutils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/setutils.pyi index d86104518841..a72e050a477c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/setutils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/setutils.pyi @@ -17,7 +17,7 @@ class IndexedSet(MutableSet[Any]): def __len__(self) -> int: ... def __contains__(self, item: Any) -> bool: ... def __iter__(self) -> Iterator[Any]: ... - def __reversed__(self) -> Generator[Any, None, None]: ... + def __reversed__(self) -> Generator[Any]: ... @classmethod def from_iterable(cls, it: Iterable[Any]) -> Self: ... def add(self, item: Any) -> None: ... @@ -28,9 +28,9 @@ class IndexedSet(MutableSet[Any]): def issubset(self, other: Collection[Any]) -> bool: ... def issuperset(self, other: Collection[Any]) -> bool: ... def union(self, *others: Iterable[Any]) -> Self: ... - def iter_intersection(self, *others: Container[Any]) -> Generator[Any, None, None]: ... + def iter_intersection(self, *others: Container[Any]) -> Generator[Any]: ... def intersection(self, *others: Container[Any]) -> Self: ... - def iter_difference(self, *others: Iterable[Any]) -> Generator[Any, None, None]: ... + def iter_difference(self, *others: Iterable[Any]) -> Generator[Any]: ... def difference(self, *others: Iterable[Any]) -> Self: ... def symmetric_difference(self, *others: Container[Any]) -> Self: ... # __or__ = union diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/strutils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/strutils.pyi index 0719a4beb3e7..92aaf63cac68 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/strutils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/strutils.pyi @@ -42,7 +42,7 @@ class HTMLTextExtractor(HTMLParser): def html2text(html: str) -> str: ... def gunzip_bytes(bytestring: ReadableBuffer) -> bytes: ... def gzip_bytes(bytestring: ReadableBuffer, level: int = 6) -> int: ... -def iter_splitlines(text: str) -> Generator[str, None, None]: ... +def iter_splitlines(text: str) -> Generator[str]: ... def indent(text: str, margin: str, newline: str = "\n", key: Callable[[str], bool] = ...) -> str: ... def is_uuid(obj, version: int = 4) -> bool: ... def escape_shell_args(args: Iterable[str], sep: str = " ", style: Literal["cmd", "sh"] | None = None) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/timeutils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/timeutils.pyi index 68ab72b1a765..7416be362361 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/timeutils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/boltons/boltons/timeutils.pyi @@ -14,7 +14,7 @@ def decimal_relative_time( ) -> tuple[float, str]: ... def relative_time(d: datetime, other: datetime | None = None, ndigits: int = 0) -> str: ... def strpdate(string: str, format: str) -> date: ... -def daterange(start: date, stop: date, step: int = 1, inclusive: bool = False) -> Generator[date, None, None]: ... +def daterange(start: date, stop: date, step: int = 1, inclusive: bool = False) -> Generator[date]: ... ZERO: timedelta HOUR: timedelta diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/braintree/METADATA.toml index b9a6efe6e027..5a102b9ffc6f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/METADATA.toml @@ -1,2 +1,2 @@ version = "4.42.*" -upstream_repository = "https://github.com/braintree/braintree_python" +upstream-repository = "https://github.com/braintree/braintree_python" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/paginated_collection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/paginated_collection.pyi index 08cb89880d6d..f370775e7db2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/paginated_collection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/paginated_collection.pyi @@ -4,5 +4,5 @@ from collections.abc import Generator class PaginatedCollection: def __init__(self, method) -> None: ... @property - def items(self) -> Generator[Incomplete, None, None]: ... + def items(self) -> Generator[Incomplete]: ... def __iter__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/resource_collection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/resource_collection.pyi index 5aeb21a710de..80b32c2f77b3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/resource_collection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/braintree/braintree/resource_collection.pyi @@ -8,7 +8,7 @@ class ResourceCollection: @property def first(self): ... @property - def items(self) -> Generator[Incomplete, None, None]: ... + def items(self) -> Generator[Incomplete]: ... @property def ids(self): ... def __iter__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cachetools/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/cachetools/METADATA.toml index 70052083c405..11f301c967c2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/cachetools/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/cachetools/METADATA.toml @@ -1,2 +1,2 @@ version = "6.2.*" -upstream_repository = "https://github.com/tkem/cachetools" +upstream-repository = "https://github.com/tkem/cachetools" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cachetools/cachetools/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cachetools/cachetools/__init__.pyi index 8adfb544c640..6c8d0d8f4500 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/cachetools/cachetools/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/cachetools/cachetools/__init__.pyi @@ -2,7 +2,7 @@ from _typeshed import IdentityFunction, Unused from collections.abc import Callable, Iterator, MutableMapping, Sequence from contextlib import AbstractContextManager from threading import Condition -from typing import Any, Generic, Literal, NamedTuple, TypeVar, overload +from typing import Any, Generic, Literal, NamedTuple, TypeVar, overload, type_check_only from typing_extensions import Self, deprecated __all__ = ("Cache", "FIFOCache", "LFUCache", "LRUCache", "RRCache", "TLRUCache", "TTLCache", "cached", "cachedmethod") @@ -106,10 +106,12 @@ class _CacheInfo(NamedTuple): maxsize: int | None currsize: int +@type_check_only class _cached_wrapper(Generic[_R]): __wrapped__: Callable[..., _R] def __call__(self, /, *args: Any, **kwargs: Any) -> _R: ... +@type_check_only class _cached_wrapper_info(_cached_wrapper[_R]): def cache_info(self) -> _CacheInfo: ... def cache_clear(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cachetools/cachetools/func.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cachetools/cachetools/func.pyi index 0480334ffe19..b730e9bd1cdc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/cachetools/cachetools/func.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/cachetools/cachetools/func.pyi @@ -1,17 +1,14 @@ from collections.abc import Callable, Sequence -from typing import Any, Final, Generic, NamedTuple, TypeVar, overload +from typing import Any, Final, Generic, TypeVar, overload, type_check_only + +from . import _CacheInfo __all__: Final = ("fifo_cache", "lfu_cache", "lru_cache", "rr_cache", "ttl_cache") _T = TypeVar("_T") _R = TypeVar("_R") -class _CacheInfo(NamedTuple): - hits: int - misses: int - maxsize: int | None - currsize: int - +@type_check_only class _cachetools_cache_wrapper(Generic[_R]): __wrapped__: Callable[..., _R] def __call__(self, /, *args: Any, **kwargs: Any) -> _R: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/capturer/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/capturer/METADATA.toml index 01ed91c42370..a64fd3f58135 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/capturer/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/capturer/METADATA.toml @@ -1,2 +1,2 @@ version = "3.0.*" -upstream_repository = "https://github.com/xolox/python-capturer" +upstream-repository = "https://github.com/xolox/python-capturer" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/cffi/METADATA.toml index abf41186a33b..b42e584ae0b2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/cffi/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/METADATA.toml @@ -1,7 +1,7 @@ -version = "1.17.*" -upstream_repository = "https://github.com/python-cffi/cffi/" -requires = ["types-setuptools"] +version = "2.0.*" +upstream-repository = "https://github.com/python-cffi/cffi/" +dependencies = ["types-setuptools"] [tool.stubtest] # linux and darwin are mostly equivalent, except for a single `RTLD_DEEPBIND` variable -ci_platforms = ["linux", "win32"] +ci-platforms = ["linux", "win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/api.pyi index 07e9ffccab35..7280934df776 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/api.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/api.pyi @@ -43,7 +43,7 @@ class FFI: free: Callable[[CData], Any] | None = None, should_clear_after_alloc: bool = True, ) -> _cffi_backend._Allocator: ... - def cast(self, cdecl: str | CType, source: CData | int) -> CData: ... + def cast(self, cdecl: str | CType, source: CData | float) -> CData: ... def string(self, cdata: CData, maxlen: int = -1) -> bytes | str: ... def unpack(self, cdata: CData, length: int) -> bytes | str | list[Any]: ... @overload diff --git a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/model.pyi b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/model.pyi index 5a4e7cc82f19..48a03c2dcea9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/model.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/cffi/cffi/model.pyi @@ -124,8 +124,8 @@ class StructOrUnion(StructOrUnionOrEnum): fldbitsize: Incomplete fldquals: Incomplete def __init__(self, name, fldnames, fldtypes, fldbitsize, fldquals=None) -> None: ... - def anonymous_struct_fields(self) -> Generator[StructOrUnion, None, None]: ... - def enumfields(self, expand_anonymous_struct_union: bool = True) -> Generator[Incomplete, None, None]: ... + def anonymous_struct_fields(self) -> Generator[StructOrUnion]: ... + def enumfields(self, expand_anonymous_struct_union: bool = True) -> Generator[Incomplete]: ... def force_flatten(self) -> None: ... def get_cached_btype(self, ffi, finishlist, can_delay: bool = False): ... def finish_backend_type(self, ffi, finishlist) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/channels/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/channels/METADATA.toml index 8cd561ad6b15..cc2d2a599826 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/channels/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/channels/METADATA.toml @@ -1,8 +1,8 @@ version = "4.3.*" -upstream_repository = "https://github.com/django/channels" -requires = ["django-stubs>=4.2,<5.3", "asgiref"] +upstream-repository = "https://github.com/django/channels" +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"] +mypy-plugins = ['mypy_django_plugin.main'] +mypy-plugins-config = {"django-stubs" = {"django_settings_module" = "@tests.django_settings"}} +stubtest-dependencies = ["daphne"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/channels/channels/consumer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/channels/channels/consumer.pyi index 66a1ba0df89d..d48e679c923b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/channels/channels/consumer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/channels/channels/consumer.pyi @@ -3,7 +3,6 @@ from typing import Any, ClassVar, Protocol, TypedDict, type_check_only from asgiref.typing import ASGIReceiveCallable, ASGISendCallable, Scope, WebSocketScope from channels.auth import UserLazyObject -from channels.db import database_sync_to_async from channels.layers import BaseChannelLayer from django.contrib.sessions.backends.base import SessionBase from django.utils.functional import LazyObject @@ -70,6 +69,5 @@ class SyncConsumer(AsyncConsumer): # Since we're overriding asynchronous methods with synchronous ones, # we need to use `# type: ignore[override]` to suppress mypy errors. - @database_sync_to_async - def dispatch(self, message: dict[str, Any]) -> None: ... # type: ignore[override] + async def dispatch(self, message: dict[str, Any]) -> None: ... # type: ignore[override] def send(self, message: dict[str, Any]) -> None: ... # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/chevron/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/chevron/METADATA.toml index 10bcb5ccb4b7..83c82dbd7688 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/chevron/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/chevron/METADATA.toml @@ -1,4 +1,4 @@ version = "0.14.*" -upstream_repository = "https://github.com/noahmorrison/chevron" +upstream-repository = "https://github.com/noahmorrison/chevron" [tool.stubtest] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/click-default-group/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/click-default-group/METADATA.toml index 713e657a8635..d59ab76ab915 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/click-default-group/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/click-default-group/METADATA.toml @@ -1,4 +1,4 @@ version = "1.2.*" -upstream_repository = "https://github.com/click-contrib/click-default-group" +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/packages/pyright-internal/typeshed-fallback/stubs/click-log/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/click-log/METADATA.toml index c1548cdc2f5b..b0192b0669d0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/click-log/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/click-log/METADATA.toml @@ -1,3 +1,3 @@ version = "0.4.*" -requires = ["click>=8.0.0"] -upstream_repository = "https://github.com/click-contrib/click-log" +dependencies = ["click>=8.0.0"] +upstream-repository = "https://github.com/click-contrib/click-log" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/click-shell/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/click-shell/METADATA.toml index 630e551b1266..6d8aa15caf14 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/click-shell/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/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"] +upstream-repository = "https://github.com/clarkperkins/click-shell" +dependencies = ["click>=8.0.0"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/click-spinner/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/click-spinner/METADATA.toml index 7360ba2d2993..d9a2e7307af8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/click-spinner/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/click-spinner/METADATA.toml @@ -1,2 +1,2 @@ version = "0.1.*" -upstream_repository = "https://github.com/click-contrib/click-spinner" +upstream-repository = "https://github.com/click-contrib/click-spinner" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/click-web/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/click-web/METADATA.toml index 1f42748d42a5..a0ef4e108b51 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/click-web/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/click-web/METADATA.toml @@ -1,3 +1,3 @@ version = "0.8.*" -requires = ["click>=8.0.0", "Flask>=2.3.2"] -upstream_repository = "https://github.com/fredrik-corneliusson/click-web" +dependencies = ["click>=8.0.0", "Flask>=2.3.2"] +upstream-repository = "https://github.com/fredrik-corneliusson/click-web" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/colorama/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/colorama/METADATA.toml index 980206462d55..42172a31b734 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/colorama/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/colorama/METADATA.toml @@ -1,5 +1,5 @@ version = "0.4.*" -upstream_repository = "https://github.com/tartley/colorama" +upstream-repository = "https://github.com/tartley/colorama" [tool.stubtest] -ci_platforms = ["linux", "win32"] +ci-platforms = ["linux", "win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/colorful/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/colorful/METADATA.toml index 251b9ed1e241..51d16a937052 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/colorful/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/colorful/METADATA.toml @@ -1,2 +1,2 @@ version = "0.5.*" -upstream_repository = "https://github.com/timofurrer/colorful" +upstream-repository = "https://github.com/timofurrer/colorful" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/METADATA.toml index 857d25a71759..dbaaa6fd0ec8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/METADATA.toml @@ -1,2 +1,2 @@ version = "0.8.*" -upstream_repository = "https://github.com/aegirhall/console-menu" +upstream-repository = "https://github.com/aegirhall/console-menu" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/menu_component.pyi b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/menu_component.pyi index 5c93621187dd..acaf5ccb754e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/menu_component.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/console-menu/consolemenu/menu_component.pyi @@ -24,7 +24,7 @@ class MenuComponent: def border_style(self) -> MenuBorderStyle: ... def calculate_border_width(self) -> int: ... def calculate_content_width(self) -> int: ... - def generate(self) -> Generator[str, None, None]: ... + def generate(self) -> Generator[str]: ... def inner_horizontals(self) -> str: ... def inner_horizontal_border(self) -> str: ... def outer_horizontals(self) -> str: ... @@ -48,7 +48,7 @@ class MenuHeader(MenuComponent): subtitle_align: str = "left", show_bottom_border: bool = False, ) -> None: ... - def generate(self) -> Generator[str, None, None]: ... + def generate(self) -> Generator[str]: ... class MenuTextSection(MenuComponent): text: str @@ -64,7 +64,7 @@ class MenuTextSection(MenuComponent): show_top_border: bool = False, show_bottom_border: bool = False, ) -> None: ... - def generate(self) -> Generator[str, None, None]: ... + def generate(self) -> Generator[str]: ... class MenuItemsSection(MenuComponent): items_align: str @@ -85,10 +85,10 @@ class MenuItemsSection(MenuComponent): def items_with_top_border(self) -> list[str]: ... def show_item_bottom_border(self, item_text: str, flag: bool) -> None: ... def show_item_top_border(self, item_text: str, flag: bool) -> None: ... - def generate(self) -> Generator[str, None, None]: ... + def generate(self) -> Generator[str]: ... class MenuFooter(MenuComponent): - def generate(self) -> Generator[str, None, None]: ... + def generate(self) -> Generator[str]: ... class MenuPrompt(MenuComponent): def __init__(self, menu_style: MenuStyle, max_dimension: Dimension | None = None, prompt_string: str = ">>") -> None: ... @@ -96,4 +96,4 @@ class MenuPrompt(MenuComponent): def prompt(self) -> str: ... @prompt.setter def prompt(self, prompt: str) -> None: ... - def generate(self) -> Generator[str, None, None]: ... + def generate(self) -> Generator[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/convertdate/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/convertdate/METADATA.toml index f8f016bb7ffb..4210dc427019 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/convertdate/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/convertdate/METADATA.toml @@ -1,2 +1,2 @@ version = "2.4.1" -upstream_repository = "https://github.com/fitnr/convertdate" +upstream-repository = "https://github.com/fitnr/convertdate" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/croniter/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/croniter/METADATA.toml index b0539637d669..529763bce322 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/croniter/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/croniter/METADATA.toml @@ -1,2 +1,2 @@ -version = "6.0.0" -upstream_repository = "https://github.com/pallets-eco/croniter" +version = "6.2.2" +upstream-repository = "https://github.com/pallets-eco/croniter" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/croniter/croniter/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/croniter/croniter/__init__.pyi index 97fa561af5c4..164f8b701f56 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/croniter/croniter/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/croniter/croniter/__init__.pyi @@ -20,3 +20,24 @@ from .croniter import ( ) cron_m = croniter_m + +__all__ = [ + "DAY_FIELD", + "HOUR_FIELD", + "MINUTE_FIELD", + "MONTH_FIELD", + "OVERFLOW32B_MODE", + "SECOND_FIELD", + "UTC_DT", + "YEAR_FIELD", + "CroniterBadCronError", + "CroniterBadDateError", + "CroniterBadTypeRangeError", + "CroniterError", + "CroniterNotAlphaError", + "CroniterUnsupportedSyntaxError", + "cron_m", + "croniter", + "croniter_range", + "datetime_to_timestamp", +] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/croniter/croniter/croniter.pyi b/packages/pyright-internal/typeshed-fallback/stubs/croniter/croniter/croniter.pyi index 7dd721ddbb2a..5966b6106171 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/croniter/croniter/croniter.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/croniter/croniter/croniter.pyi @@ -1,7 +1,6 @@ import datetime from _typeshed import Unused -from collections import OrderedDict -from collections.abc import Generator +from collections.abc import Generator, Iterable from re import Match, Pattern from typing import Any, Final, Generic, Literal, Protocol, TypeVar, overload, type_check_only from typing_extensions import Never, Self, TypeAlias @@ -9,6 +8,7 @@ from typing_extensions import Never, Self, TypeAlias _R_co = TypeVar("_R_co", float, datetime.datetime, default=float, covariant=True) _R2_co = TypeVar("_R2_co", float, datetime.datetime, covariant=True) _Expressions: TypeAlias = list[str] # fixed-length list of 5 or 6 strings +ExpandedExpression: TypeAlias = list[int | Literal["*", "l"]] @type_check_only class _AllIter(Protocol[_R_co]): @@ -45,10 +45,12 @@ YEAR_FIELDS: Final[tuple[int, int, int, int, int, int, int]] step_search_re: Final[Pattern[str]] only_int_re: Final[Pattern[str]] +DAYS: Final[tuple[int, int, int, int, int, int, int, int, int, int, int, int]] WEEKDAYS: Final[str] MONTHS: Final[str] star_or_int_re: Final[Pattern[str]] special_dow_re: Final[Pattern[str]] +nearest_weekday_re: Final[Pattern[str]] re_star: Final[Pattern[str]] hash_expression_re: Final[Pattern[str]] @@ -57,11 +59,8 @@ UNIX_CRON_LEN: Final = 5 SECOND_CRON_LEN: Final = 6 YEAR_CRON_LEN: Final = 7 VALID_LEN_EXPRESSION: Final[set[int]] -TIMESTAMP_TO_DT_CACHE: Final[dict[tuple[float, str], datetime.datetime]] -EXPRESSIONS: dict[tuple[str, bytes], _Expressions] MARKER: object -def timedelta_to_seconds(td: datetime.timedelta) -> float: ... def datetime_to_timestamp(d: datetime.datetime) -> float: ... class CroniterError(ValueError): ... @@ -78,22 +77,6 @@ class croniter(Generic[_R_co]): tuple[int, int], tuple[int, int], tuple[int, int], tuple[int, int], tuple[int, int], tuple[int, int], tuple[int, int] ] ] - DAYS: Final[ - tuple[ - Literal[31], - Literal[28], - Literal[31], - Literal[30], - Literal[31], - Literal[30], - Literal[31], - Literal[31], - Literal[30], - Literal[31], - Literal[30], - Literal[31], - ] - ] ALPHACONV: Final[ tuple[ dict[Never, Never], @@ -121,15 +104,15 @@ class croniter(Generic[_R_co]): second_at_beginning: bool tzinfo: datetime.tzinfo | None - # Initialized to None, but immediately set to a float. start_time: float dst_start_time: float cur: float expanded: list[list[str]] nth_weekday_of_month: dict[str, set[int]] - fields: tuple[int, ...] expressions: _Expressions + nearest_weekday: set[int] + fields: tuple[int, ...] @overload def __new__( @@ -142,7 +125,7 @@ class croniter(Generic[_R_co]): is_prev: bool = False, hash_id: str | bytes | None = None, implement_cron_bug: bool = False, - second_at_beginning: bool | None = None, + second_at_beginning: bool = False, expand_from_start_time: bool = False, ) -> croniter[float]: ... @overload @@ -156,7 +139,7 @@ class croniter(Generic[_R_co]): is_prev: bool = False, hash_id: str | bytes | None = None, implement_cron_bug: bool = False, - second_at_beginning: bool | None = None, + second_at_beginning: bool = False, expand_from_start_time: bool = False, ) -> croniter[datetime.datetime]: ... @overload @@ -170,7 +153,7 @@ class croniter(Generic[_R_co]): is_prev: bool = False, hash_id: str | bytes | None = None, implement_cron_bug: bool = False, - second_at_beginning: bool | None = None, + second_at_beginning: bool = False, expand_from_start_time: bool = False, ) -> croniter[datetime.datetime]: ... def __init__( @@ -183,7 +166,7 @@ class croniter(Generic[_R_co]): is_prev: bool = False, hash_id: str | bytes | None = None, implement_cron_bug: bool = False, - second_at_beginning: bool | None = None, + second_at_beginning: bool = False, expand_from_start_time: bool = False, ) -> None: ... @overload @@ -210,8 +193,6 @@ class croniter(Generic[_R_co]): @staticmethod def datetime_to_timestamp(d: datetime.datetime) -> float: ... def timestamp_to_datetime(self, timestamp: float, tzinfo: datetime.tzinfo | None = ...) -> datetime.datetime: ... - @staticmethod - def timedelta_to_seconds(td: datetime.timedelta) -> float: ... @overload def all_next( self, ret_type: type[_R2_co], start_time: float | datetime.datetime | None = None, update_current: bool | None = None @@ -247,8 +228,6 @@ class croniter(Generic[_R_co]): update_current: bool | None = None, ) -> _R_co: ... __next__ = next - @staticmethod - def is_leap(year: int) -> bool: ... @classmethod def value_alias( cls, @@ -256,6 +235,7 @@ class croniter(Generic[_R_co]): field_index: Literal[0, 1, 2, 3, 4, 5, 6], len_expressions: int | list[Any] | dict[Any, Any] | tuple[Any, ...] | set[Any] = 5, ) -> int: ... + DAYS_IN_MONTH: Final[dict[int, int]] @classmethod def expand( cls, @@ -263,10 +243,18 @@ class croniter(Generic[_R_co]): hash_id: bytes | None = None, second_at_beginning: bool = False, from_timestamp: float | None = None, - ) -> tuple[list[list[str]], dict[str, set[int]]]: ... + strict: bool = False, + strict_year: int | Iterable[int] | None = None, + ) -> tuple[list[ExpandedExpression], dict[str, set[int]]]: ... @classmethod def is_valid( - cls, expression: str, hash_id: bytes | None = None, encoding: str = "UTF-8", second_at_beginning: bool = False + cls, + expression: str, + hash_id: bytes | None = None, + encoding: str = "UTF-8", + second_at_beginning: bool = False, + strict: bool = False, + strict_year: int | Iterable[int] | None = None, ) -> bool: ... @classmethod def match( @@ -275,6 +263,7 @@ class croniter(Generic[_R_co]): testdate: float | datetime.datetime | None, day_or: bool = True, second_at_beginning: bool = False, + precision_in_seconds: int | None = None, ) -> bool: ... @classmethod def match_range( @@ -284,6 +273,7 @@ class croniter(Generic[_R_co]): to_datetime: datetime.datetime, day_or: bool = True, second_at_beginning: bool = False, + precision_in_seconds: int | None = None, ) -> bool: ... @overload @@ -297,7 +287,7 @@ def croniter_range( _croniter: type[croniter] | None = None, second_at_beginning: bool = False, expand_from_start_time: bool = False, -) -> Generator[_R2_co, None, None]: ... +) -> Generator[_R2_co]: ... @overload def croniter_range( start: float, @@ -309,7 +299,7 @@ def croniter_range( _croniter: type[croniter] | None = None, second_at_beginning: bool = False, expand_from_start_time: bool = False, -) -> Generator[float, None, None]: ... +) -> Generator[float]: ... @overload def croniter_range( start: datetime.datetime, @@ -321,7 +311,7 @@ def croniter_range( _croniter: type[croniter] | None = None, second_at_beginning: bool = False, expand_from_start_time: bool = False, -) -> Generator[datetime.datetime, None, None]: ... +) -> Generator[datetime.datetime]: ... class HashExpander: cron: croniter @@ -354,4 +344,4 @@ class HashExpander: **kw: object, ) -> str: ... -EXPANDERS: OrderedDict[str, HashExpander] +EXPANDERS: dict[str, type[HashExpander]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/datauri/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/datauri/METADATA.toml index e1a37a722126..1c6aeddc2a16 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/datauri/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/datauri/METADATA.toml @@ -1,2 +1,2 @@ version = "1.1.*" -upstream_repository = "https://github.com/eclecticiq/python-data-uri" +upstream-repository = "https://github.com/eclecticiq/python-data-uri" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/METADATA.toml index 84341d42a189..916a76d5bb0d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/METADATA.toml @@ -1,5 +1,5 @@ -version = "~=1.3.0" -upstream_repository = "https://github.com/scrapinghub/dateparser" +version = "~=1.4.0" +upstream-repository = "https://github.com/scrapinghub/dateparser" [tool.stubtest] extras = ["fasttext", "langdetect"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/search/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/search/__init__.pyi index a30045a570c3..d6eb3182de64 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/search/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/search/__init__.pyi @@ -13,7 +13,7 @@ def search_dates( settings: Settings | dict[str, Any] | None, add_detected_language: Literal[True], detect_languages_function: _DetectLanguagesFunction | None = None, -) -> list[tuple[str, datetime, str]]: ... +) -> list[tuple[str, datetime, str]] | None: ... @overload def search_dates( text: str, @@ -21,4 +21,4 @@ def search_dates( settings: Settings | dict[str, Any] | None = None, add_detected_language: Literal[False] = False, detect_languages_function: _DetectLanguagesFunction | None = None, -) -> list[tuple[str, datetime]]: ... +) -> list[tuple[str, datetime]] | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/timezone_parser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/timezone_parser.pyi index 9efc88217c70..dbdbf8e73ece 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/timezone_parser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dateparser/dateparser/timezone_parser.pyi @@ -1,8 +1,7 @@ import re from collections.abc import Generator from datetime import datetime, timedelta, tzinfo -from pathlib import Path -from typing import Final, TypeVar +from typing import TypeVar _DateTimeT = TypeVar("_DateTimeT", bound=datetime) @@ -21,6 +20,3 @@ def build_tz_offsets(search_regex_parts: list[str]) -> Generator[tuple[str, dict def get_local_tz_offset() -> timedelta: ... local_tz_offset: timedelta - -CACHE_PATH: Final[Path] -current_hash: int | None diff --git a/packages/pyright-internal/typeshed-fallback/stubs/decorator/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/decorator/METADATA.toml index de85f855da53..a59937f02dc8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/decorator/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/decorator/METADATA.toml @@ -1,2 +1,2 @@ version = "5.2.*" -upstream_repository = "https://github.com/micheles/decorator" +upstream-repository = "https://github.com/micheles/decorator" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/defusedxml/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/defusedxml/METADATA.toml index c073b5244477..96a6481f670b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/defusedxml/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/defusedxml/METADATA.toml @@ -1,5 +1,5 @@ version = "0.7.*" -upstream_repository = "https://github.com/tiran/defusedxml" +upstream-repository = "https://github.com/tiran/defusedxml" [tool.stubtest] -stubtest_requirements = ["lxml"] +stubtest-dependencies = ["lxml"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dirhash/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/dirhash/METADATA.toml index a39d6c7bc868..a49924a2eb8a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dirhash/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/dirhash/METADATA.toml @@ -1,2 +1,2 @@ version = "0.5.*" -upstream_repository = "https://github.com/andhus/dirhash-python" +upstream-repository = "https://github.com/andhus/dirhash-python" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dirhash/dirhash/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/dirhash/dirhash/__init__.pyi index 5a24f69dc17c..3753092bc2b4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dirhash/dirhash/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/dirhash/dirhash/__init__.pyi @@ -71,7 +71,7 @@ class Filter: def match_patterns(self) -> tuple[str, ...]: ... def include(self, recursion_path: _RecursionPath) -> bool: ... def match_file(self, filepath: str | PathLike[str]) -> bool: ... - def __call__(self, paths: Iterable[_RP]) -> Generator[_RP, None, None]: ... + def __call__(self, paths: Iterable[_RP]) -> Generator[_RP]: ... def get_match_patterns( match: Iterable[str] | None = None, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/django-filter/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/django-filter/METADATA.toml index 5f24ade15c28..775f52e20022 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/django-filter/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/django-filter/METADATA.toml @@ -1,7 +1,7 @@ version = "25.2.*" -upstream_repository = "https://github.com/carltongibson/django-filter/" -requires = ["django-stubs"] +upstream-repository = "https://github.com/carltongibson/django-filter/" +dependencies = ["django-stubs"] [tool.stubtest] -mypy_plugins = ["mypy_django_plugin.main"] -mypy_plugins_config = {"django-stubs" = {"django_settings_module" = "@tests.django_settings"}} +mypy-plugins = ["mypy_django_plugin.main"] +mypy-plugins-config = {"django-stubs" = {"django_settings_module" = "@tests.django_settings"}} diff --git a/packages/pyright-internal/typeshed-fallback/stubs/django-import-export/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/django-import-export/METADATA.toml index bc47485c7595..9452959702c8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/django-import-export/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/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 +upstream-repository = "https://github.com/django-import-export/django-import-export" +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/packages/pyright-internal/typeshed-fallback/stubs/django-import-export/import_export/widgets.pyi b/packages/pyright-internal/typeshed-fallback/stubs/django-import-export/import_export/widgets.pyi index 1d881a40b164..3e0260ada9e9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/django-import-export/import_export/widgets.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/django-import-export/import_export/widgets.pyi @@ -57,12 +57,17 @@ class JSONWidget(Widget): ... _ModelT = TypeVar("_ModelT", bound=Model) class ForeignKeyWidget(Widget, Generic[_ModelT]): - model: _ModelT + model: type[_ModelT] field: str key_is_id: bool use_natural_foreign_keys: bool def __init__( - self, model: _ModelT, field: str = "pk", use_natural_foreign_keys: bool = False, key_is_id: bool = False, **kwargs: Any + self, + model: type[_ModelT], + field: str = "pk", + use_natural_foreign_keys: bool = False, + key_is_id: bool = False, + **kwargs: Any, ) -> None: ... def get_queryset(self, value: Any, row: Mapping[str, Any], *args: Any, **kwargs: Any) -> QuerySet[_ModelT]: ... def get_instance_by_natural_key(self, value: str | bytes | bytearray) -> _ModelT: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/docker/METADATA.toml index 0ce47db99180..1d82f1593534 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/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"] +upstream-repository = "https://github.com/docker/docker-py" +dependencies = ["types-paramiko", "types-requests", "urllib3>=2"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/api/build.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/api/build.pyi index d5c0a30e45ff..73d69c033557 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/api/build.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/api/build.pyi @@ -47,7 +47,7 @@ class BuildApiMixin: platform: str | None = None, isolation: str | None = None, use_config_proxy: bool = True, - ) -> Generator[Any, None, None]: ... + ) -> Generator[Any]: ... def prune_builds( self, filters: _Filers | None = None, keep_storage: int | None = None, all: bool | None = None ) -> dict[str, Any]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/api/swarm.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/api/swarm.pyi index 2834e699f49d..7cad3d97c1a2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/api/swarm.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/api/swarm.pyi @@ -1,38 +1,85 @@ import logging -from typing import Literal +from typing import Any, Literal, TypedDict, type_check_only +from typing_extensions import TypeAlias -from docker.types.swarm import SwarmSpec +from docker.types.services import DriverConfig +from docker.types.swarm import SwarmExternalCA, SwarmSpec log: logging.Logger +@type_check_only +class _HasId(TypedDict): + Id: str + +@type_check_only +class _HasID(TypedDict): + ID: str + +_Node: TypeAlias = _HasId | _HasID | str + +@type_check_only +class _NodeSpec(TypedDict, total=False): + Name: str + Labels: dict[str, str] + Role: Literal["worker", "manager"] + Availability: Literal["active", "pause", "drain"] + +@type_check_only +class _UnlockKeyResponse(TypedDict): + UnlockKey: str + class SwarmApiMixin: - def create_swarm_spec(self, *args, **kwargs) -> SwarmSpec: ... - def get_unlock_key(self): ... + def create_swarm_spec( + self, + task_history_retention_limit: int | None = None, + snapshot_interval: int | None = None, + keep_old_snapshots: int | None = None, + log_entries_for_slow_followers: int | None = None, + heartbeat_tick: int | None = None, + election_tick: int | None = None, + dispatcher_heartbeat_period: int | None = None, + node_cert_expiry: int | None = None, + external_ca: SwarmExternalCA | None = None, + external_cas: list[SwarmExternalCA] | None = None, + name: str | None = None, + labels: dict[str, str] | None = None, + signing_ca_cert: str | None = None, + signing_ca_key: str | None = None, + ca_force_rotate: int | None = None, + autolock_managers: bool | None = None, + log_driver: DriverConfig | None = None, + ) -> SwarmSpec: ... + def get_unlock_key(self) -> _UnlockKeyResponse: ... def init_swarm( self, - advertise_addr=None, + advertise_addr: str | None = None, listen_addr: str = "0.0.0.0:2377", force_new_cluster: bool = False, - swarm_spec=None, - default_addr_pool=None, - subnet_size=None, - data_path_addr=None, - data_path_port=None, - ): ... - def inspect_swarm(self): ... - def inspect_node(self, node_id): ... + swarm_spec: dict[str, Any] | None = None, # Any: arbitrary SwarmSpec configuration body + default_addr_pool: list[str] | None = None, + subnet_size: int | None = None, + data_path_addr: str | None = None, + data_path_port: int | None = None, + ) -> str: ... + def inspect_swarm(self) -> dict[str, Any]: ... # Any: deeply nested ClusterInfo + JoinTokens + def inspect_node(self, node_id: _Node) -> dict[str, Any]: ... # Any: deeply nested Node object def join_swarm( - self, remote_addrs, join_token, listen_addr: str = "0.0.0.0:2377", advertise_addr=None, data_path_addr=None + self, + remote_addrs: list[str], + join_token: str, + listen_addr: str = "0.0.0.0:2377", + advertise_addr: str | None = None, + data_path_addr: str | None = None, ) -> Literal[True]: ... def leave_swarm(self, force: bool = False) -> Literal[True]: ... - def nodes(self, filters=None): ... - def remove_node(self, node_id, force: bool = False) -> Literal[True]: ... - def unlock_swarm(self, key) -> Literal[True]: ... - def update_node(self, node_id, version, node_spec=None) -> Literal[True]: ... + def nodes(self, filters: dict[str, Any] | None = None) -> list[dict[str, Any]]: ... # Any: filter values + Node response + def remove_node(self, node_id: _Node, force: bool = False) -> Literal[True]: ... + def unlock_swarm(self, key: str | _UnlockKeyResponse) -> Literal[True]: ... + def update_node(self, node_id: _Node, version: int, node_spec: _NodeSpec | None = None) -> Literal[True]: ... def update_swarm( self, - version, - swarm_spec=None, + version: int, + swarm_spec: dict[str, Any] | None = None, # Any: arbitrary SwarmSpec configuration body rotate_worker_token: bool = False, rotate_manager_token: bool = False, rotate_manager_unlock_key: bool = False, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/configs.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/configs.pyi index bac0de6a498c..d77553f4686a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/configs.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/configs.pyi @@ -8,6 +8,6 @@ class Config(Model): class ConfigCollection(Collection[Config]): model: type[Config] - def create(self, **kwargs) -> Config: ... # type:ignore[override] + def create(self, **kwargs) -> Config: ... # type: ignore[override] def get(self, config_id: str) -> Config: ... def list(self, **kwargs) -> list[Config]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/containers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/containers.pyi index 4bb709249df7..be811aa0fb41 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/containers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/containers.pyi @@ -1,10 +1,9 @@ import datetime from _io import _BufferedReaderStream -from _typeshed import Incomplete from collections.abc import Iterable, Iterator, Mapping from socket import SocketIO -from typing import Literal, NamedTuple, TypedDict, overload, type_check_only -from typing_extensions import NotRequired +from typing import Any, Literal, NamedTuple, TypedDict, overload, type_check_only +from typing_extensions import NotRequired, override from docker._types import ContainerWeightDevice, WaitContainerResponse from docker.transport.sshconn import SSHSocket @@ -38,7 +37,7 @@ class Container(Model): @property def health(self) -> str: ... @property - def ports(self) -> dict[Incomplete, Incomplete]: ... + def ports(self) -> dict[str, list[dict[str, str]] | None]: ... @overload def attach( self, @@ -75,7 +74,7 @@ class Container(Model): ) -> CancellableStream[tuple[bytes | None, bytes | None]]: ... def attach_socket(self, **kwargs) -> SocketIO | _BufferedReaderStream | SSHSocket: ... def commit(self, repository: str | None = None, tag: str | None = None, **kwargs) -> Image: ... - def diff(self) -> list[dict[str, Incomplete]]: ... + def diff(self) -> list[dict[str, int | str]]: ... def exec_run( self, cmd: str | list[str], @@ -95,7 +94,7 @@ class Container(Model): def export(self, chunk_size: int | None = 2097152) -> str: ... def get_archive( self, path: str, chunk_size: int | None = 2097152, encode_stream: bool = False - ) -> tuple[Incomplete, Incomplete]: ... + ) -> tuple[Iterator[bytes], dict[str, Any] | None]: ... def kill(self, signal: str | int | None = None) -> None: ... @overload def logs( @@ -130,7 +129,7 @@ class Container(Model): def resize(self, height: int, width: int) -> None: ... def restart(self, *, timeout: float | None = 10) -> None: ... def start(self) -> None: ... - def stats(self, **kwargs) -> Iterator[dict[str, Incomplete]] | dict[str, Incomplete]: ... + def stats(self, **kwargs) -> Iterator[dict[str, Any]] | dict[str, Any]: ... def stop(self, *, timeout: float | None = None) -> None: ... def top(self, *, ps_args: str | None = None) -> _TopResult: ... def unpause(self) -> None: ... @@ -181,22 +180,22 @@ class ContainerCollection(Collection[Container]): cpuset_cpus: str | None = None, cpuset_mems: str | None = None, detach: Literal[False] = False, - device_cgroup_rules: list[Incomplete] | None = None, + device_cgroup_rules: list[str] | None = None, device_read_bps: list[Mapping[str, str | int]] | None = None, device_read_iops: list[Mapping[str, str | int]] | None = None, device_write_bps: list[Mapping[str, str | int]] | None = None, device_write_iops: list[Mapping[str, str | int]] | None = None, devices: list[str] | None = None, device_requests: list[DeviceRequest] | None = None, - dns: list[Incomplete] | None = None, - dns_opt: list[Incomplete] | None = None, - dns_search: list[Incomplete] | None = None, - domainname: str | list[Incomplete] | None = None, + dns: list[str] | None = None, + dns_opt: list[str] | None = None, + dns_search: list[str] | None = None, + domainname: str | list[str] | None = None, entrypoint: str | list[str] | None = None, environment: dict[str, str] | list[str] | None = None, extra_hosts: dict[str, str] | None = None, group_add: Iterable[str | int] | None = None, - healthcheck: dict[Incomplete, Incomplete] | None = None, + healthcheck: dict[str, Any] | None = None, hostname: str | None = None, init: bool | None = None, init_path: str | None = None, @@ -206,7 +205,7 @@ class ContainerCollection(Collection[Container]): labels: dict[str, str] | list[str] | None = None, links: dict[str, str] | dict[str, None] | dict[str, str | None] | Iterable[tuple[str, str | None]] | None = None, log_config: LogConfig | None = None, - lxc_conf: dict[Incomplete, Incomplete] | None = None, + lxc_conf: dict[str, str] | None = None, mac_address: str | None = None, mem_limit: str | int | None = None, mem_reservation: str | int | None = None, @@ -234,9 +233,9 @@ class ContainerCollection(Collection[Container]): shm_size: str | int | None = None, stdin_open: bool = False, stop_signal: str | None = None, - storage_opt: dict[Incomplete, Incomplete] | None = None, + storage_opt: dict[str, str] | None = None, stream: bool = False, - sysctls: dict[Incomplete, Incomplete] | None = None, + sysctls: dict[str, str] | None = None, tmpfs: dict[str, str] | None = None, tty: bool = False, ulimits: list[Ulimit] | None = None, @@ -276,22 +275,22 @@ class ContainerCollection(Collection[Container]): cpuset_cpus: str | None = None, cpuset_mems: str | None = None, detach: Literal[True], - device_cgroup_rules: list[Incomplete] | None = None, + device_cgroup_rules: list[str] | None = None, device_read_bps: list[Mapping[str, str | int]] | None = None, device_read_iops: list[Mapping[str, str | int]] | None = None, device_write_bps: list[Mapping[str, str | int]] | None = None, device_write_iops: list[Mapping[str, str | int]] | None = None, devices: list[str] | None = None, device_requests: list[DeviceRequest] | None = None, - dns: list[Incomplete] | None = None, - dns_opt: list[Incomplete] | None = None, - dns_search: list[Incomplete] | None = None, - domainname: str | list[Incomplete] | None = None, + dns: list[str] | None = None, + dns_opt: list[str] | None = None, + dns_search: list[str] | None = None, + domainname: str | list[str] | None = None, entrypoint: str | list[str] | None = None, environment: dict[str, str] | list[str] | None = None, extra_hosts: dict[str, str] | None = None, group_add: Iterable[str | int] | None = None, - healthcheck: dict[Incomplete, Incomplete] | None = None, + healthcheck: dict[str, Any] | None = None, hostname: str | None = None, init: bool | None = None, init_path: str | None = None, @@ -301,7 +300,7 @@ class ContainerCollection(Collection[Container]): labels: dict[str, str] | list[str] | None = None, links: dict[str, str] | dict[str, None] | dict[str, str | None] | Iterable[tuple[str, str | None]] | None = None, log_config: LogConfig | None = None, - lxc_conf: dict[Incomplete, Incomplete] | None = None, + lxc_conf: dict[str, str] | None = None, mac_address: str | None = None, mem_limit: str | int | None = None, mem_reservation: str | int | None = None, @@ -329,9 +328,9 @@ class ContainerCollection(Collection[Container]): shm_size: str | int | None = None, stdin_open: bool = False, stop_signal: str | None = None, - storage_opt: dict[Incomplete, Incomplete] | None = None, + storage_opt: dict[str, str] | None = None, stream: bool = False, - sysctls: dict[Incomplete, Incomplete] | None = None, + sysctls: dict[str, str] | None = None, tmpfs: dict[str, str] | None = None, tty: bool = False, ulimits: list[Ulimit] | None = None, @@ -345,7 +344,8 @@ class ContainerCollection(Collection[Container]): volumes_from: list[str] | None = None, working_dir: str | None = None, ) -> Container: ... - def create( # type:ignore[override] + @override + def create( # type: ignore[override] self, image: str | Image, command: str | list[str] | None = None, @@ -367,22 +367,22 @@ class ContainerCollection(Collection[Container]): cpuset_cpus: str | None = None, cpuset_mems: str | None = None, detach: bool = False, - device_cgroup_rules: list[Incomplete] | None = None, + device_cgroup_rules: list[str] | None = None, device_read_bps: list[Mapping[str, str | int]] | None = None, device_read_iops: list[Mapping[str, str | int]] | None = None, device_write_bps: list[Mapping[str, str | int]] | None = None, device_write_iops: list[Mapping[str, str | int]] | None = None, devices: list[str] | None = None, device_requests: list[DeviceRequest] | None = None, - dns: list[Incomplete] | None = None, - dns_opt: list[Incomplete] | None = None, - dns_search: list[Incomplete] | None = None, - domainname: str | list[Incomplete] | None = None, + dns: list[str] | None = None, + dns_opt: list[str] | None = None, + dns_search: list[str] | None = None, + domainname: str | list[str] | None = None, entrypoint: str | list[str] | None = None, environment: dict[str, str] | list[str] | None = None, extra_hosts: dict[str, str] | None = None, group_add: Iterable[str | int] | None = None, - healthcheck: dict[Incomplete, Incomplete] | None = None, + healthcheck: dict[str, Any] | None = None, hostname: str | None = None, init: bool | None = None, init_path: str | None = None, @@ -392,7 +392,7 @@ class ContainerCollection(Collection[Container]): labels: dict[str, str] | list[str] | None = None, links: dict[str, str] | dict[str, None] | dict[str, str | None] | Iterable[tuple[str, str | None]] | None = None, log_config: LogConfig | None = None, - lxc_conf: dict[Incomplete, Incomplete] | None = None, + lxc_conf: dict[str, str] | None = None, mac_address: str | None = None, mem_limit: str | int | None = None, mem_reservation: str | int | None = None, @@ -420,9 +420,9 @@ class ContainerCollection(Collection[Container]): shm_size: str | int | None = None, stdin_open: bool = False, stop_signal: str | None = None, - storage_opt: dict[Incomplete, Incomplete] | None = None, + storage_opt: dict[str, str] | None = None, stream: bool = False, - sysctls: dict[Incomplete, Incomplete] | None = None, + sysctls: dict[str, str] | None = None, tmpfs: dict[str, str] | None = None, tty: bool = False, ulimits: list[Ulimit] | None = None, @@ -436,22 +436,23 @@ class ContainerCollection(Collection[Container]): volumes_from: list[str] | None = None, working_dir: str | None = None, ) -> Container: ... + @override def get(self, container_id: str) -> Container: ... def list( self, all: bool = False, before: str | None = None, - filters: dict[str, Incomplete] | None = None, + filters: dict[str, str | list[str] | bool] | None = None, limit: int = -1, since: str | None = None, sparse: bool = False, ignore_removed: bool = False, ) -> list[Container]: ... - def prune(self, filters: dict[str, Incomplete] | None = None) -> dict[str, Incomplete]: ... + def prune(self, filters: dict[str, Any] | None = None) -> dict[str, Any]: ... RUN_CREATE_KWARGS: list[str] RUN_HOST_CONFIG_KWARGS: list[str] class ExecResult(NamedTuple): - exit_code: Incomplete - output: Incomplete + exit_code: int | None + output: bytes | Iterator[bytes] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/networks.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/networks.pyi index 86cca6416ca8..d3405666a581 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/networks.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/networks.pyi @@ -16,7 +16,7 @@ class Network(Model): class NetworkCollection(Collection[Network]): model: type[Network] - def create( # type:ignore[override] + def create( # type: ignore[override] self, name: str, driver: str | None = None, @@ -32,6 +32,6 @@ class NetworkCollection(Collection[Network]): ) -> Network: ... def get( self, network_id: str, verbose: bool | None = None, scope: Literal["local", "global", "swarm"] | None = None - ) -> Network: ... # type:ignore[override] + ) -> Network: ... # type: ignore[override] def list(self, *args, **kwargs) -> list[Network]: ... def prune(self, filters: dict[str, Any] | None = None) -> dict[str, Any]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/plugins.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/plugins.pyi index 92b7da67e199..9b33726d7f6d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/plugins.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/plugins.pyi @@ -1,25 +1,29 @@ -from _typeshed import Incomplete from collections.abc import Generator +from typing import Any +from typing_extensions import override from .resource import Collection, Model class Plugin(Model): @property - def name(self): ... + def name(self) -> str | None: ... @property - def enabled(self): ... + def enabled(self) -> bool | None: ... @property - def settings(self): ... - def configure(self, options) -> None: ... + def settings(self) -> dict[str, Any] | None: ... + def configure(self, options: dict[str, Any]) -> None: ... def disable(self, force: bool = False) -> None: ... def enable(self, timeout: int = 0) -> None: ... - def push(self): ... - def remove(self, force: bool = False): ... - def upgrade(self, remote=None) -> Generator[Incomplete, Incomplete, None]: ... + def push(self) -> Generator[dict[str, Any]]: ... + def remove(self, force: bool = False) -> bool: ... + def upgrade(self, remote: str | None = None) -> Generator[dict[str, Any]]: ... class PluginCollection(Collection[Plugin]): model: type[Plugin] - def create(self, name, plugin_data_dir, gzip: bool = False): ... # type:ignore[override] + @override + def create(self, name, plugin_data_dir, gzip: bool = False): ... # type: ignore[override] + @override def get(self, name): ... def install(self, remote_name, local_name=None): ... + @override def list(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/services.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/services.pyi index 8e4b5ccaa270..62e3d7c4d1f0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/services.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/services.pyi @@ -15,7 +15,7 @@ class Service(Model): class ServiceCollection(Collection[Service]): model: type[Service] - def create(self, image, command=None, **kwargs): ... # type:ignore[override] + def create(self, image, command=None, **kwargs): ... # type: ignore[override] def get(self, service_id, insert_defaults=None): ... def list(self, **kwargs): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/volumes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/volumes.pyi index 847f0100cec5..29b9c124c902 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/volumes.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/volumes.pyi @@ -10,7 +10,7 @@ class Volume(Model): class VolumeCollection(Collection[Volume]): model: type[Volume] - def create(self, name: str | None = None, **kwargs) -> Volume: ... # type:ignore[override] + def create(self, name: str | None = None, **kwargs) -> Volume: ... # type: ignore[override] def get(self, volume_id: str) -> Volume: ... def list(self, **kwargs) -> list[Volume]: ... def prune(self, filters: dict[str, Any] | None = None) -> dict[str, Any]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/transport/basehttpadapter.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/transport/basehttpadapter.pyi index 1db332d94b83..b783be74b120 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/transport/basehttpadapter.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/transport/basehttpadapter.pyi @@ -1,4 +1,17 @@ +from collections.abc import Mapping +from typing_extensions import override + import requests.adapters +from urllib3.connectionpool import ConnectionPool class BaseHTTPAdapter(requests.adapters.HTTPAdapter): + @override def close(self) -> None: ... + @override + def get_connection_with_tls_context( + self, + request: requests.PreparedRequest, + verify: bool | str | None, + proxies: Mapping[str, str] | None = None, + cert: tuple[str, str] | str | None = None, + ) -> ConnectionPool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/transport/sshconn.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/transport/sshconn.pyi index 7bb125591a72..c184ecb5d3e6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/transport/sshconn.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/transport/sshconn.pyi @@ -15,11 +15,11 @@ class SSHSocket(socket.socket): user: str | None proc: subprocess.Popen[bytes] | None def __init__(self, host: str) -> None: ... - def connect(self, **kwargs) -> None: ... # type:ignore[override] - def sendall(self, data) -> None: ... # type:ignore[override] - def send(self, data): ... # type:ignore[override] - def recv(self, n): ... # type:ignore[override] - def makefile(self, mode): ... # type:ignore[override] + def connect(self, **kwargs) -> None: ... # type: ignore[override] + def sendall(self, data) -> None: ... # type: ignore[override] + def send(self, data): ... # type: ignore[override] + def recv(self, n): ... # type: ignore[override] + def makefile(self, mode): ... # type: ignore[override] def close(self) -> None: ... class SSHConnection(urllib3.connection.HTTPConnection): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/base.pyi index 9a528ff884f0..913e6261d85c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/base.pyi @@ -1,5 +1,7 @@ -from _typeshed import Incomplete from collections.abc import Mapping +from typing import TypeVar -class DictType(dict[str, Incomplete]): - def __init__(self, init: Mapping[str, Incomplete]) -> None: ... +_VT = TypeVar("_VT") + +class DictType(dict[str, _VT]): + def __init__(self, init: Mapping[str, _VT]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/containers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/containers.pyi index a327c3479141..6e58a0f3515f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/containers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/containers.pyi @@ -1,4 +1,3 @@ -from _typeshed import Incomplete from collections.abc import Iterable, Mapping from typing import Any, Final, Literal @@ -18,63 +17,80 @@ class LogConfigTypesEnum: FLUENTD: Final = "fluentd" NONE: Final = "none" -class LogConfig(DictType): +class LogConfig(DictType[Any]): types: type[LogConfigTypesEnum] - def __init__(self, **kwargs) -> None: ... + def __init__( + self, *, type: str = ..., Type: str = ..., config: dict[str, str] = ..., Config: dict[str, str] = ... + ) -> None: ... @property - def type(self): ... + def type(self) -> str: ... @type.setter - def type(self, value) -> None: ... + def type(self, value: str) -> None: ... @property - def config(self): ... - def set_config_value(self, key, value) -> None: ... - def unset_config(self, key) -> None: ... + def config(self) -> dict[str, str]: ... + def set_config_value(self, key: str, value: str) -> None: ... + def unset_config(self, key: str) -> None: ... -class Ulimit(DictType): - def __init__(self, **kwargs) -> None: ... +class Ulimit(DictType[Any]): + def __init__( + self, *, name: str = ..., Name: str = ..., soft: int = ..., Soft: int = ..., hard: int = ..., Hard: int = ... + ) -> None: ... @property - def name(self): ... + def name(self) -> str: ... @name.setter - def name(self, value) -> None: ... + def name(self, value: str) -> None: ... @property - def soft(self): ... + def soft(self) -> int | None: ... @soft.setter - def soft(self, value) -> None: ... + def soft(self, value: int | None) -> None: ... @property - def hard(self): ... + def hard(self) -> int | None: ... @hard.setter - def hard(self, value) -> None: ... + def hard(self, value: int | None) -> None: ... -class DeviceRequest(DictType): - def __init__(self, **kwargs) -> None: ... +class DeviceRequest(DictType[Any]): + def __init__( + self, + *, + driver: str = ..., + Driver: str = ..., + count: int = ..., + Count: int = ..., + device_ids: list[str] = ..., + DeviceIDs: list[str] = ..., + capabilities: list[list[str]] = ..., + Capabilities: list[list[str]] = ..., + options: dict[str, str] = ..., + Options: dict[str, str] = ..., + ) -> None: ... @property - def driver(self): ... + def driver(self) -> str: ... @driver.setter - def driver(self, value) -> None: ... + def driver(self, value: str) -> None: ... @property - def count(self): ... + def count(self) -> int: ... @count.setter - def count(self, value) -> None: ... + def count(self, value: int) -> None: ... @property - def device_ids(self): ... + def device_ids(self) -> list[str]: ... @device_ids.setter - def device_ids(self, value) -> None: ... + def device_ids(self, value: list[str]) -> None: ... @property - def capabilities(self): ... + def capabilities(self) -> list[list[str]]: ... @capabilities.setter - def capabilities(self, value) -> None: ... + def capabilities(self, value: list[list[str]]) -> None: ... @property - def options(self): ... + def options(self) -> dict[str, str]: ... @options.setter - def options(self, value) -> None: ... + def options(self, value: dict[str, str]) -> None: ... -class HostConfig(dict[str, Incomplete]): +class HostConfig(dict[str, Any]): def __init__( self, version: str, binds: dict[str, Mapping[str, str]] | list[str] | None = None, - port_bindings: Mapping[int | str, Incomplete] | None = None, - lxc_conf: dict[str, Incomplete] | list[dict[str, Incomplete]] | None = None, + port_bindings: Mapping[int | str, Any] | None = None, # Any: int, str, tuple, dict, or list + lxc_conf: dict[str, str] | list[dict[str, str]] | None = None, publish_all_ports: bool = False, links: dict[str, str] | dict[str, None] | dict[str, str | None] | Iterable[tuple[str, str | None]] | None = None, privileged: bool = False, @@ -86,7 +102,7 @@ class HostConfig(dict[str, Incomplete]): cap_add: list[str] | None = None, cap_drop: list[str] | None = None, devices: list[str] | None = None, - extra_hosts: dict[str, Incomplete] | list[Incomplete] | None = None, + extra_hosts: dict[str, str] | list[str] | None = None, read_only: bool | None = None, pid_mode: str | None = None, ipc_mode: str | None = None, @@ -113,7 +129,7 @@ class HostConfig(dict[str, Incomplete]): sysctls: dict[str, str] | None = None, tmpfs: dict[str, str] | None = None, oom_score_adj: int | None = None, - dns_opt: list[Incomplete] | None = None, + dns_opt: list[str] | None = None, cpu_shares: int | None = None, cpuset_cpus: str | None = None, userns_mode: str | None = None, @@ -121,7 +137,7 @@ class HostConfig(dict[str, Incomplete]): pids_limit: int | None = None, isolation: str | None = None, auto_remove: bool = False, - storage_opt: dict[Incomplete, Incomplete] | None = None, + storage_opt: dict[str, str] | None = None, init: bool | None = None, init_path: str | None = None, volume_driver: str | None = None, @@ -133,7 +149,7 @@ class HostConfig(dict[str, Incomplete]): mounts: list[Mount] | None = None, cpu_rt_period: int | None = None, cpu_rt_runtime: int | None = None, - device_cgroup_rules: list[Incomplete] | None = None, + device_cgroup_rules: list[str] | None = None, device_requests: list[DeviceRequest] | None = None, cgroupns: Literal["private", "host"] | None = None, ) -> None: ... @@ -143,7 +159,7 @@ def host_config_version_error(param: str, version: str, less_than: bool = True) def host_config_value_error(param: str, param_value: object) -> ValueError: ... def host_config_incompatible_error(param: str, param_value: str, incompatible_param: str) -> errors.InvalidArgument: ... -class ContainerConfig(dict[str, Incomplete]): +class ContainerConfig(dict[str, Any]): def __init__( self, version: str, @@ -156,7 +172,7 @@ class ContainerConfig(dict[str, Incomplete]): tty: bool = False, # list is invariant, enumerating all possible union combination would be too complex for: # list[str | int | tuple[int | str, str] | tuple[int | str, ...]] - ports: dict[str, dict[Incomplete, Incomplete]] | list[Any] | None = None, + ports: dict[str, dict[str, str]] | list[Any] | None = None, environment: dict[str, str] | list[str] | None = None, volumes: str | list[str] | None = None, network_disabled: bool = False, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/daemon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/daemon.pyi index 8cad90ea9391..6561a772fc7a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/daemon.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/daemon.pyi @@ -2,10 +2,12 @@ from collections.abc import Iterator from typing import Generic, TypeVar from typing_extensions import Self +from requests import Response + _T_co = TypeVar("_T_co", covariant=True) class CancellableStream(Generic[_T_co]): - def __init__(self, stream: Iterator[_T_co], response) -> None: ... + def __init__(self, stream: Iterator[_T_co], response: Response) -> None: ... def __iter__(self) -> Self: ... def __next__(self) -> _T_co: ... next = __next__ diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/healthcheck.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/healthcheck.pyi index a6b8347507fb..c09ca36ffdcd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/healthcheck.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/healthcheck.pyi @@ -1,24 +1,39 @@ +from typing import Any + from .base import DictType -class Healthcheck(DictType): - def __init__(self, **kwargs) -> None: ... +class Healthcheck(DictType[Any]): + def __init__( + self, + *, + test: str | list[str] | None = ..., + Test: str | list[str] | None = ..., + interval: int | None = ..., + Interval: int | None = ..., + timeout: int | None = ..., + Timeout: int | None = ..., + retries: int | None = ..., + Retries: int | None = ..., + start_period: int | None = ..., + StartPeriod: int | None = ..., + ) -> None: ... @property - def test(self): ... + def test(self) -> list[str] | None: ... @test.setter - def test(self, value) -> None: ... + def test(self, value: str | list[str] | None) -> None: ... @property - def interval(self): ... + def interval(self) -> int | None: ... @interval.setter - def interval(self, value) -> None: ... + def interval(self, value: int | None) -> None: ... @property - def timeout(self): ... + def timeout(self) -> int | None: ... @timeout.setter - def timeout(self, value) -> None: ... + def timeout(self, value: int | None) -> None: ... @property - def retries(self): ... + def retries(self) -> int | None: ... @retries.setter - def retries(self, value) -> None: ... + def retries(self, value: int | None) -> None: ... @property - def start_period(self): ... + def start_period(self) -> int | None: ... @start_period.setter - def start_period(self, value) -> None: ... + def start_period(self, value: int | None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/networks.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/networks.pyi index d310a0766c4f..bf9e5d027714 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/networks.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/networks.pyi @@ -1,7 +1,7 @@ -from _typeshed import Incomplete from collections.abc import Iterable +from typing import Any -class EndpointConfig(dict[str, Incomplete]): +class EndpointConfig(dict[str, Any]): def __init__( self, version: str, @@ -10,22 +10,19 @@ class EndpointConfig(dict[str, Incomplete]): ipv4_address: str | None = None, ipv6_address: str | None = None, link_local_ips: list[str] | None = None, - driver_opt=None, + driver_opt: dict[str, str] | None = None, mac_address: str | None = None, ) -> None: ... -class NetworkingConfig(dict[str, Incomplete]): +class NetworkingConfig(dict[str, Any]): def __init__(self, endpoints_config: EndpointConfig | None = None) -> None: ... -class IPAMConfig(dict[str, Incomplete]): +class IPAMConfig(dict[str, Any]): def __init__( - self, - driver: str = "default", - pool_configs: list[IPAMPool] | None = None, - options: dict[Incomplete, Incomplete] | None = None, + self, driver: str = "default", pool_configs: list[IPAMPool] | None = None, options: dict[str, str] | None = None ) -> None: ... -class IPAMPool(dict[str, Incomplete]): +class IPAMPool(dict[str, Any]): def __init__( self, subnet: str | None = None, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/services.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/services.pyi index 54baedb5daf1..621b21954a01 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/services.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/types/services.pyi @@ -1,12 +1,11 @@ -from _typeshed import Incomplete from collections.abc import Iterable, Mapping -from typing import Final, Literal, TypedDict, TypeVar, overload +from typing import Any, Final, Literal, TypedDict, TypeVar, overload, type_check_only from .healthcheck import Healthcheck _T = TypeVar("_T") -class TaskTemplate(dict[str, Incomplete]): +class TaskTemplate(dict[str, Any]): def __init__( self, container_spec: ContainerSpec, @@ -26,14 +25,14 @@ class TaskTemplate(dict[str, Incomplete]): @property def placement(self) -> Placement: ... -class ContainerSpec(dict[str, Incomplete]): +class ContainerSpec(dict[str, Any]): def __init__( self, image: str, command: str | list[str] | None = None, args: list[str] | None = None, hostname: str | None = None, - env: dict[str, Incomplete] | list[str] | None = None, + env: dict[str, str | bytes | None] | list[str] | None = None, workdir: str | None = None, user: str | None = None, labels: dict[str, str] | None = None, @@ -57,7 +56,7 @@ class ContainerSpec(dict[str, Incomplete]): sysctls: dict[str, str] | None = None, ) -> None: ... -class Mount(dict[str, Incomplete]): +class Mount(dict[str, Any]): def __init__( self, target: str, @@ -75,11 +74,12 @@ class Mount(dict[str, Incomplete]): @classmethod def parse_mount_string(cls, string: str) -> Mount: ... +@type_check_only class _ResourceDict(TypedDict): Kind: str Value: int -class Resources(dict[str, Incomplete]): +class Resources(dict[str, Any]): def __init__( self, cpu_limit: int | None = None, @@ -91,7 +91,7 @@ class Resources(dict[str, Incomplete]): ) = None, ) -> None: ... -class UpdateConfig(dict[str, Incomplete]): +class UpdateConfig(dict[str, Any]): def __init__( self, parallelism: int = 0, @@ -109,16 +109,16 @@ class RestartConditionTypesEnum: ON_FAILURE: Final = "on-failure" ANY: Final = "any" -class RestartPolicy(dict[str, Incomplete]): +class RestartPolicy(dict[str, Any]): condition_types: type[RestartConditionTypesEnum] def __init__( self, condition: Literal["none", "on-failure", "any"] = "none", delay: int = 0, max_attempts: int = 0, window: int = 0 ) -> None: ... -class DriverConfig(dict[str, Incomplete]): +class DriverConfig(dict[str, Any]): def __init__(self, name: str, options: dict[str, str] | None = None) -> None: ... -class EndpointSpec(dict[str, Incomplete]): +class EndpointSpec(dict[str, Any]): def __init__( self, mode: str | None = None, ports: Mapping[str, str | tuple[str | None, ...]] | list[dict[str, str]] | None = None ) -> None: ... @@ -128,7 +128,7 @@ def convert_service_ports(ports: list[_T]) -> list[_T]: ... @overload def convert_service_ports(ports: Mapping[str, str | tuple[str | None, ...]]) -> list[dict[str, str]]: ... -class ServiceMode(dict[str, Incomplete]): +class ServiceMode(dict[str, Any]): mode: Literal["replicated", "global", "ReplicatedJob", "GlobalJob"] def __init__( self, @@ -139,7 +139,7 @@ class ServiceMode(dict[str, Incomplete]): @property def replicas(self) -> int | None: ... -class SecretReference(dict[str, Incomplete]): +class SecretReference(dict[str, Any]): def __init__( self, secret_id: str, @@ -150,7 +150,7 @@ class SecretReference(dict[str, Incomplete]): mode: int = 292, ) -> None: ... -class ConfigReference(dict[str, Incomplete]): +class ConfigReference(dict[str, Any]): def __init__( self, config_id: str, @@ -161,7 +161,7 @@ class ConfigReference(dict[str, Incomplete]): mode: int = 292, ) -> None: ... -class Placement(dict[str, Incomplete]): +class Placement(dict[str, Any]): def __init__( self, constraints: list[str] | None = None, @@ -170,15 +170,15 @@ class Placement(dict[str, Incomplete]): maxreplicas: int | None = None, ) -> None: ... -class PlacementPreference(dict[str, Incomplete]): +class PlacementPreference(dict[str, Any]): def __init__(self, strategy: Literal["spread"], descriptor: str) -> None: ... -class DNSConfig(dict[str, Incomplete]): +class DNSConfig(dict[str, Any]): def __init__( self, nameservers: list[str] | None = None, search: list[str] | None = None, options: list[str] | None = None ) -> None: ... -class Privileges(dict[str, Incomplete]): +class Privileges(dict[str, Any]): def __init__( self, credentialspec_file: str | None = None, @@ -190,5 +190,5 @@ class Privileges(dict[str, Incomplete]): selinux_level: str | None = None, ) -> None: ... -class NetworkAttachmentConfig(dict[str, Incomplete]): +class NetworkAttachmentConfig(dict[str, Any]): def __init__(self, target: str, aliases: list[str] | None = None, options: dict[str, str] | None = None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/METADATA.toml index a252e11f2b67..8f5cd433f5de 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/dockerfile-parse/METADATA.toml @@ -1,2 +1,2 @@ version = "2.0.*" -upstream_repository = "https://github.com/containerbuildsystem/dockerfile-parse" +upstream-repository = "https://github.com/containerbuildsystem/dockerfile-parse" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/docutils/METADATA.toml index 1a84d3665e0c..3d0d77995d83 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/METADATA.toml @@ -1,2 +1,2 @@ version = "0.22.3" -upstream_repository = "https://sourceforge.net/p/docutils/code" +upstream-repository = "https://sourceforge.net/p/docutils/code" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/__init__.pyi index 6b97f04044aa..9845ec945daa 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/__init__.pyi @@ -1,4 +1,4 @@ -from typing import Any, ClassVar, Final, NamedTuple +from typing import Any, ClassVar, Final, NamedTuple, type_check_only from typing_extensions import Self from docutils.transforms import Transform @@ -6,6 +6,7 @@ from docutils.transforms import Transform __docformat__: Final = "reStructuredText" __version__: Final[str] +@type_check_only class _VersionInfo(NamedTuple): major: int minor: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/statemachine.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/statemachine.pyi index 353b27734915..2e1e7fd7c5c4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/statemachine.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/statemachine.pyi @@ -10,7 +10,7 @@ _TransitionResult: TypeAlias = tuple[_Context, str | None, list[str]] _TransitionMethod: TypeAlias = Callable[[Match[str], _Context, str], _TransitionResult[_Context]] _Observer: TypeAlias = Callable[[StateMachine[_Context]], None] -__docformat__: Final = "reStructuredText" +__docformat__: Final = "restructuredtext" class StateMachine(Generic[_Context]): input_lines: StringList | None diff --git a/packages/pyright-internal/typeshed-fallback/stubs/editdistance/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/editdistance/METADATA.toml index 076f99ee8e0c..2c5ced48093a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/editdistance/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/editdistance/METADATA.toml @@ -1,2 +1,2 @@ version = "0.8.*" -upstream_repository = "https://github.com/roy-ht/editdistance" +upstream-repository = "https://github.com/roy-ht/editdistance" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/entrypoints/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/entrypoints/METADATA.toml index a1a81ef24ff8..cd6b4631d954 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/entrypoints/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/entrypoints/METADATA.toml @@ -1,2 +1,2 @@ version = "0.4.*" -upstream_repository = "https://github.com/takluyver/entrypoints" +upstream-repository = "https://github.com/takluyver/entrypoints" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ephem/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/ephem/METADATA.toml index ea821e2fee21..1f1f7d6bc0e3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ephem/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/ephem/METADATA.toml @@ -1,2 +1,2 @@ version = "4.2.*" -upstream_repository = "https://github.com/brandon-rhodes/pyephem" +upstream-repository = "https://github.com/brandon-rhodes/pyephem" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ephem/ephem/_libastro.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ephem/ephem/_libastro.pyi index 57f652a23823..7f13518f2168 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ephem/ephem/_libastro.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ephem/ephem/_libastro.pyi @@ -1,6 +1,6 @@ from _typeshed import Unused from datetime import datetime as _datetime -from typing import Final, NoReturn, Protocol, TypedDict, overload, type_check_only +from typing import Final, NoReturn, TypedDict, overload, type_check_only from typing_extensions import Self, TypeAlias, deprecated, disjoint_base _DateInitType: TypeAlias = ( @@ -95,7 +95,7 @@ class Observer: def radec_of(self, az: float | str, alt: float | str) -> tuple[Angle, Angle]: ... @disjoint_base -class Body(Protocol): +class Body: @property def name(self) -> str | None: ... @property @@ -152,7 +152,7 @@ class Body(Protocol): def writedb(self) -> str: ... def parallactic_angle(self) -> Angle: ... -class Planet(Body, Protocol): +class Planet(Body): @property def hlon(self) -> Angle: ... @property @@ -200,7 +200,7 @@ class Saturn(Planet): def sun_tilt(self) -> Angle: ... @disjoint_base -class PlanetMoon(Protocol): +class PlanetMoon: @property def name(self) -> str: ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/et_xmlfile/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/et_xmlfile/METADATA.toml index 6307b2971bd2..db02b864055f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/et_xmlfile/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/et_xmlfile/METADATA.toml @@ -1,2 +1,2 @@ version = "2.0.*" -upstream_repository = "https://foss.heptapod.net/openpyxl/et_xmlfile" +upstream-repository = "https://foss.heptapod.net/openpyxl/et_xmlfile" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fanstatic/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/fanstatic/METADATA.toml index ece906561784..a7eea5dca12e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fanstatic/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/fanstatic/METADATA.toml @@ -1,3 +1,3 @@ -version = "1.6.*" -upstream_repository = "https://github.com/zopefoundation/fanstatic" -requires = ["types-setuptools", "types-WebOb"] +version = "1.7.*" +upstream-repository = "https://github.com/zopefoundation/fanstatic" +dependencies = ["types-setuptools", "types-WebOb"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/first/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/first/METADATA.toml index 89a41730f1b2..3fe3d66bda4d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/first/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/first/METADATA.toml @@ -1,2 +1,2 @@ version = "2.0.*" -upstream_repository = "https://github.com/hynek/first" +upstream-repository = "https://github.com/hynek/first" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/METADATA.toml index bf4cac0bccd7..f8d9fca3d6e9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/METADATA.toml @@ -1,2 +1,2 @@ version = "25.11.29" -upstream_repository = "https://github.com/PyCQA/flake8-bugbear" +upstream-repository = "https://github.com/PyCQA/flake8-bugbear" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-builtins/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-builtins/METADATA.toml index 3406949e4fec..5f4f23a38df6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-builtins/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-builtins/METADATA.toml @@ -1,3 +1,3 @@ version = "3.1.*" -upstream_repository = "https://github.com/gforcada/flake8-builtins" -requires = ["types-flake8"] +upstream-repository = "https://github.com/gforcada/flake8-builtins" +dependencies = ["types-flake8"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/METADATA.toml index 8d4722b27d0c..201a2cb77311 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-docstrings/METADATA.toml @@ -1,3 +1,3 @@ version = "1.7.*" -upstream_repository = "https://github.com/pycqa/flake8-docstrings" -requires = ["types-flake8"] +upstream-repository = "https://github.com/pycqa/flake8-docstrings" +dependencies = ["types-flake8"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-rst-docstrings/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-rst-docstrings/METADATA.toml index cb3a28ae98af..f8912d7c9e35 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-rst-docstrings/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-rst-docstrings/METADATA.toml @@ -1,2 +1,2 @@ version = "0.4.*" -upstream_repository = "https://github.com/peterjc/flake8-rst-docstrings" +upstream-repository = "https://github.com/peterjc/flake8-rst-docstrings" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-rst-docstrings/flake8_rst_docstrings.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-rst-docstrings/flake8_rst_docstrings.pyi index 1ccdb3d63c8c..b04ae53ef63b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-rst-docstrings/flake8_rst_docstrings.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-rst-docstrings/flake8_rst_docstrings.pyi @@ -31,4 +31,4 @@ class reStructuredTextChecker: def add_options(cls, parser: Any) -> None: ... @classmethod def parse_options(cls, options: Namespace) -> None: ... - def run(self) -> Generator[tuple[int, int, str, type[reStructuredTextChecker]], None, None]: ... + def run(self) -> Generator[tuple[int, int, str, type[reStructuredTextChecker]]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-simplify/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-simplify/METADATA.toml index 55561890fd38..5ef28e476ab3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-simplify/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-simplify/METADATA.toml @@ -1,2 +1,2 @@ version = "0.30.*" -upstream_repository = "https://github.com/MartinThoma/flake8-simplify" +upstream-repository = "https://github.com/MartinThoma/flake8-simplify" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-simplify/flake8_simplify/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8-simplify/flake8_simplify/__init__.pyi index 6aaaeb06353a..161c2bf90499 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-simplify/flake8_simplify/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-simplify/flake8_simplify/__init__.pyi @@ -26,6 +26,6 @@ class Plugin: name: ClassVar[str] version: ClassVar[str] def __init__(self, tree: ast.AST) -> None: ... - def run(self) -> Generator[tuple[int, int, str, type[Any]], None, None]: ... + def run(self) -> Generator[tuple[int, int, str, type[Any]]]: ... def add_meta(root: ast.AST, level: int = 0) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/METADATA.toml index 735cd46f5175..77ede4ca1037 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-typing-imports/METADATA.toml @@ -1,2 +1,2 @@ version = "1.17.*" -upstream_repository = "https://github.com/asottile/flake8-typing-imports" +upstream-repository = "https://github.com/asottile/flake8-typing-imports" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8/METADATA.toml index f84346a54668..7a39dcb38917 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8/METADATA.toml @@ -1,3 +1,3 @@ version = "7.3.*" -upstream_repository = "https://github.com/pycqa/flake8" -requires = ["types-pyflakes"] +upstream-repository = "https://github.com/pycqa/flake8" +dependencies = ["types-pyflakes"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/discover_files.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/discover_files.pyi index d00b1f347e66..aca433fa617c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/discover_files.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/discover_files.pyi @@ -5,4 +5,4 @@ LOG: Logger def expand_paths( *, paths: Sequence[str], stdin_display_name: str, filename_patterns: Sequence[str], exclude: Sequence[str] -) -> Generator[str, None, None]: ... +) -> Generator[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/plugins/finder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/plugins/finder.pyi index 0f1949fa6849..8a8a7d49a099 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/plugins/finder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/plugins/finder.pyi @@ -31,7 +31,7 @@ class Plugins(NamedTuple): checkers: Checkers reporters: dict[str, LoadedPlugin] disabled: list[LoadedPlugin] - def all_plugins(self) -> Generator[LoadedPlugin, None, None]: ... + def all_plugins(self) -> Generator[LoadedPlugin]: ... def versions_str(self) -> str: ... class PluginOptions(NamedTuple): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/plugins/pycodestyle.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/plugins/pycodestyle.pyi index 2a4194f96a17..108770a0ae93 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/plugins/pycodestyle.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/plugins/pycodestyle.pyi @@ -19,7 +19,7 @@ def pycodestyle_logical( previous_unindented_logical_line: Any, tokens: Any, verbose: Any, -) -> Generator[tuple[int, str], None, None]: ... +) -> Generator[tuple[int, str]]: ... def pycodestyle_physical( indent_char: Any, line_number: Any, @@ -29,4 +29,4 @@ def pycodestyle_physical( noqa: Any, physical_line: Any, total_lines: Any, -) -> Generator[tuple[int, str], None, None]: ... +) -> Generator[tuple[int, str]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/plugins/pyflakes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/plugins/pyflakes.pyi index 3acc52ecec14..6453e63d8385 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/plugins/pyflakes.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/plugins/pyflakes.pyi @@ -18,4 +18,4 @@ class FlakesChecker(Checker): def add_options(cls, parser: OptionManager) -> None: ... @classmethod def parse_options(cls, options: Namespace) -> None: ... - def run(self) -> Generator[tuple[int, int, str, type[Any]], None, None]: ... + def run(self) -> Generator[tuple[int, int, str, type[Any]]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/processor.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/processor.pyi index f193a21840be..8147ab3ee53f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/processor.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/processor.pyi @@ -45,7 +45,7 @@ class FileProcessor: def file_tokens(self) -> list[TokenInfo]: ... def tstring_start(self, lineno: int) -> None: ... def fstring_start(self, lineno: int) -> None: ... - def multiline_string(self, token: TokenInfo) -> Generator[str, None, None]: ... + def multiline_string(self, token: TokenInfo) -> Generator[str]: ... def reset_blank_before(self) -> None: ... def delete_first_token(self) -> None: ... def visited_new_blank_line(self) -> None: ... @@ -56,7 +56,7 @@ class FileProcessor: def build_ast(self) -> AST: ... def build_logical_line(self) -> tuple[str, str, _LogicalMapping]: ... def keyword_arguments_for(self, parameters: dict[str, bool], arguments: dict[str, Any]) -> dict[str, Any]: ... - def generate_tokens(self) -> Generator[TokenInfo, None, None]: ... + def generate_tokens(self) -> Generator[TokenInfo]: ... def noqa_line_for(self, line_number: int) -> str | None: ... def next_line(self) -> str: ... def read_lines(self) -> list[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/statistics.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/statistics.pyi index c6a892985637..5b7d1f551e44 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/statistics.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/statistics.pyi @@ -7,7 +7,7 @@ class Statistics: def __init__(self) -> None: ... def error_codes(self) -> list[str]: ... def record(self, error: Violation) -> None: ... - def statistics_for(self, prefix: str, filename: str | None = None) -> Generator[Statistic, None, None]: ... + def statistics_for(self, prefix: str, filename: str | None = None) -> Generator[Statistic]: ... class Key(NamedTuple): filename: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/style_guide.pyi b/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/style_guide.pyi index 7b4db3b95330..bc27ec55b820 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/style_guide.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8/flake8/style_guide.pyi @@ -41,8 +41,8 @@ class StyleGuideManager: default_style_guide: Incomplete style_guide_for: Incomplete def __init__(self, options: argparse.Namespace, formatter: BaseFormatter, decider: DecisionEngine | None = None) -> None: ... - def populate_style_guides_with(self, options: argparse.Namespace) -> Generator[StyleGuide, None, None]: ... - def processing_file(self, filename: str) -> Generator[StyleGuide, None, None]: ... + def populate_style_guides_with(self, options: argparse.Namespace) -> Generator[StyleGuide]: ... + def processing_file(self, filename: str) -> Generator[StyleGuide]: ... def handle_error( self, code: str, filename: str, line_number: int, column_number: int, text: str, physical_line: str | None = None ) -> int: ... @@ -62,7 +62,7 @@ class StyleGuide: decider: DecisionEngine | None = None, ) -> None: ... def copy(self, filename: str | None = None, extend_ignore_with: Sequence[str] | None = None) -> StyleGuide: ... - def processing_file(self, filename: str) -> Generator[StyleGuide, None, None]: ... + def processing_file(self, filename: str) -> Generator[StyleGuide]: ... def applies_to(self, filename: str) -> bool: ... def should_report_error(self, code: str) -> Decision: ... def handle_error( diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/METADATA.toml index 0a8398549e31..98fa4b298c86 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/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"] -obsolete_since = "2.8.6" # Released on 2026-02-19 +upstream-repository = "https://github.com/py-pdf/fpdf2" +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/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/_fonttools_shims.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/_fonttools_shims.pyi index f68d651014d6..499c8861ce83 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/_fonttools_shims.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/_fonttools_shims.pyi @@ -2,10 +2,11 @@ from abc import ABCMeta, abstractmethod from collections.abc import Mapping from logging import Logger -from typing import Any, Protocol +from typing import Any, Protocol, type_check_only from typing_extensions import TypeAlias # from fonttools.ttLib.ttGlyphSet +@type_check_only class _TTGlyph(Protocol): def __init__(self, glyphSet: _TTGlyphSet, glyphName: str) -> None: ... def draw(self, pen) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/drawing.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/drawing.pyi index c393f1f7eaa7..94b23cdd371b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/drawing.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/drawing.pyi @@ -59,7 +59,7 @@ class GraphicsStateDictRegistry(OrderedDict[Raw, Name]): def number_to_str(number: Number) -> str: ... def render_pdf_primitive(primitive: _Primitive) -> Raw: ... - +@type_check_only class _DeviceRGBBase(NamedTuple): r: Number g: Number @@ -75,6 +75,7 @@ class DeviceRGB(_DeviceRGBBase): def colors255(self) -> tuple[Number, Number, Number]: ... def serialize(self) -> str: ... +@type_check_only class _DeviceGrayBase(NamedTuple): g: Number a: Number | None @@ -88,6 +89,7 @@ class DeviceGray(_DeviceGrayBase): def colors255(self) -> tuple[Number, Number, Number]: ... def serialize(self) -> str: ... +@type_check_only class _DeviceCMYKBase(NamedTuple): c: Number m: Number diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/encryption.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/encryption.pyi index 3c3edabd53f4..21ebb3b4c155 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/encryption.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/encryption.pyi @@ -22,7 +22,7 @@ class _SupportsGetItem(Protocol[_T_co]): class ARC4: MOD: ClassVar[int] def KSA(self, key: _Key) -> list[int]: ... - def PRGA(self, S: _SupportsGetItem[int]) -> Generator[int, None, None]: ... + def PRGA(self, S: _SupportsGetItem[int]) -> Generator[int]: ... def encrypt(self, key: _Key, text: Iterable[int]) -> list[int]: ... class CryptFilter: diff --git a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/fonts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/fonts.pyi index 72d97ebd1e73..3b57d67408e8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/fonts.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/fpdf2/fpdf/fonts.pyi @@ -171,7 +171,7 @@ class SubsetMap: font: TTFFont def __init__(self, font: TTFFont) -> None: ... def __len__(self) -> int: ... - def items(self) -> Generator[Incomplete, None, None]: ... + def items(self) -> Generator[Incomplete]: ... def pick(self, unicode: int): ... def pick_glyph(self, glyph): ... def get_glyph(self, glyph=None, unicode=None, glyph_name=None, glyph_width=None) -> Glyph: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gdb/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/gdb/METADATA.toml index 876bec4ebb3b..5fcf687ea80b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gdb/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/gdb/METADATA.toml @@ -1,8 +1,8 @@ version = "16.3.*" # This is the official web portal for the GDB Git repo, # see https://sourceware.org/gdb/current/ for other ways of obtaining the source code. -upstream_repository = "https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=tree" -extra_description = """\ +upstream-repository = "https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=tree" +extra-description = """\ Type hints for GDB's \ [Python API](https://sourceware.org/gdb/onlinedocs/gdb/Python-API.html). \ Note that this API is available only when running Python scripts under GDB: \ @@ -12,5 +12,5 @@ extra_description = """\ [tool.stubtest] skip = true # https://github.com/python/typeshed/issues/15236 -ci_platforms = ["linux"] -apt_dependencies = ["gdb"] +ci-platforms = ["linux"] +apt-dependencies = ["gdb"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/geopandas/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/geopandas/METADATA.toml index eabfde716d6a..8682d2664017 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/geopandas/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/geopandas/METADATA.toml @@ -1,9 +1,9 @@ -version = "1.1.2" +version = "1.1.3" # Requires a version of numpy with a `py.typed` file -requires = ["numpy>=1.20", "pandas-stubs", "types-shapely", "pyproj"] -upstream_repository = "https://github.com/geopandas/geopandas" +dependencies = ["numpy>=1.20", "pandas-stubs", "types-shapely", "pyproj"] +upstream-repository = "https://github.com/geopandas/geopandas" [tool.stubtest] # libproj-dev and proj-bin are required to build pyproj if wheels for the # target Python version are not available. -apt_dependencies = ["libproj-dev", "proj-bin"] +apt-dependencies = ["libproj-dev", "proj-bin"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gevent/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/gevent/METADATA.toml index 58869c1ac94e..16942f987b30 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gevent/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/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"] +version = "26.4.*" +upstream-repository = "https://github.com/gevent/gevent" +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"] +ci-platforms = ["linux", "darwin", "win32"] # for testing the ffi loop implementations on all platforms -stubtest_requirements = ["cffi", "dnspython"] -apt_dependencies = ["libev4", "libev-dev", "libuv1", "libuv1-dev"] -brew_dependencies = ["libev", "libuv"] +stubtest-dependencies = ["cffi", "dnspython"] +apt-dependencies = ["libev4", "libev-dev", "libuv1", "libuv1-dev"] +brew-dependencies = ["libev", "libuv"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gevent/gevent/_types.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gevent/gevent/_types.pyi index 16db1f4d497f..ea0263a1b56c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gevent/gevent/_types.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/gevent/gevent/_types.pyi @@ -2,7 +2,7 @@ import sys from _typeshed import FileDescriptor, StrOrBytesPath from collections.abc import Callable from types import TracebackType -from typing import Any, Literal, Protocol, overload +from typing import Any, Literal, Protocol, overload, type_check_only from typing_extensions import TypeAlias, TypeVarTuple, Unpack _Ts = TypeVarTuple("_Ts") @@ -19,6 +19,7 @@ _Ts = TypeVarTuple("_Ts") # properties and methods that are available on all event loops, so these have # been added as well, instead of completely mirroring the internal interface +@type_check_only class _Loop(Protocol): # noqa: Y046 @property def approx_timer_resolution(self) -> float: ... @@ -66,6 +67,7 @@ class _Loop(Protocol): # noqa: Y046 def run_callback_threadsafe(self, func: Callable[[Unpack[_Ts]], Any], *args: Unpack[_Ts]) -> _Callback: ... def fileno(self) -> FileDescriptor | None: ... +@type_check_only class _Watcher(Protocol): # while IWatcher allows for kwargs the actual implementation does not... def start(self, callback: Callable[[Unpack[_Ts]], Any], *args: Unpack[_Ts]) -> None: ... @@ -73,6 +75,7 @@ class _Watcher(Protocol): def close(self) -> None: ... # this matches Intersection[_Watcher, TimerMixin] +@type_check_only class _TimerWatcher(_Watcher, Protocol): # this has one specific allowed keyword argument, if it is given we don't try to check # the passed in arguments, but if it isn't passed in, then we do. @@ -86,6 +89,7 @@ class _TimerWatcher(_Watcher, Protocol): def again(self, callback: Callable[[Unpack[_Ts]], Any], *args: Unpack[_Ts]) -> None: ... # this matches Intersection[_Watcher, IoMixin] +@type_check_only class _IoWatcher(_Watcher, Protocol): EVENT_MASK: int # pass_events means the first argument of the callback needs to be an integer, but we can't @@ -96,6 +100,7 @@ class _IoWatcher(_Watcher, Protocol): def start(self, callback: Callable[[Unpack[_Ts]], Any], *args: Unpack[_Ts]) -> None: ... # this matches Intersection[_Watcher, ChildMixin] +@type_check_only class _ChildWatcher(_Watcher, Protocol): @property def pid(self) -> int: ... @@ -105,6 +110,7 @@ class _ChildWatcher(_Watcher, Protocol): def rstatus(self) -> int: ... # this matches Intersection[_Watcher, AsyncMixin] +@type_check_only class _AsyncWatcher(_Watcher, Protocol): def send(self) -> None: ... def send_ignoring_arg(self, ignored: object, /) -> None: ... @@ -112,11 +118,13 @@ class _AsyncWatcher(_Watcher, Protocol): def pending(self) -> bool: ... # all implementations return something of this shape +@type_check_only class _StatResult(Protocol): @property def st_nlink(self) -> int: ... # this matches Intersection[_Watcher, StatMixin] +@type_check_only class _StatWatcher(_Watcher, Protocol): @property def path(self) -> StrOrBytesPath: ... @@ -127,6 +135,7 @@ class _StatWatcher(_Watcher, Protocol): @property def interval(self) -> float: ... +@type_check_only class _Callback(Protocol): pending: bool def stop(self) -> None: ... @@ -137,6 +146,7 @@ _SockAddr: TypeAlias = _FullSockAddr | tuple[str, int] _AddrinfoResult: TypeAlias = list[tuple[int, int, int, str, _SockAddr]] # family, type, protocol, cname, sockaddr _NameinfoResult: TypeAlias = tuple[str, str] +@type_check_only class _Resolver(Protocol): # noqa: Y046 def close(self) -> None: ... def gethostbyname(self, hostname: str, family: int = 2) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/METADATA.toml index 5b272480a460..fb13602f4b47 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/METADATA.toml @@ -1,6 +1,6 @@ version = "2.4.*" -upstream_repository = "https://github.com/googleapis/python-ndb" -partial_stub = true +upstream-repository = "https://github.com/googleapis/python-ndb" +partial-stub = true [tool.stubtest] -ignore_missing_stub = true +ignore-missing-stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_cache.pyi b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_cache.pyi index 3f416ed306b7..1047e3028f53 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_cache.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/google-cloud-ndb/google/cloud/ndb/_cache.pyi @@ -33,12 +33,12 @@ class _GlobalCacheSetBatch(_GlobalCacheBatch): def done_callback(self, cache_call) -> None: ... def add(self, key, value): ... def make_call(self): ... - def future_info(self, key, value): ... # type:ignore[override] + def future_info(self, key, value): ... # type: ignore[override] class _GlobalCacheSetIfNotExistsBatch(_GlobalCacheSetBatch): def add(self, key, value): ... def make_call(self): ... - def future_info(self, key, value): ... # type:ignore[override] + def future_info(self, key, value): ... # type: ignore[override] global_delete: Incomplete @@ -54,7 +54,7 @@ global_watch: Incomplete class _GlobalCacheWatchBatch(_GlobalCacheDeleteBatch): def make_call(self): ... - def future_info(self, key, value): ... # type:ignore[override] + def future_info(self, key, value): ... # type: ignore[override] def global_unwatch(key): ... @@ -66,7 +66,7 @@ global_compare_and_swap: Incomplete class _GlobalCacheCompareAndSwapBatch(_GlobalCacheSetBatch): def make_call(self): ... - def future_info(self, key, value): ... # type:ignore[override] + def future_info(self, key, value): ... # type: ignore[override] def is_locked_value(value): ... def global_cache_key(key): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/greenlet/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/greenlet/METADATA.toml index c1978835e4eb..7775d2903447 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/greenlet/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/greenlet/METADATA.toml @@ -1,2 +1,2 @@ -version = "3.3.*" -upstream_repository = "https://github.com/python-greenlet/greenlet" +version = "3.4.*" +upstream-repository = "https://github.com/python-greenlet/greenlet" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/grpcio-channelz/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/grpcio-channelz/METADATA.toml index bac12ed6b8d8..b12e58c39175 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/grpcio-channelz/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/grpcio-channelz/METADATA.toml @@ -1,3 +1,3 @@ version = "1.*" -upstream_repository = "https://github.com/grpc/grpc" -requires = ["types-grpcio", "types-protobuf"] +upstream-repository = "https://github.com/grpc/grpc" +dependencies = ["types-grpcio", "types-protobuf"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/grpcio-health-checking/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/grpcio-health-checking/METADATA.toml index bac12ed6b8d8..b12e58c39175 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/grpcio-health-checking/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/grpcio-health-checking/METADATA.toml @@ -1,3 +1,3 @@ version = "1.*" -upstream_repository = "https://github.com/grpc/grpc" -requires = ["types-grpcio", "types-protobuf"] +upstream-repository = "https://github.com/grpc/grpc" +dependencies = ["types-grpcio", "types-protobuf"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/grpcio-reflection/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/grpcio-reflection/METADATA.toml index bac12ed6b8d8..b12e58c39175 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/grpcio-reflection/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/grpcio-reflection/METADATA.toml @@ -1,3 +1,3 @@ version = "1.*" -upstream_repository = "https://github.com/grpc/grpc" -requires = ["types-grpcio", "types-protobuf"] +upstream-repository = "https://github.com/grpc/grpc" +dependencies = ["types-grpcio", "types-protobuf"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/grpcio-status/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/grpcio-status/METADATA.toml index f70c0410a6a0..3591441645d2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/grpcio-status/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/grpcio-status/METADATA.toml @@ -1,3 +1,3 @@ version = "1.*" -upstream_repository = "https://github.com/grpc/grpc" -requires = ["types-grpcio"] +upstream-repository = "https://github.com/grpc/grpc" +dependencies = ["types-grpcio"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/grpcio/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/grpcio/METADATA.toml index b81a42967303..29fdcfc493d8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/grpcio/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/grpcio/METADATA.toml @@ -1,6 +1,6 @@ version = "1.*" -upstream_repository = "https://github.com/grpc/grpc" -partial_stub = true +upstream-repository = "https://github.com/grpc/grpc" +partial-stub = true [tool.stubtest] -ignore_missing_stub = true +ignore-missing-stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/METADATA.toml index 98ac9a6a255b..6f6a8c4a4ed8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/METADATA.toml @@ -1,8 +1,8 @@ -version = "25.1.0" -upstream_repository = "https://github.com/benoitc/gunicorn" -requires = ["types-gevent"] +version = "25.3.0" +upstream-repository = "https://github.com/benoitc/gunicorn" +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"] +supported-platforms = ["linux", "darwin"] +ci-platforms = ["linux", "darwin"] +stubtest-dependencies = ["gevent>=1.4.0", "eventlet>=0.24.1,!=0.36.0", "tornado>=0.2", "setproctitle", "PasteDeploy", "inotify"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/__init__.pyi index 7469610eac93..0e635cb1217d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/__init__.pyi @@ -1,5 +1,4 @@ from gunicorn.asgi.lifespan import LifespanManager as LifespanManager -from gunicorn.asgi.message import AsyncRequest as AsyncRequest from gunicorn.asgi.unreader import AsyncUnreader as AsyncUnreader -__all__ = ["AsyncUnreader", "AsyncRequest", "LifespanManager"] +__all__ = ["AsyncUnreader", "LifespanManager"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/message.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/message.pyi deleted file mode 100644 index a279e34cdd91..000000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/message.pyi +++ /dev/null @@ -1,50 +0,0 @@ -import re -from typing import Final, Literal -from typing_extensions import Self - -from gunicorn.asgi.unreader import AsyncUnreader -from gunicorn.config import Config - -from .._types import _AddressType - -MAX_REQUEST_LINE: Final = 8190 -MAX_HEADERS: Final = 32768 -DEFAULT_MAX_HEADERFIELD_SIZE: Final = 8190 -RFC9110_5_6_2_TOKEN_SPECIALS: Final = r"!#$%&'*+-.^_`|~" -TOKEN_RE: Final[re.Pattern[str]] -METHOD_BADCHAR_RE: Final[re.Pattern[str]] -VERSION_RE: Final[re.Pattern[str]] -RFC9110_5_5_INVALID_AND_DANGEROUS: Final[re.Pattern[str]] - -class AsyncRequest: - cfg: Config - unreader: AsyncUnreader - peer_addr: _AddressType - remote_addr: _AddressType - req_number: int - version: tuple[int, int] | None - method: str | None - uri: str | None - path: str | None - query: str | None - fragment: str | None - headers: list[tuple[str, str]] - trailers: list[tuple[str, str]] - scheme: Literal["https", "http"] - must_close: bool - proxy_protocol_info: dict[str, str | int | None] | None # TODO: Use TypedDict - limit_request_line: int - limit_request_fields: int - limit_request_field_size: int - max_buffer_headers: int - content_length: int | None - chunked: bool - - def __init__(self, cfg: Config, unreader: AsyncUnreader, peer_addr: _AddressType, req_number: int = 1) -> None: ... - @classmethod - async def parse(cls, cfg: Config, unreader: AsyncUnreader, peer_addr: _AddressType, req_number: int = 1) -> Self: ... - def force_close(self) -> None: ... - def should_close(self) -> bool: ... - def get_header(self, name: str) -> str | None: ... - async def read_body(self, size: int = 8192) -> bytes: ... - async def drain_body(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/parser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/parser.pyi new file mode 100644 index 000000000000..f36970b1c8a5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/parser.pyi @@ -0,0 +1,157 @@ +from collections.abc import Callable, Iterable +from enum import IntEnum +from typing import Any, Final, Literal, SupportsIndex, TypedDict, type_check_only +from typing_extensions import Self, TypeAlias + +_H1CProtocol: TypeAlias = Any # gunicorn_h1c H1CProtocol class + +class ParseError(Exception): ... +class InvalidProxyLine(ParseError): ... +class InvalidProxyHeader(ParseError): ... + +PP_V2_SIGNATURE: Final[bytes] + +class PPCommand(IntEnum): + LOCAL = 0x0 + PROXY = 0x1 + +class PPFamily(IntEnum): + UNSPEC = 0x0 + INET = 0x1 + INET6 = 0x2 + UNIX = 0x3 + +class PPProtocol(IntEnum): + UNSPEC = 0x0 + STREAM = 0x1 + DGRAM = 0x2 + +class LimitRequestLine(ParseError): ... +class InvalidRequestLine(ParseError): ... +class LimitRequestHeaders(ParseError): ... +class InvalidRequestMethod(ParseError): ... +class InvalidHTTPVersion(ParseError): ... +class InvalidHeaderName(ParseError): ... +class InvalidHeader(ParseError): ... +class UnsupportedTransferCoding(ParseError): ... +class InvalidChunkSize(ParseError): ... +class InvalidChunkExtension(ParseError): ... + +@type_check_only +class _ProxyProtocolInfo(TypedDict): + proxy_protocol: Literal["TCP4", "TCP6", "UDP4", "UDP6"] + client_addr: str + client_port: int + proxy_addr: str + proxy_port: int + +@type_check_only +class _ProxyProtocolInfoUnknown(TypedDict): + proxy_protocol: Literal["UNKNOWN", "LOCAL", "UNSPEC"] + client_addr: None + client_port: None + proxy_addr: None + proxy_port: None + +class PythonProtocol: + __slots__ = ( + "_on_message_begin", + "_on_url", + "_on_header", + "_on_headers_complete", + "_on_body", + "_on_message_complete", + "_state", + "_buffer", + "_headers_list", + "method", + "path", + "http_version", + "headers", + "content_length", + "is_chunked", + "should_keep_alive", + "is_complete", + "_body_remaining", + "_skip_body", + "_chunk_state", + "_chunk_size", + "_chunk_remaining", + "_limit_request_line", + "_limit_request_fields", + "_limit_request_field_size", + "_permit_unconventional_http_method", + "_permit_unconventional_http_version", + "_header_count", + "_proxy_protocol", + "_proxy_protocol_info", + "_proxy_protocol_done", + ) + method: bytes | None + path: bytes | None + http_version: tuple[int, int] | None + headers: list[tuple[bytes, bytes]] + content_length: int | None + is_chunked: bool + should_keep_alive: bool + is_complete: bool + + def __init__( + self, + on_message_begin: Callable[[], object] | None = None, + on_url: Callable[[bytes], object] | None = None, + on_header: Callable[[bytes, bytes], object] | None = None, + on_headers_complete: Callable[[], bool] | None = None, + on_body: Callable[[bytes], object] | None = None, + on_message_complete: Callable[[], object] | None = None, + limit_request_line: int = 8190, + limit_request_fields: int = 100, + limit_request_field_size: int = 8190, + permit_unconventional_http_method: bool = False, + permit_unconventional_http_version: bool = False, + proxy_protocol: Literal["off", "v1", "v2", "auto"] = "off", + ) -> None: ... + def feed(self, data: Iterable[SupportsIndex]) -> None: ... + @property + def proxy_protocol_info(self) -> _ProxyProtocolInfo | _ProxyProtocolInfoUnknown | None: ... + def reset(self) -> None: ... + def finish(self) -> None: ... + +class CallbackRequest: + __slots__ = ( + "method", + "uri", + "path", + "query", + "fragment", + "version", + "headers", + "headers_bytes", + "scheme", + "raw_path", + "content_length", + "chunked", + "must_close", + "proxy_protocol_info", + "_expect_100_continue", + ) + method: str | None + uri: str | None + path: str | None + query: str | None + fragment: str | None + version: tuple[int, int] | None + headers: list[tuple[str, str]] + headers_bytes: list[tuple[bytes, bytes]] + scheme: Literal["https", "http"] + raw_path: bytes + content_length: int + chunked: bool + must_close: bool + proxy_protocol_info: dict[str, str | int | None] | None # TODO: Use TypedDict + + def __init__(self) -> None: ... + @classmethod + def from_parser(cls, parser: _H1CProtocol | PythonProtocol, is_ssl: bool = False) -> Self: ... + def should_close(self) -> bool: ... + def get_header(self, name: str) -> str | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/protocol.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/protocol.pyi index 7e757d334aa3..664c64d68db1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/protocol.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/protocol.pyi @@ -1,12 +1,29 @@ import asyncio from collections.abc import Iterable +from typing import Final, Literal, TypedDict, type_check_only +from typing_extensions import NotRequired +from gunicorn.asgi.parser import CallbackRequest from gunicorn.config import Config from gunicorn.glogging import Logger as GLogger from gunicorn.workers.gasgi import ASGIWorker from .._types import _ASGIAppType +HIGH_WATER_LIMIT: Final = 65536 + +class FlowControl: + __slots__ = ("_transport", "read_paused", "write_paused", "_is_writable_event") + read_paused: bool + write_paused: bool + + def __init__(self, transport: asyncio.BaseTransport) -> None: ... + async def drain(self) -> None: ... + def pause_reading(self) -> None: ... + def resume_reading(self) -> None: ... + def pause_writing(self) -> None: ... + def resume_writing(self) -> None: ... + class ASGIResponseInfo: status: str | int sent: int @@ -14,6 +31,23 @@ class ASGIResponseInfo: def __init__(self, status: str | int, headers: Iterable[tuple[str | bytes, str | bytes]], sent: int) -> None: ... +@type_check_only +class _BodyReceieverReceiveReturnType(TypedDict): + type: Literal["http.disconnect", "http.request"] + body: NotRequired[bytes] + more_body: NotRequired[bool] + +class BodyReceiver: + __slots__ = ("_chunks", "_complete", "_body_finished", "_closed", "_waiter", "request", "protocol") + request: CallbackRequest + protocol: ASGIProtocol + + def __init__(self, request: CallbackRequest, protocol: ASGIProtocol) -> None: ... + def feed(self, chunk: bytes) -> None: ... + def set_complete(self) -> None: ... + def signal_disconnect(self) -> None: ... + async def receive(self) -> _BodyReceieverReceiveReturnType: ... + class ASGIProtocol(asyncio.Protocol): worker: ASGIWorker cfg: Config diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/websocket.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/websocket.pyi index f51aafc33da3..457d53f0f637 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/websocket.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/asgi/websocket.pyi @@ -26,7 +26,6 @@ WS_GUID: Final = b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11" class WebSocketProtocol: transport: asyncio.Transport - reader: asyncio.StreamReader scope: _ScopeType app: _ASGIAppType log: GLogger @@ -35,7 +34,7 @@ class WebSocketProtocol: close_code: int | None close_reason: str | None - def __init__( - self, transport: asyncio.Transport, reader: asyncio.StreamReader, scope: _ScopeType, app: _ASGIAppType, log: GLogger - ) -> None: ... + def __init__(self, transport: asyncio.Transport, scope: _ScopeType, app: _ASGIAppType, log: GLogger) -> None: ... + def feed_data(self, data: bytes) -> None: ... + def feed_eof(self) -> None: ... async def run(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/config.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/config.pyi index b5fa328c6ee3..6d4c0c0f4ed8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/config.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/config.pyi @@ -76,6 +76,7 @@ _ASGILoopValidatorType: TypeAlias = Callable[[str | None], str] _ASGILifespanValidatorType: TypeAlias = Callable[[str | None], str] _HTTP2FrameSizeValidatorType: TypeAlias = Callable[[ConvertibleToInt], int] _HTTPProtocolsValidatorType: TypeAlias = Callable[[str | None], list[str]] +_HttpParserValidatorType: TypeAlias = Callable[[str | None], str] _ValidatorType: TypeAlias = ( # noqa: Y047 _BoolValidatorType @@ -92,6 +93,7 @@ _ValidatorType: TypeAlias = ( # noqa: Y047 | _ASGILifespanValidatorType | _HTTP2FrameSizeValidatorType | _HTTPProtocolsValidatorType + | _HttpParserValidatorType ) KNOWN_SETTINGS: list[Setting] @@ -1156,6 +1158,7 @@ class HeaderMap(Setting): def validate_asgi_loop(val: str | None) -> str: ... def validate_asgi_lifespan(val: str | None) -> str: ... +def validate_http_parser(val: str | None) -> str: ... class ASGILoop(Setting): name: ClassVar[str] @@ -1185,6 +1188,15 @@ class ASGIDisconnectGracePeriod(Setting): default: ClassVar[int] desc: ClassVar[str] +class HttpParser(Setting): + name: ClassVar[str] + section: ClassVar[str] + cli: ClassVar[list[str]] + meta: ClassVar[str] + validator: ClassVar[_HttpParserValidatorType] + default: ClassVar[str] + desc: ClassVar[str] + class RootPath(Setting): name: ClassVar[str] section: ClassVar[str] @@ -1291,6 +1303,7 @@ class ControlSocket(Setting): meta: ClassVar[str] validator: ClassVar[_StringValidatorType] default: ClassVar[str] + default_doc: ClassVar[str] desc: ClassVar[str] class ControlSocketMode(Setting): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/ctl/handlers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/ctl/handlers.pyi index f70f3d102a6d..7814cef1cb3c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/ctl/handlers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/ctl/handlers.pyi @@ -1,23 +1,113 @@ from _typeshed import Incomplete +from typing import Literal, TypedDict, type_check_only +from typing_extensions import NotRequired from gunicorn.arbiter import Arbiter +@type_check_only +class _Worker(TypedDict): + pid: int + age: int + booted: bool + last_heartbeat: float + aborted: NotRequired[bool] + apps: NotRequired[list[str]] + +@type_check_only +class _ShowWorkersReturnType(TypedDict): + workers: list[_Worker] + count: int + +@type_check_only +class _App(TypedDict): + import_path: str + worker_count: int | None + current_workers: int + worker_pids: list[int] + +@type_check_only +class _ShowDirtyReturnType(TypedDict): + enabled: bool + pid: int | None + workers: list[_Worker] + apps: list[_App] + +@type_check_only +class _ShowStatsReturnType(TypedDict): + uptime: float | None + pid: int + workers_current: int + workers_target: int + workers_spawned: int + workers_killed: int + reloads: int + dirty_arbiter_pid: int | None + +@type_check_only +class _ListenerInfo(TypedDict): + address: str + fd: int + type: Literal["unix", "tcp", "tcp6", "unknown"] + +@type_check_only +class _ShowListenersReturnType(TypedDict): + listeners: list[_ListenerInfo] + count: int + +@type_check_only +class _WorkerAddReturnType(TypedDict): + added: int + previous: int + total: int + +@type_check_only +class _WorkerRemovedReturnType(TypedDict): + removed: int + previous: int + total: int + +@type_check_only +class _WorkerKillSucessReturnType(TypedDict): + success: Literal[True] + killed: int + +@type_check_only +class _WorkerKillFailedReturnType(TypedDict): + success: Literal[False] + error: str + +@type_check_only +class _ReloadReturnType(TypedDict): + status: Literal["reloading"] + +@type_check_only +class _ReopenReturnType(TypedDict): + status: Literal["reopening"] + +@type_check_only +class _ShutdownReturnType(TypedDict): + status: Literal["shutting_down"] + mode: str + +@type_check_only +class _HelpReturnType(TypedDict): + commands: dict[str, str] + class CommandHandlers: arbiter: Arbiter def __init__(self, arbiter: Arbiter) -> None: ... - # TODO: Use TypedDict for next return types - def show_workers(self) -> dict[str, Incomplete]: ... - def show_dirty(self) -> dict[str, Incomplete]: ... + def show_workers(self) -> _ShowWorkersReturnType: ... + def show_dirty(self) -> _ShowDirtyReturnType: ... def show_config(self) -> dict[str, Incomplete]: ... - def show_stats(self) -> dict[str, Incomplete]: ... - def show_listeners(self) -> dict[str, Incomplete]: ... - def worker_add(self, count: int = 1) -> dict[str, Incomplete]: ... - def worker_remove(self, count: int = 1) -> dict[str, Incomplete]: ... - def worker_kill(self, pid: int) -> dict[str, Incomplete]: ... + def show_stats(self) -> _ShowStatsReturnType: ... + def show_listeners(self) -> _ShowListenersReturnType: ... + def worker_add(self, count: int = 1) -> _WorkerAddReturnType: ... + def worker_remove(self, count: int = 1) -> _WorkerRemovedReturnType: ... + def worker_kill(self, pid: int) -> _WorkerKillSucessReturnType | _WorkerKillFailedReturnType: ... def dirty_add(self, count: int = 1) -> dict[str, Incomplete]: ... def dirty_remove(self, count: int = 1) -> dict[str, Incomplete]: ... - def reload(self) -> dict[str, Incomplete]: ... - def reopen(self) -> dict[str, Incomplete]: ... - def shutdown(self, mode: str = "graceful") -> dict[str, Incomplete]: ... + def reload(self) -> _ReloadReturnType: ... + def reopen(self) -> _ReopenReturnType: ... + def shutdown(self, mode: str = "graceful") -> _ShutdownReturnType: ... def show_all(self) -> dict[str, Incomplete]: ... - def help(self) -> dict[str, Incomplete]: ... + def help(self) -> _HelpReturnType: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/glogging.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/glogging.pyi index f04f94909706..9cdbfa5e22af 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/glogging.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/glogging.pyi @@ -151,6 +151,8 @@ class Logger: extra: Mapping[str, object] | None = None, ) -> None: ... def atoms(self, resp: Response, req: Request, environ: _EnvironType, request_time: timedelta) -> _AtomsDict: ... + @property + def access_log_enabled(self) -> bool: ... def access(self, resp: Response, req: Request, environ: _EnvironType, request_time: timedelta) -> None: ... def now(self) -> str: ... def reopen_files(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/http/body.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/http/body.pyi index cc2735015b6a..07488d019f69 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/http/body.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/http/body.pyi @@ -7,7 +7,7 @@ from gunicorn.http.unreader import Unreader class ChunkedReader: req: Request - parser: Generator[bytes, None, None] | None + parser: Generator[bytes] | None buf: io.BytesIO def __init__(self, req: Request, unreader: Unreader) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/http/errors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/http/errors.pyi index ec80a8ff30eb..a7698a0973bc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/http/errors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/http/errors.pyi @@ -68,11 +68,15 @@ class ChunkMissingTerminator(IOError): def __init__(self, term: bytes) -> None: ... +class InvalidChunkExtension(IOError): + reason: str + def __init__(self, reason: str) -> None: ... + class LimitRequestLine(ParseException): size: int - max_size: int + max_size: int | None - def __init__(self, size: int, max_size: int) -> None: ... + def __init__(self, size: int, max_size: int | None = None) -> None: ... class LimitRequestHeaders(ParseException): msg: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/http/wsgi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/http/wsgi.pyi index 5dec598ca7d8..3c44489fd5c7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/http/wsgi.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/http/wsgi.pyi @@ -2,9 +2,10 @@ import io import logging import re import socket -from _typeshed import ReadableBuffer +from _typeshed import ReadableBuffer, Unused from collections.abc import Callable -from typing import Any, Final +from typing import Any, Final, Protocol, type_check_only +from typing_extensions import Self from gunicorn.config import Config from gunicorn.http import Request @@ -15,13 +16,24 @@ BLKSIZE: Final = 0x3FFFFFFF HEADER_VALUE_RE: Final[re.Pattern[str]] log: logging.Logger +@type_check_only +class _FileLikeProtocol(Protocol): + def read(self, size: int, /) -> bytes: ... + def seek(self, offset: int, /) -> object: ... + + # optional fields: + # def close(self) -> None: ... + # def fileno(self) -> int: ... + class FileWrapper: filelike: io.IOBase blksize: int close: Callable[[], None] | None - def __init__(self, filelike: io.IOBase, blksize: int = 8192) -> None: ... - def __getitem__(self, key: Any) -> bytes: ... + def __init__(self, filelike: _FileLikeProtocol, blksize: int = 8192) -> None: ... + def __getitem__(self, key: Unused) -> bytes: ... + def __iter__(self) -> Self: ... + def __next__(self) -> bytes: ... class WSGIErrorsWrapper(io.RawIOBase): streams: list[io.TextIOBase] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/http2/stream.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/http2/stream.pyi index 7f1aa378cd3f..5e7eecb15c19 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/http2/stream.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/http2/stream.pyi @@ -52,6 +52,7 @@ class HTTP2Stream: self, weight: int | None = None, depends_on: int | None = None, exclusive: bool | None = None ) -> None: ... def get_request_body(self) -> bytes: ... + async def read_body_chunk(self) -> bytes | None: ... def get_pseudo_headers(self) -> dict[str, Incomplete]: ... def get_regular_headers(self) -> list[tuple[str, Incomplete]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/pidfile.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/pidfile.pyi index 91fc1f421efe..9ff0d9dd91d0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/pidfile.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/pidfile.pyi @@ -1,6 +1,9 @@ from _typeshed import StrOrBytesPath class Pidfile: + fname: StrOrBytesPath + pid: int | None + def __init__(self, fname: StrOrBytesPath) -> None: ... def create(self, pid: int) -> None: ... def rename(self, path: StrOrBytesPath) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/util.pyi index 5ec09516cb2f..2f21a00eba19 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/util.pyi @@ -1,5 +1,5 @@ import types -from _typeshed import FileDescriptorLike, FileDescriptorOrPath, HasFileno, StrOrBytesPath +from _typeshed import FileDescriptorLike, FileDescriptorOrPath, StrOrBytesPath from inspect import _IntrospectableCallable, _ParameterKind from socket import socket from typing import Any, Literal, NoReturn @@ -39,7 +39,7 @@ def daemonize(enable_stdio_inheritance: bool = False) -> None: ... def seed() -> None: ... def check_is_writable(path: FileDescriptorOrPath) -> None: ... def to_bytestring(value: str | bytes, encoding: str = "utf8") -> bytes: ... -def has_fileno(obj: HasFileno) -> bool: ... +def has_fileno(obj: object) -> bool: ... def warn(msg: str) -> None: ... def make_fail_app(msg: str) -> _WSGIAppType: ... def split_request_uri(uri: str) -> SplitResult: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/workers/gthread.pyi b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/workers/gthread.pyi index 3c6c230bb340..26d30dfb3c48 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/workers/gthread.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/gunicorn/gunicorn/workers/gthread.pyi @@ -5,6 +5,7 @@ from collections.abc import Callable from concurrent.futures import Future, ThreadPoolExecutor from selectors import DefaultSelector from types import FrameType +from typing import Final from gunicorn.config import Config from gunicorn.glogging import Logger as GLogger @@ -15,6 +16,8 @@ from gunicorn.uwsgi.parser import UWSGIParser from .._types import _AddressType from . import base +DEFAULT_WORKER_DATA_TIMEOUT: Final = 5.0 + class TConn: cfg: Config sock: socket.socket @@ -24,10 +27,12 @@ class TConn: parser: HTTP2ServerConnection | UWSGIParser | RequestParser | None initialized: bool is_http2: bool + data_ready: bool def __init__(self, cfg: Config, sock: socket.socket, client: _AddressType, server: _AddressType) -> None: ... def init(self) -> None: ... def set_timeout(self) -> None: ... + def wait_for_data(self, timeout: float | None) -> bool: ... def close(self) -> None: ... class PollableMethodQueue: @@ -48,6 +53,7 @@ class ThreadWorker(base.Worker): poller: DefaultSelector method_queue: PollableMethodQueue keepalived_conns: deque[TConn] + pending_conns: deque[TConn] nr_conns: int alive: bool @@ -61,7 +67,9 @@ class ThreadWorker(base.Worker): def enqueue_req(self, conn: TConn) -> None: ... def accept(self, listener: socket.socket) -> None: ... def on_client_socket_readable(self, conn: TConn, client: socket.socket) -> None: ... + def on_pending_socket_readable(self, conn: TConn, client: socket.socket) -> None: ... def murder_keepalived(self) -> None: ... + def murder_pending(self) -> None: ... def is_parent_alive(self) -> bool: ... def wait_for_and_dispatch_events(self, timeout: float | None) -> None: ... def run(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/METADATA.toml index 168d2786a79a..844c9ace86f2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/METADATA.toml @@ -1,2 +1,2 @@ version = "2.25.*" -# upstream_repository = closed-source +# upstream-repository = closed-source diff --git a/packages/pyright-internal/typeshed-fallback/stubs/hnswlib/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/hnswlib/METADATA.toml index ac9eaa390c4f..f9dfc34c413b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/hnswlib/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/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"] -upstream_repository = "https://github.com/nmslib/hnswlib" +dependencies = ["numpy>=1.21"] +upstream-repository = "https://github.com/nmslib/hnswlib" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/METADATA.toml index 3f4ba61f3dc6..7049e9bd2e85 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/html5lib/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/html5lib/METADATA.toml @@ -1,6 +1,6 @@ version = "1.1.*" -upstream_repository = "https://github.com/html5lib/html5lib-python" -requires = ["types-webencodings"] +upstream-repository = "https://github.com/html5lib/html5lib-python" +dependencies = ["types-webencodings"] [tool.stubtest] extras = ["all"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/httplib2/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/httplib2/METADATA.toml index 4f87a1df0258..bca46d69b832 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/httplib2/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/httplib2/METADATA.toml @@ -1,2 +1,2 @@ version = "0.31.2" -upstream_repository = "https://github.com/httplib2/httplib2" +upstream-repository = "https://github.com/httplib2/httplib2" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/httplib2/httplib2/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/httplib2/httplib2/__init__.pyi index c61d1456bba3..2c03f0f50535 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/httplib2/httplib2/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/httplib2/httplib2/__init__.pyi @@ -102,11 +102,11 @@ class Credentials: def __init__(self) -> None: ... def add(self, name, password, domain: str = "") -> None: ... def clear(self) -> None: ... - def iter(self, domain) -> Generator[tuple[str, str], None, None]: ... + def iter(self, domain) -> Generator[tuple[str, str]]: ... class KeyCerts(Credentials): def add(self, key, cert, domain, password) -> None: ... # type: ignore[override] - def iter(self, domain) -> Generator[tuple[str, str, str], None, None]: ... # type: ignore[override] + def iter(self, domain) -> Generator[tuple[str, str, str]]: ... # type: ignore[override] class AllHosts: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/hvac/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/hvac/METADATA.toml index 413110cd4bfe..d8318cf01487 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/hvac/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/hvac/METADATA.toml @@ -1,3 +1,3 @@ version = "2.4.*" -upstream_repository = "https://github.com/hvac/hvac" -requires = ["types-requests"] +upstream-repository = "https://github.com/hvac/hvac" +dependencies = ["types-requests"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ibm-db/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/ibm-db/METADATA.toml index e754728c4eb2..2c5e4b2ed065 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ibm-db/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/ibm-db/METADATA.toml @@ -1,2 +1,2 @@ version = "3.2.8" -upstream_repository = "https://github.com/ibmdb/python-ibmdb" +upstream-repository = "https://github.com/ibmdb/python-ibmdb" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/icalendar/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/icalendar/METADATA.toml index 3596ada3cede..a530386b862a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/icalendar/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/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"] -obsolete_since = "7.0.0" # Released on 2026-02-11 +upstream-repository = "https://github.com/collective/icalendar" +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/packages/pyright-internal/typeshed-fallback/stubs/inifile/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/inifile/METADATA.toml index ff2e16bd47fd..5532296509e6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/inifile/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/inifile/METADATA.toml @@ -1,2 +1,2 @@ version = "0.4.*" -upstream_repository = "https://github.com/mitsuhiko/python-inifile" +upstream-repository = "https://github.com/mitsuhiko/python-inifile" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jmespath/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/jmespath/METADATA.toml index 1224477c0862..856988fbacb3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jmespath/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/jmespath/METADATA.toml @@ -1,2 +1,2 @@ version = "1.1.*" -upstream_repository = "https://github.com/jmespath/jmespath.py" +upstream-repository = "https://github.com/jmespath/jmespath.py" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonnet/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/jsonnet/METADATA.toml index ee234e839059..60c7cdd7f4e4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonnet/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonnet/METADATA.toml @@ -1,2 +1,2 @@ -version = "0.21.*" -upstream_repository = "https://github.com/google/jsonnet" +version = "0.22.*" +upstream-repository = "https://github.com/google/jsonnet" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/METADATA.toml index 4f3f6a57282a..a9b3778d2826 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/METADATA.toml @@ -1,6 +1,6 @@ version = "~=4.26.0" -upstream_repository = "https://github.com/python-jsonschema/jsonschema" -requires = ["referencing"] +upstream-repository = "https://github.com/python-jsonschema/jsonschema" +dependencies = ["referencing"] [tool.stubtest] extras = ["format"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_utils.pyi index 0ddd9c689191..ebaa71434feb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/_utils.pyi @@ -1,15 +1,20 @@ -from _typeshed import Incomplete, SupportsKeysAndGetItem, SupportsNext, SupportsRichComparison +from _typeshed import Incomplete, SupportsNext, SupportsRichComparison from collections.abc import Generator, Iterable, Iterator, Mapping, MutableMapping -from typing import Literal, TypeVar, overload +from typing import Any, Literal, TypeVar, overload _T = TypeVar("_T") -class URIDict(MutableMapping[str, str]): +class URIDict(MutableMapping[str, MutableMapping[str, Any]]): def normalize(self, uri: str) -> str: ... - store: dict[str, str] - def __init__(self, m: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]], /, **kwargs: str) -> None: ... - def __getitem__(self, uri: str) -> str: ... - def __setitem__(self, uri: str, value: str) -> None: ... + store: dict[str, MutableMapping[str, Any]] + def __init__( + self, + m: Mapping[str, MutableMapping[str, Any]] | Iterable[tuple[str, MutableMapping[str, Any]]], + /, + **kwargs: MutableMapping[str, Any], + ) -> None: ... + def __getitem__(self, uri: str) -> MutableMapping[str, Any]: ... + def __setitem__(self, uri: str, value: MutableMapping[str, Any]) -> None: ... def __delitem__(self, uri: str) -> None: ... def __iter__(self) -> Iterator[str]: ... def __len__(self) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/validators.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/validators.pyi index 4e93434f1d65..6d7e3bbdf1e8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/validators.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/jsonschema/validators.pyi @@ -96,6 +96,14 @@ class Draft202012Validator(_Validator): _Handler: TypeAlias = Callable[[str], Incomplete] +@deprecated( + "jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the " + "https://github.com/python-jsonschema/referencing library, which " + "provides more compliant referencing behavior as well as more " + "flexible APIs for customization. A future release will remove " + "RefResolver. Please file a feature request (on referencing) if you " + "are missing an API for the kind of customization you need." +) class RefResolver: referrer: dict[str, Incomplete] cache_remote: Incomplete @@ -105,7 +113,7 @@ class RefResolver: self, base_uri: str, referrer: dict[str, Incomplete], - store: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]] = ..., + store: Mapping[str, Mapping[str, Any]] | Iterable[tuple[str, Mapping[str, Any]]] = ..., cache_remote: bool = True, handlers: SupportsKeysAndGetItem[str, _Handler] | Iterable[tuple[str, _Handler]] = (), urljoin_cache=None, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/METADATA.toml index 53d468ec6b59..f59a594c5799 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/METADATA.toml @@ -1,3 +1,3 @@ -version = "1.5.*" -upstream_repository = "https://github.com/latchset/jwcrypto" -requires = ["cryptography"] +version = "1.5.7" +upstream-repository = "https://github.com/latchset/jwcrypto" +dependencies = ["cryptography"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwa.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwa.pyi index dc6aff867f17..e2932812cdcc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwa.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwa.pyi @@ -3,6 +3,7 @@ from collections.abc import Mapping from typing import ClassVar default_max_pbkdf2_iterations: int +default_enforce_hmac_key_length: bool class JWAAlgorithm(metaclass=ABCMeta): @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwe.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwe.pyi index 69d48ab2d806..8e40942e8914 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwe.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwe.pyi @@ -1,15 +1,18 @@ -from _typeshed import Incomplete -from collections.abc import Mapping, Sequence +from _typeshed import Incomplete, SupportsKeysAndGetItem +from collections.abc import Iterable from typing import Any -from typing_extensions import Self +from typing_extensions import LiteralString, Self from jwcrypto import common from jwcrypto.common import JWException, JWSEHeaderParameter, JWSEHeaderRegistry from jwcrypto.jwk import JWK, JWKSet default_max_compressed_size: int -JWEHeaderRegistry: Mapping[str, JWSEHeaderParameter] -default_allowed_algs: Sequence[str] +default_max_plaintext_size: int + +JWEHeaderRegistry: dict[LiteralString, JWSEHeaderParameter] + +default_allowed_algs: list[LiteralString] class InvalidJWEData(JWException): def __init__(self, message: str | None = None, exception: BaseException | None = None) -> None: ... @@ -23,6 +26,7 @@ class JWE: objects: dict[str, Any] plaintext: bytes | None header_registry: JWSEHeaderRegistry + flattened: bool cek: Incomplete decryptlog: list[str] | None def __init__( @@ -31,18 +35,23 @@ class JWE: protected: str | None = None, unprotected: str | None = None, aad: bytes | None = None, - algs: list[str] | None = None, + algs: list[LiteralString] | None = None, recipient: str | None = None, header: str | None = None, - header_registry: Mapping[str, JWSEHeaderParameter] | None = None, + header_registry: ( + SupportsKeysAndGetItem[LiteralString, JWSEHeaderParameter] + | Iterable[tuple[LiteralString, JWSEHeaderParameter]] + | None + ) = None, + flattened: bool = True, ) -> None: ... @property - def allowed_algs(self) -> list[str]: ... + def allowed_algs(self) -> list[LiteralString]: ... @allowed_algs.setter - def allowed_algs(self, algs: list[str]) -> None: ... + def allowed_algs(self, algs: list[LiteralString]) -> None: ... def add_recipient(self, key: JWK, header: dict[str, Any] | str | None = None) -> None: ... def serialize(self, compact: bool = False) -> str: ... - def decrypt(self, key: JWK | JWKSet) -> None: ... + def decrypt(self, key: JWK | JWKSet, max_plaintext: int = 0) -> None: ... def deserialize(self, raw_jwe: str | bytes, key: JWK | JWKSet | None = None) -> None: ... @property def payload(self) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwk.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwk.pyi index 721b4e892e9b..43b6dc5d5d50 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwk.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwk.pyi @@ -2,7 +2,7 @@ from _typeshed import Unused from collections.abc import Callable, Sequence from enum import Enum from typing import Any, Literal, NamedTuple, TypeVar, overload -from typing_extensions import Self, TypeAlias, deprecated +from typing_extensions import LiteralString, Self, TypeAlias, deprecated from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec, rsa @@ -62,18 +62,18 @@ class JWKParameter(NamedTuple): required: bool | None type: ParmType | None -JWKValuesRegistry: dict[str, dict[str, JWKParameter]] -JWKParamsRegistry: dict[str, JWKParameter] -JWKEllipticCurveRegistry: dict[str, str] +JWKValuesRegistry: dict[LiteralString, dict[LiteralString, JWKParameter]] +JWKParamsRegistry: dict[LiteralString, JWKParameter] +JWKEllipticCurveRegistry: dict[LiteralString, str] _JWKUseSupported: TypeAlias = Literal["sig", "enc"] JWKUseRegistry: dict[_JWKUseSupported, str] _JWKOperationSupported: TypeAlias = Literal[ "sign", "verify", "encrypt", "decrypt", "wrapKey", "unwrapKey", "deriveKey", "deriveBits" ] JWKOperationsRegistry: dict[_JWKOperationSupported, str] -JWKpycaCurveMap: dict[str, str] +JWKpycaCurveMap: dict[LiteralString, LiteralString] IANANamedInformationHashAlgorithmRegistry: dict[ - str, + LiteralString, hashes.SHA256 | hashes.SHA384 | hashes.SHA512 @@ -103,6 +103,7 @@ class InvalidJWKOperation(JWException): class InvalidJWKValue(JWException): ... class JWK(dict[str, Any]): + unsafe_skip_rsa_key_validation: bool def __init__(self, **kwargs) -> None: ... # `kty` and the other keyword arguments are passed as `params` to the called generator # function. The possible arguments depend on the value of `kty`. diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jws.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jws.pyi index 92c84ab787c7..fc3da3d62585 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jws.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jws.pyi @@ -1,14 +1,13 @@ from _typeshed import Incomplete -from collections.abc import Mapping from typing import Any, Literal -from typing_extensions import Self +from typing_extensions import LiteralString, Self from jwcrypto.common import JWException, JWSEHeaderParameter from jwcrypto.jwa import JWAAlgorithm from jwcrypto.jwk import JWK, JWKSet -JWSHeaderRegistry: Mapping[str, JWSEHeaderParameter] -default_allowed_algs: list[str] +JWSHeaderRegistry: dict[LiteralString, JWSEHeaderParameter] +default_allowed_algs: list[LiteralString] class InvalidJWSSignature(JWException): def __init__(self, message: str | None = None, exception: BaseException | None = None) -> None: ... @@ -38,7 +37,7 @@ class JWSCore: def verify(self, signature: bytes) -> Literal[True]: ... class JWS: - objects: Incomplete + objects: dict[str, Incomplete] verifylog: list[str] | None header_registry: Incomplete def __init__(self, payload=None, header_registry=None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwt.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwt.pyi index bb2cce86e2f1..385482d84cc0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwt.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/jwt.pyi @@ -1,11 +1,10 @@ -from collections.abc import Mapping from typing import Any, SupportsInt -from typing_extensions import deprecated +from typing_extensions import LiteralString, deprecated from jwcrypto.common import JWException, JWKeyNotFound from jwcrypto.jwk import JWK, JWKSet -JWTClaimsRegistry: Mapping[str, str] +JWTClaimsRegistry: dict[LiteralString, str] JWT_expect_type: bool class JWTExpired(JWException): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/version.pyi b/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/version.pyi new file mode 100644 index 000000000000..c5dd95466063 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/jwcrypto/jwcrypto/version.pyi @@ -0,0 +1,3 @@ +from typing import Final + +__version__: Final[str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/keyboard/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/METADATA.toml index 6a2335fd9e45..cda767908896 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/keyboard/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/METADATA.toml @@ -1,9 +1,9 @@ version = "0.13.*" -upstream_repository = "https://github.com/boppreh/keyboard" +upstream-repository = "https://github.com/boppreh/keyboard" # [tool.stubtest] # While the stubs slightly differ on Windows vs Linux. # It's only by possible mouse buttons and event literal types. # As well as returning a tuple of int/long from keyboard.mouse.get_position # The "mouse" module is obsoleted by the "mouse" package. -# ci_platforms = ["linux"] +# ci-platforms = ["linux"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/__init__.pyi index 432d233660fc..0185fa499417 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/keyboard/keyboard/__init__.pyi @@ -90,7 +90,7 @@ def get_hotkey_name(names: Iterable[str] | None = None) -> str: ... def read_event(suppress: bool = False) -> KeyboardEvent: ... def read_key(suppress: bool = False) -> _Key: ... def read_hotkey(suppress: bool = True) -> str: ... -def get_typed_strings(events: Iterable[KeyboardEvent], allow_backspace: bool = True) -> Generator[str, None, None]: ... +def get_typed_strings(events: Iterable[KeyboardEvent], allow_backspace: bool = True) -> Generator[str]: ... def start_recording( recorded_events_queue: Queue[KeyboardEvent] | None = None, ) -> tuple[Queue[KeyboardEvent], Callable[[], None]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/METADATA.toml index 47c015f41255..d50ccbe8478f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/METADATA.toml @@ -1,10 +1,10 @@ version = "2.9.*" -upstream_repository = "https://github.com/cannatag/ldap3" -requires = ["types-pyasn1"] +upstream-repository = "https://github.com/cannatag/ldap3" +dependencies = ["types-pyasn1"] [tool.stubtest] -apt_dependencies = ["libkrb5-dev"] +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"] +# brew-dependencies = ["krb5"] +# choco-dependencies = ["mitkerberos"] +stubtest-dependencies = ["gssapi"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/novell.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/novell.pyi index bfa4a1cdc14a..d3e9c48ef807 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/novell.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/novell.pyi @@ -41,7 +41,7 @@ class NmasSetUniversalPasswordResponseValue(Sequence): componentType: NamedTypes class ReplicaList(SequenceOf): - componentType: OctetString # type: ignore[assignment] + componentType: OctetString class ReplicaInfoRequestValue(Sequence): tagSet: TagSet diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4511.pyi b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4511.pyi index b7c71cb26539..83b9c2b71b44 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4511.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/ldap3/ldap3/protocol/rfc4511.pyi @@ -45,10 +45,10 @@ class AttributeValueAssertion(Sequence): class MatchingRuleId(LDAPString): ... class Vals(SetOf): - componentType: AttributeValue # type: ignore[assignment] + componentType: AttributeValue class ValsAtLeast1(SetOf): - componentType: AttributeValue # type: ignore[assignment] + componentType: AttributeValue subtypeSpec: ConstraintsIntersection class PartialAttribute(Sequence): @@ -58,7 +58,7 @@ class Attribute(Sequence): componentType: NamedTypes class AttributeList(SequenceOf): - componentType: Attribute # type: ignore[assignment] + componentType: Attribute class Simple(OctetString): tagSet: TagSet @@ -97,7 +97,7 @@ class URI(LDAPString): ... class Referral(SequenceOf): tagSet: TagSet - componentType: URI # type: ignore[assignment] + componentType: URI class ServerSaslCreds(OctetString): tagSet: TagSet @@ -117,7 +117,7 @@ class Control(Sequence): class Controls(SequenceOf): tagSet: TagSet - componentType: Control # type: ignore[assignment] + componentType: Control class Scope(Enumerated): namedValues: NamedValues @@ -129,7 +129,7 @@ class TypesOnly(Boolean): ... class Selector(LDAPString): ... class AttributeSelection(SequenceOf): - componentType: Selector # type: ignore[assignment] + componentType: Selector class MatchingRule(MatchingRuleId): tagSet: TagSet @@ -161,7 +161,7 @@ class Substring(Choice): class Substrings(SequenceOf): subtypeSpec: ConstraintsIntersection - componentType: Substring # type: ignore[assignment] + componentType: Substring class SubstringFilter(Sequence): tagSet: TagSet @@ -170,12 +170,12 @@ class SubstringFilter(Sequence): class And(SetOf): tagSet: TagSet subtypeSpec: ConstraintsIntersection - componentType: Filter # type: ignore[assignment] + componentType: Filter class Or(SetOf): tagSet: TagSet subtypeSpec: ConstraintsIntersection - componentType: Filter # type: ignore[assignment] + componentType: Filter class Not(Choice): ... @@ -201,7 +201,7 @@ class Filter(Choice): componentType: NamedTypes class PartialAttributeList(SequenceOf): - componentType: PartialAttribute # type: ignore[assignment] + componentType: PartialAttribute class Operation(Enumerated): namedValues: NamedValues @@ -210,7 +210,7 @@ class Change(Sequence): componentType: NamedTypes class Changes(SequenceOf): - componentType: Change # type: ignore[assignment] + componentType: Change class DeleteOldRDN(Boolean): ... @@ -256,7 +256,7 @@ class SearchRequest(Sequence): class SearchResultReference(SequenceOf): tagSet: TagSet subtypeSpec: ConstraintsIntersection - componentType: URI # type: ignore[assignment] + componentType: URI class SearchResultEntry(Sequence): tagSet: TagSet diff --git a/packages/pyright-internal/typeshed-fallback/stubs/lunardate/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/lunardate/METADATA.toml index aa8196792bf8..eefcfee41691 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/lunardate/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/lunardate/METADATA.toml @@ -1,2 +1,2 @@ version = "0.2.*" -upstream_repository = "https://github.com/lidaobing/python-lunardate" +upstream-repository = "https://github.com/lidaobing/python-lunardate" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/lupa/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/lupa/METADATA.toml index b82a8453e4c1..7867a8a93236 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/lupa/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/lupa/METADATA.toml @@ -1,2 +1,2 @@ version = "2.6.*" -upstream_repository = "https://github.com/scoder/lupa" +upstream-repository = "https://github.com/scoder/lupa" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/lzstring/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/lzstring/METADATA.toml index 01227b100e7a..22e4f392e123 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/lzstring/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/lzstring/METADATA.toml @@ -1,2 +1,2 @@ version = "1.0.*" -upstream_repository = "https://github.com/gkovacs/lz-string-python" +upstream-repository = "https://github.com/gkovacs/lz-string-python" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/m3u8/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/m3u8/METADATA.toml index 7dbe6dbefabc..eb4c10a4f5cc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/m3u8/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/m3u8/METADATA.toml @@ -1,2 +1,2 @@ version = "6.0.*" -upstream_repository = "https://github.com/globocom/m3u8" +upstream-repository = "https://github.com/globocom/m3u8" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/mock/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/mock/METADATA.toml index 84a697269e35..1436f5662373 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/mock/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/mock/METADATA.toml @@ -1,2 +1,2 @@ version = "5.2.*" -upstream_repository = "https://github.com/testing-cabal/mock" +upstream-repository = "https://github.com/testing-cabal/mock" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/mypy-extensions/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/mypy-extensions/METADATA.toml index 7d329474c424..33583f5d725b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/mypy-extensions/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/mypy-extensions/METADATA.toml @@ -1,2 +1,2 @@ version = "1.1.*" -upstream_repository = "https://github.com/python/mypy_extensions" +upstream-repository = "https://github.com/python/mypy_extensions" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/METADATA.toml index f3c466ea9a05..0d734f1277b1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/METADATA.toml @@ -1,5 +1,5 @@ version = "2.2.*" -upstream_repository = "https://github.com/PyMySQL/mysqlclient" +upstream-repository = "https://github.com/PyMySQL/mysqlclient" [tool.stubtest] -apt_dependencies = ["libmariadb-dev"] +apt-dependencies = ["libmariadb-dev"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/nanoid/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/nanoid/METADATA.toml index c0eb7f7b40ca..d2d220486c31 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/nanoid/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/nanoid/METADATA.toml @@ -1,2 +1,2 @@ version = "2.0.0" -upstream_repository = "https://github.com/puyuan/py-nanoid" +upstream-repository = "https://github.com/puyuan/py-nanoid" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/nanoleafapi/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/nanoleafapi/METADATA.toml index 4d240e218e47..4f4332fcd18c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/nanoleafapi/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/nanoleafapi/METADATA.toml @@ -1,2 +1,2 @@ version = "2.1.*" -upstream_repository = "https://github.com/MylesMor/nanoleafapi" +upstream-repository = "https://github.com/MylesMor/nanoleafapi" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/METADATA.toml index 770e9a0b2112..fbb5fc4b2ac0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/netaddr/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/netaddr/METADATA.toml @@ -1,2 +1,2 @@ version = "1.3.*" -upstream_repository = "https://github.com/netaddr/netaddr" +upstream-repository = "https://github.com/netaddr/netaddr" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/netifaces/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/netifaces/METADATA.toml index dadf1becdf8d..a6a6a2608f55 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/netifaces/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/netifaces/METADATA.toml @@ -1,2 +1,2 @@ version = "0.11.*" -upstream_repository = "https://github.com/al45tair/netifaces" +upstream-repository = "https://github.com/al45tair/netifaces" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/networkx/METADATA.toml index 417099c70922..80c1685dcf49 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/METADATA.toml @@ -1,8 +1,8 @@ version = "3.6.1" -upstream_repository = "https://github.com/networkx/networkx" +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/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/assortativity/pairs.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/assortativity/pairs.pyi index 08898fc2f30a..502d5346f0d6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/assortativity/pairs.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/assortativity/pairs.pyi @@ -7,10 +7,8 @@ from networkx.utils.backends import _dispatchable __all__ = ["node_attribute_xy", "node_degree_xy"] @_dispatchable -def node_attribute_xy( - G: Graph[_Node], attribute, nodes: Iterable[Incomplete] | None = None -) -> Generator[Incomplete, None, None]: ... +def node_attribute_xy(G: Graph[_Node], attribute, nodes: Iterable[Incomplete] | None = None) -> Generator[Incomplete]: ... @_dispatchable def node_degree_xy( G: Graph[_Node], x: str = "out", y: str = "in", weight: str | None = None, nodes: Iterable[Incomplete] | None = None -) -> Generator[Incomplete, None, None]: ... +) -> Generator[Incomplete]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/boundary.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/boundary.pyi index 7cbec735e1b5..b7a57b02820c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/boundary.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/boundary.pyi @@ -16,7 +16,7 @@ def edge_boundary( data=False, keys: bool = False, default=None, -) -> Generator[tuple[_Node, _Node], None, None]: ... +) -> Generator[tuple[_Node, _Node]]: ... @overload def edge_boundary( G: Graph[_Node], @@ -25,7 +25,7 @@ def edge_boundary( data=False, keys: bool = False, default=None, -) -> Generator[tuple[_Node, _Node, dict[str, Incomplete]], None, None]: ... +) -> Generator[tuple[_Node, _Node, dict[str, Incomplete]]]: ... @overload def edge_boundary( G: Graph[_Node], @@ -34,7 +34,7 @@ def edge_boundary( data=False, keys: bool = False, default=None, -) -> Generator[tuple[_Node, _Node, dict[str, Incomplete]], None, None]: ... +) -> Generator[tuple[_Node, _Node, dict[str, Incomplete]]]: ... @overload def edge_boundary( G: Graph[_Node], @@ -43,7 +43,7 @@ def edge_boundary( data=False, keys: bool = False, default: _U | None = None, -) -> Generator[tuple[_Node, _Node, dict[str, _U]], None, None]: ... +) -> Generator[tuple[_Node, _Node, dict[str, _U]]]: ... @overload def edge_boundary( G: Graph[_Node], @@ -52,7 +52,7 @@ def edge_boundary( data=False, keys: bool = False, default: _U | None = None, -) -> Generator[tuple[_Node, _Node, dict[str, _U]], None, None]: ... +) -> Generator[tuple[_Node, _Node, dict[str, _U]]]: ... @overload def edge_boundary( G: Graph[_Node], @@ -61,7 +61,7 @@ def edge_boundary( data=False, keys: bool = False, default=None, -) -> Generator[tuple[_Node, _Node, int], None, None]: ... +) -> Generator[tuple[_Node, _Node, int]]: ... @overload def edge_boundary( G: Graph[_Node], @@ -70,7 +70,7 @@ def edge_boundary( data=False, keys: bool = False, default=None, -) -> Generator[tuple[_Node, _Node, int], None, None]: ... +) -> Generator[tuple[_Node, _Node, int]]: ... @overload def edge_boundary( G: Graph[_Node], @@ -79,7 +79,7 @@ def edge_boundary( data=False, keys: bool = False, default=None, -) -> Generator[tuple[_Node, _Node, int, dict[str, Incomplete]], None, None]: ... +) -> Generator[tuple[_Node, _Node, int, dict[str, Incomplete]]]: ... @overload def edge_boundary( G: Graph[_Node], @@ -88,7 +88,7 @@ def edge_boundary( data=False, keys: bool = False, default=None, -) -> Generator[tuple[_Node, _Node, int, dict[str, Incomplete]], None, None]: ... +) -> Generator[tuple[_Node, _Node, int, dict[str, Incomplete]]]: ... @overload def edge_boundary( G: Graph[_Node], @@ -97,7 +97,7 @@ def edge_boundary( data=False, keys: bool = False, default: _U | None = None, -) -> Generator[tuple[_Node, _Node, int, dict[str, _U]], None, None]: ... +) -> Generator[tuple[_Node, _Node, int, dict[str, _U]]]: ... @overload def edge_boundary( G: Graph[_Node], @@ -106,6 +106,6 @@ def edge_boundary( data=False, keys: bool = False, default: _U | None = None, -) -> Generator[tuple[_Node, _Node, int, dict[str, _U]], None, None]: ... +) -> Generator[tuple[_Node, _Node, int, dict[str, _U]]]: ... @_dispatchable def node_boundary(G: Graph[_Node], nbunch1: Iterable[Incomplete], nbunch2: Iterable[Incomplete] | None = None) -> set[_Node]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/bridges.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/bridges.pyi index 530802159370..f76eb0276b41 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/bridges.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/bridges.pyi @@ -7,14 +7,10 @@ from networkx.utils.backends import _dispatchable __all__ = ["bridges", "has_bridges", "local_bridges"] @_dispatchable -def bridges(G: Graph[_Node], root: _Node | None = None) -> Generator[_Node, None, None]: ... +def bridges(G: Graph[_Node], root: _Node | None = None) -> Generator[_Node]: ... @_dispatchable def has_bridges(G: Graph[_Node], root: _Node | None = None) -> bool: ... @overload -def local_bridges( - G: Graph[_Node], with_span: bool = True, weight: str | None = None -) -> Generator[tuple[_Node, _Node], None, None]: ... +def local_bridges(G: Graph[_Node], with_span: bool = True, weight: str | None = None) -> Generator[tuple[_Node, _Node]]: ... @overload -def local_bridges( - G: Graph[_Node], with_span: bool = True, weight: str | None = None -) -> Generator[tuple[_Node, _Node, int], None, None]: ... +def local_bridges(G: Graph[_Node], with_span: bool = True, weight: str | None = None) -> Generator[tuple[_Node, _Node, int]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/flow_matrix.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/flow_matrix.pyi index c8196a4e9490..6b41a4822a94 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/flow_matrix.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/flow_matrix.pyi @@ -5,7 +5,7 @@ from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable @_dispatchable -def flow_matrix_row(G: Graph[_Node], weight=None, dtype=..., solver: str = "lu") -> Generator[Incomplete, None, None]: ... +def flow_matrix_row(G: Graph[_Node], weight=None, dtype=..., solver: str = "lu") -> Generator[Incomplete]: ... class InverseLaplacian: dtype: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/chains.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/chains.pyi index a91aed52d82c..00c7ed63fbfe 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/chains.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/chains.pyi @@ -6,4 +6,4 @@ from networkx.utils.backends import _dispatchable __all__ = ["chain_decomposition"] @_dispatchable -def chain_decomposition(G: Graph[_Node], root: _Node | None = None) -> Generator[list[tuple[_Node, _Node]], None, None]: ... +def chain_decomposition(G: Graph[_Node], root: _Node | None = None) -> Generator[list[tuple[_Node, _Node]]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/chordal.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/chordal.pyi index 6dc458dfa3d2..e7ad7d1d93d0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/chordal.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/chordal.pyi @@ -22,7 +22,7 @@ def is_chordal(G: Graph[_Node]) -> bool: ... @_dispatchable def find_induced_nodes(G: Graph[_Node], s: _Node, t: _Node, treewidth_bound: float = sys.maxsize) -> set[_Node]: ... @_dispatchable -def chordal_graph_cliques(G: Graph[_Node]) -> Generator[frozenset[_Node], None, None]: ... +def chordal_graph_cliques(G: Graph[_Node]) -> Generator[frozenset[_Node]]: ... @_dispatchable def chordal_graph_treewidth(G: Graph[_Node]) -> int: ... @_dispatchable diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/clique.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/clique.pyi index fc4203f7f449..e053da521ca9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/clique.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/clique.pyi @@ -17,9 +17,9 @@ __all__ = [ ] @_dispatchable -def enumerate_all_cliques(G: Graph[_Node]) -> Generator[list[_Node], None, None]: ... +def enumerate_all_cliques(G: Graph[_Node]) -> Generator[list[_Node]]: ... @_dispatchable -def find_cliques(G: Graph[_Node], nodes: Iterable[Incomplete] | None = None) -> Generator[list[_Node], None, None]: ... +def find_cliques(G: Graph[_Node], nodes: Iterable[Incomplete] | None = None) -> Generator[list[_Node]]: ... @_dispatchable def find_cliques_recursive(G: Graph[_Node], nodes: Iterable[Incomplete] | None = None) -> Iterator[list[_Node]]: ... @_dispatchable diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/coloring/greedy_coloring.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/coloring/greedy_coloring.pyi index 30545b7bd112..c2b6ea607e7c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/coloring/greedy_coloring.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/coloring/greedy_coloring.pyi @@ -24,15 +24,13 @@ def strategy_random_sequential(G: Graph[_Node], colors: Unused, seed=None): ... @_dispatchable def strategy_smallest_last(G: Graph[_Node], colors: Unused): ... @_dispatchable -def strategy_independent_set(G: Graph[_Node], colors: Unused) -> Generator[Incomplete, Incomplete, None]: ... +def strategy_independent_set(G: Graph[_Node], colors: Unused) -> Generator[Incomplete, Incomplete]: ... @_dispatchable def strategy_connected_sequential_bfs(G: Graph[_Node], colors): ... @_dispatchable def strategy_connected_sequential_dfs(G: Graph[_Node], colors): ... @_dispatchable -def strategy_connected_sequential( - G: Graph[_Node], colors: Unused, traversal: str = "bfs" -) -> Generator[Incomplete, None, None]: ... +def strategy_connected_sequential(G: Graph[_Node], colors: Unused, traversal: str = "bfs") -> Generator[Incomplete]: ... @_dispatchable def strategy_saturation_largest_first(G: Graph[_Node], colors) -> Generator[Incomplete, None, Incomplete]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/community/kclique.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/community/kclique.pyi index 31eaf1d71b6a..a12cf98d4ba7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/community/kclique.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/community/kclique.pyi @@ -7,4 +7,4 @@ from networkx.utils.backends import _dispatchable __all__ = ["k_clique_communities"] @_dispatchable -def k_clique_communities(G: Graph[_Node], k: int, cliques=None) -> Generator[Incomplete, None, None]: ... +def k_clique_communities(G: Graph[_Node], k: int, cliques=None) -> Generator[Incomplete]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/community/label_propagation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/community/label_propagation.pyi index 6ca5d5fe3e1b..8d50d0043835 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/community/label_propagation.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/community/label_propagation.pyi @@ -13,6 +13,6 @@ def fast_label_propagation_communities(G: Graph[_Node], *, weight=None, seed=Non @_dispatchable def asyn_lpa_communities( G: Graph[_Node], weight: str | None = None, seed: int | RandomState | None = None -) -> Generator[Incomplete, Incomplete, None]: ... +) -> Generator[Incomplete, Incomplete]: ... @_dispatchable def label_propagation_communities(G: Graph[_Node]) -> dict_values[Incomplete, set[Incomplete]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/community/louvain.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/community/louvain.pyi index 103d4bf6e7d8..b4d07e965717 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/community/louvain.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/community/louvain.pyi @@ -23,4 +23,4 @@ def louvain_partitions( resolution: float | None = 1, threshold: float | None = 1e-07, seed: int | RandomState | None = None, -) -> Generator[list[set[Incomplete]], None, None]: ... +) -> Generator[list[set[Incomplete]]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/disjoint_paths.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/disjoint_paths.pyi index 254973fa6a68..1f9ab7fb4ef7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/disjoint_paths.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/disjoint_paths.pyi @@ -18,7 +18,7 @@ def edge_disjoint_paths( cutoff: int | None = None, auxiliary: DiGraph[_Node] | None = None, residual: DiGraph[_Node] | None = None, -) -> Generator[Incomplete, None, None]: ... +) -> Generator[Incomplete]: ... @_dispatchable def node_disjoint_paths( G: Graph[_Node], @@ -28,4 +28,4 @@ def node_disjoint_paths( cutoff: int | None = None, auxiliary: DiGraph[_Node] | None = None, residual: DiGraph[_Node] | None = None, -) -> Generator[Incomplete, None, None]: ... +) -> Generator[Incomplete]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi index a988852eac92..db0c3a574e95 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi @@ -18,7 +18,7 @@ def k_edge_augmentation( avail: set[tuple[int, int]] | set[tuple[int, int, float]] | SupportsGetItem[tuple[int, int], float] | None = None, weight: str | None = None, partial: bool = False, -) -> Generator[tuple[_Node, _Node], None, None]: ... +) -> Generator[tuple[_Node, _Node]]: ... @_dispatchable def partial_k_edge_augmentation(G: Graph[_Node], k, avail, weight: str | None = None): ... @_dispatchable diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi index dd4e67663ab5..2f5f91987f9c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi @@ -11,7 +11,7 @@ def k_edge_components(G: Graph[_Node], k: int): ... @_dispatchable def k_edge_subgraphs(G: Graph[_Node], k: int): ... @_dispatchable -def bridge_components(G: Graph[_Node]) -> Generator[Incomplete, Incomplete, None]: ... +def bridge_components(G: Graph[_Node]) -> Generator[Incomplete, Incomplete]: ... class EdgeComponentAuxGraph: A: Incomplete @@ -19,8 +19,8 @@ class EdgeComponentAuxGraph: @classmethod def construct(cls, G: Graph[_Node]): ... - def k_edge_components(self, k: int) -> Generator[Incomplete, Incomplete, None]: ... - def k_edge_subgraphs(self, k: int) -> Generator[Incomplete, Incomplete, None]: ... + def k_edge_components(self, k: int) -> Generator[Incomplete, Incomplete]: ... + def k_edge_subgraphs(self, k: int) -> Generator[Incomplete, Incomplete]: ... @_dispatchable def general_k_edge_subgraphs(G: Graph[_Node], k): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/kcutsets.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/kcutsets.pyi index 78b0cb1befbf..77b4805cdeda 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/kcutsets.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/kcutsets.pyi @@ -11,4 +11,4 @@ default_flow_func = edmonds_karp @_dispatchable def all_node_cuts( G: Graph[_Node], k: int | None = None, flow_func: Callable[..., Incomplete] | None = None -) -> Generator[Incomplete, None, None]: ... +) -> Generator[Incomplete]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/dag.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/dag.pyi index 95f72a2d355d..cd31778ee3bf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/dag.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/dag.pyi @@ -30,15 +30,13 @@ def ancestors(G: Graph[_Node], source) -> set[_Node]: ... @_dispatchable def is_directed_acyclic_graph(G: Graph[_Node]) -> bool: ... @_dispatchable -def topological_generations(G: DiGraph[_Node]) -> Generator[list[_Node], None, None]: ... +def topological_generations(G: DiGraph[_Node]) -> Generator[list[_Node]]: ... @_dispatchable -def topological_sort(G: DiGraph[_Node]) -> Generator[_Node, None, None]: ... +def topological_sort(G: DiGraph[_Node]) -> Generator[_Node]: ... @_dispatchable -def lexicographical_topological_sort( - G: DiGraph[_Node], key: Callable[..., Incomplete] | None = None -) -> Generator[_Node, None, None]: ... +def lexicographical_topological_sort(G: DiGraph[_Node], key: Callable[..., Incomplete] | None = None) -> Generator[_Node]: ... @_dispatchable -def all_topological_sorts(G: DiGraph[_Node]) -> Generator[list[_Node], None, None]: ... +def all_topological_sorts(G: DiGraph[_Node]) -> Generator[list[_Node]]: ... @_dispatchable def is_aperiodic(G: DiGraph[_Node]) -> bool: ... @_dispatchable @@ -48,7 +46,7 @@ def transitive_closure_dag(G: DiGraph[_Node], topo_order: Iterable[Incomplete] | @_dispatchable def transitive_reduction(G: DiGraph[_Node]) -> DiGraph[_Node]: ... @_dispatchable -def antichains(G: DiGraph[_Node], topo_order: Iterable[Incomplete] | None = None) -> Generator[list[_Node], None, None]: ... +def antichains(G: DiGraph[_Node], topo_order: Iterable[Incomplete] | None = None) -> Generator[list[_Node]]: ... @_dispatchable def dag_longest_path( G: DiGraph[_Node], diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/euler.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/euler.pyi index 278aaec7b9fa..94aeeae3fdf1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/euler.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/euler.pyi @@ -11,12 +11,10 @@ def is_eulerian(G: Graph[_Node]) -> bool: ... @_dispatchable def is_semieulerian(G: Graph[_Node]) -> bool: ... @_dispatchable -def eulerian_circuit( - G: Graph[_Node], source: _Node | None = None, keys: bool = False -) -> Generator[Incomplete, Incomplete, None]: ... +def eulerian_circuit(G: Graph[_Node], source: _Node | None = None, keys: bool = False) -> Generator[Incomplete, Incomplete]: ... @_dispatchable def has_eulerian_path(G: Graph[_Node], source: _Node | None = None) -> bool: ... @_dispatchable -def eulerian_path(G: Graph[_Node], source=None, keys: bool = False) -> Generator[Incomplete, Incomplete, None]: ... +def eulerian_path(G: Graph[_Node], source=None, keys: bool = False) -> Generator[Incomplete, Incomplete]: ... @_dispatchable def eulerize(G: Graph[_Node]): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/networksimplex.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/networksimplex.pyi index a2f58d7cae6b..c9a60b87455d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/networksimplex.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/networksimplex.pyi @@ -34,13 +34,13 @@ class _DataEssentialsAndFunctions: def trace_path(self, p, w): ... def find_cycle(self, i, p, q): ... def augment_flow(self, Wn, We, f) -> None: ... - def trace_subtree(self, p) -> Generator[Incomplete, None, None]: ... + def trace_subtree(self, p) -> Generator[Incomplete]: ... def remove_edge(self, s, t) -> None: ... def make_root(self, q) -> None: ... def add_edge(self, i, p, q) -> None: ... def update_potentials(self, i, p, q) -> None: ... def reduced_cost(self, i): ... - def find_entering_edges(self) -> Generator[Incomplete, None, None]: ... + def find_entering_edges(self) -> Generator[Incomplete]: ... def residual_capacity(self, i, p): ... def find_leaving_edge(self, Wn, We): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/isomorphism/ismags.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/isomorphism/ismags.pyi index 1deb5eedf2d4..2f7db7c1ec00 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/isomorphism/ismags.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/isomorphism/ismags.pyi @@ -24,9 +24,9 @@ class ISMAGS: def __init__(self, graph, subgraph, node_match=None, edge_match=None, cache=None) -> None: ... def create_aligned_partitions(self, thing_matcher, sg_things, g_things): ... def find_isomorphisms(self, symmetry: bool = True) -> Generator[Incomplete, Incomplete, Incomplete]: ... - def largest_common_subgraph(self, symmetry: bool = True) -> Generator[Incomplete, Incomplete, None]: ... + def largest_common_subgraph(self, symmetry: bool = True) -> Generator[Incomplete, Incomplete]: ... def analyze_subgraph_symmetry(self) -> dict[Hashable, set[Hashable]]: ... def is_isomorphic(self, symmetry: bool = False) -> bool: ... def subgraph_is_isomorphic(self, symmetry: bool = False) -> bool: ... - def isomorphisms_iter(self, symmetry: bool = True) -> Generator[Incomplete, Incomplete, None]: ... + def isomorphisms_iter(self, symmetry: bool = True) -> Generator[Incomplete, Incomplete]: ... def subgraph_isomorphisms_iter(self, symmetry: bool = True): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/isomorphism/isomorphvf2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/isomorphism/isomorphvf2.pyi index 47097ed0c177..734025b38f5e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/isomorphism/isomorphvf2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/isomorphism/isomorphvf2.pyi @@ -14,7 +14,7 @@ class GraphMatcher: def __init__(self, G1, G2) -> None: ... def reset_recursion_limit(self) -> None: ... - def candidate_pairs_iter(self) -> Generator[Incomplete, None, None]: ... + def candidate_pairs_iter(self) -> Generator[Incomplete]: ... core_1: Incomplete core_2: Incomplete inout_1: Incomplete @@ -24,18 +24,18 @@ class GraphMatcher: def initialize(self) -> None: ... def is_isomorphic(self) -> bool: ... - def isomorphisms_iter(self) -> Generator[Incomplete, Incomplete, None]: ... - def match(self) -> Generator[Incomplete, Incomplete, None]: ... + def isomorphisms_iter(self) -> Generator[Incomplete, Incomplete]: ... + def match(self) -> Generator[Incomplete, Incomplete]: ... def semantic_feasibility(self, G1_node, G2_node): ... def subgraph_is_isomorphic(self): ... def subgraph_is_monomorphic(self): ... - def subgraph_isomorphisms_iter(self) -> Generator[Incomplete, Incomplete, None]: ... - def subgraph_monomorphisms_iter(self) -> Generator[Incomplete, Incomplete, None]: ... + def subgraph_isomorphisms_iter(self) -> Generator[Incomplete, Incomplete]: ... + def subgraph_monomorphisms_iter(self) -> Generator[Incomplete, Incomplete]: ... def syntactic_feasibility(self, G1_node, G2_node): ... class DiGraphMatcher(GraphMatcher): def __init__(self, G1, G2) -> None: ... - def candidate_pairs_iter(self) -> Generator[Incomplete, None, None]: ... + def candidate_pairs_iter(self) -> Generator[Incomplete]: ... core_1: Incomplete core_2: Incomplete in_1: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/lowest_common_ancestors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/lowest_common_ancestors.pyi index ab7a8e5472cd..8e3e2a6e37df 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/lowest_common_ancestors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/lowest_common_ancestors.pyi @@ -12,6 +12,4 @@ def all_pairs_lowest_common_ancestor(G: DiGraph[_Node], pairs=None): ... @_dispatchable def lowest_common_ancestor(G: DiGraph[_Node], node1, node2, default=None): ... @_dispatchable -def tree_all_pairs_lowest_common_ancestor( - G: DiGraph[_Node], root: _Node | None = None, pairs=None -) -> Generator[Incomplete, None, None]: ... +def tree_all_pairs_lowest_common_ancestor(G: DiGraph[_Node], root: _Node | None = None, pairs=None) -> Generator[Incomplete]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/planarity.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/planarity.pyi index 0cfc0a36135f..3eb6000d971a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/planarity.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/planarity.pyi @@ -1,5 +1,6 @@ from _typeshed import Incomplete, Unused from collections.abc import Generator, Iterable, Mapping, MutableSet, Reversible +from decimal import Decimal from typing import NoReturn from networkx.classes.digraph import DiGraph @@ -94,7 +95,7 @@ class LRPlanarity: class PlanarEmbedding(DiGraph[_Node]): def get_data(self) -> dict[_Node, list[_Node]]: ... def set_data(self, data: Mapping[_Node, Reversible[_Node]]) -> None: ... - def neighbors_cw_order(self, v: _Node) -> Generator[_Node, None, None]: ... + def neighbors_cw_order(self, v: _Node) -> Generator[_Node]: ... def add_half_edge(self, start_node: _Node, end_node: _Node, *, cw: _Node | None = None, ccw: _Node | None = None): ... def check_structure(self) -> None: ... def add_half_edge_ccw(self, start_node: _Node, end_node: _Node, reference_neighbor: _Node) -> None: ... @@ -109,5 +110,5 @@ class PlanarEmbedding(DiGraph[_Node]): def add_edge(self, u_of_edge: _Node, v_of_edge: _Node, **attr: Unused) -> NoReturn: ... def add_edges_from(self, ebunch_to_add: Iterable[_EdgePlus[_Node]], **attr: Unused) -> NoReturn: ... def add_weighted_edges_from( - self, ebunch_to_add: Iterable[tuple[_Node, _Node, float]], weight: str = "weight", **attr: Unused + self, ebunch_to_add: Iterable[tuple[_Node, _Node, float | Decimal | None]], weight: str = "weight", **attr: Unused ) -> NoReturn: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/shortest_paths/unweighted.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/shortest_paths/unweighted.pyi index e7008bdc9b2b..d0561d85d4bc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/shortest_paths/unweighted.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/shortest_paths/unweighted.pyi @@ -20,7 +20,7 @@ def single_source_shortest_path_length(G: Graph[_Node], source: _Node, cutoff: i @_dispatchable def single_target_shortest_path_length(G: Graph[_Node], target: _Node, cutoff: int | None = None): ... @_dispatchable -def all_pairs_shortest_path_length(G: Graph[_Node], cutoff: int | None = None) -> Generator[Incomplete, None, None]: ... +def all_pairs_shortest_path_length(G: Graph[_Node], cutoff: int | None = None) -> Generator[Incomplete]: ... @_dispatchable def bidirectional_shortest_path(G: Graph[_Node], source: _Node, target: _Node) -> list[Incomplete]: ... @_dispatchable diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/similarity.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/similarity.pyi index 9b67e69e6ff7..ccd60ca1c1ea 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/similarity.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/similarity.pyi @@ -59,7 +59,7 @@ def optimize_graph_edit_distance( edge_del_cost: Callable[..., Incomplete] | None = None, edge_ins_cost: Callable[..., Incomplete] | None = None, upper_bound: float | None = None, -) -> Generator[Incomplete, None, None]: ... +) -> Generator[Incomplete]: ... @_dispatchable def optimize_edit_paths( G1: Graph[_Node], diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/simple_paths.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/simple_paths.pyi index 405c00aea1c7..f32d7d205d2b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/simple_paths.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/simple_paths.pyi @@ -23,7 +23,7 @@ def shortest_simple_paths( source: _Node, target: _Node, weight: str | Callable[[Any, Any, SupportsGetItem[str, Any]], float | None] | None = None, -) -> Generator[list[_Node], None, None]: ... +) -> Generator[list[_Node]]: ... class PathBuffer: paths: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/triads.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/triads.pyi index 7bd9b3334fe8..b4b8fc840daf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/triads.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/algorithms/triads.pyi @@ -18,7 +18,7 @@ def triadic_census(G: DiGraph[_Node], nodelist: Collection[_Node] | None = None) @_dispatchable def is_triad(G: Graph[_Node]) -> bool: ... @_dispatchable -def all_triads(G: DiGraph[_Node]) -> Generator[Incomplete, None, None]: ... +def all_triads(G: DiGraph[_Node]) -> Generator[Incomplete]: ... @_dispatchable def triads_by_type(G: DiGraph[_Node]) -> defaultdict[Incomplete, list[Incomplete]]: ... @_dispatchable diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/classes/function.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/classes/function.pyi index 9ee302b90bae..ad5818fae47a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/classes/function.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/classes/function.pyi @@ -130,44 +130,44 @@ def get_edge_attributes(G: Graph[_Node], name: str, default=None) -> dict[tuple[ @_dispatchable def remove_edge_attributes(G: Graph[_Node], *attr_names, ebunch=None) -> None: ... def all_neighbors(graph: Graph[_Node], node: _Node) -> Iterator[_Node]: ... -def non_neighbors(graph: Graph[_Node], node: _Node) -> Generator[_Node, None, None]: ... -def non_edges(graph: Graph[_Node]) -> Generator[tuple[_Node, _Node], None, None]: ... -def common_neighbors(G: Graph[_Node], u: _Node, v: _Node) -> Generator[_Node, None, None]: ... +def non_neighbors(graph: Graph[_Node], node: _Node) -> Generator[_Node]: ... +def non_edges(graph: Graph[_Node]) -> Generator[tuple[_Node, _Node]]: ... +def common_neighbors(G: Graph[_Node], u: _Node, v: _Node) -> Generator[_Node]: ... @_dispatchable def is_weighted(G: Graph[_Node], edge: tuple[_Node, _Node] | None = None, weight: str = "weight") -> bool: ... @_dispatchable def is_negatively_weighted(G: Graph[_Node], edge: tuple[_Node, _Node] | None = None, weight: str = "weight") -> bool: ... @_dispatchable def is_empty(G: Graph[Hashable]) -> bool: ... -def nodes_with_selfloops(G: Graph[_Node]) -> Generator[_Node, None, None]: ... +def nodes_with_selfloops(G: Graph[_Node]) -> Generator[_Node]: ... @overload def selfloop_edges( G: Graph[_Node], data: Literal[False] = False, keys: Literal[False] = False, default=None -) -> Generator[tuple[_Node, _Node], None, None]: ... +) -> Generator[tuple[_Node, _Node]]: ... @overload def selfloop_edges( G: Graph[_Node], data: Literal[True], keys: Literal[False] = False, default=None -) -> Generator[tuple[_Node, _Node, dict[str, Incomplete]], None, None]: ... +) -> Generator[tuple[_Node, _Node, dict[str, Incomplete]]]: ... @overload def selfloop_edges( G: Graph[_Node], data: str, keys: Literal[False] = False, default: _U | None = None -) -> Generator[tuple[_Node, _Node, _U], None, None]: ... +) -> Generator[tuple[_Node, _Node, _U]]: ... @overload def selfloop_edges( G: Graph[_Node], data: Literal[False], keys: Literal[True], default=None -) -> Generator[tuple[_Node, _Node, int], None, None]: ... +) -> Generator[tuple[_Node, _Node, int]]: ... @overload def selfloop_edges( G: Graph[_Node], data: Literal[False] = False, *, keys: Literal[True], default=None -) -> Generator[tuple[_Node, _Node, int], None, None]: ... +) -> Generator[tuple[_Node, _Node, int]]: ... @overload def selfloop_edges( G: Graph[_Node], data: Literal[True], keys: Literal[True], default=None -) -> Generator[tuple[_Node, _Node, int, dict[str, Incomplete]], None, None]: ... +) -> Generator[tuple[_Node, _Node, int, dict[str, Incomplete]]]: ... @overload def selfloop_edges( G: Graph[_Node], data: str, keys: Literal[True], default: _U | None = None -) -> Generator[tuple[_Node, _Node, int, _U], None, None]: ... +) -> Generator[tuple[_Node, _Node, int, _U]]: ... @_dispatchable def number_of_selfloops(G: Graph[Hashable]) -> int: ... def is_path(G: Graph[_Node], path: Iterable[Incomplete]) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/classes/graph.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/classes/graph.pyi index 86d0a01e56e9..32eab69e42cd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/classes/graph.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/classes/graph.pyi @@ -1,4 +1,5 @@ from collections.abc import Callable, Collection, Hashable, Iterable, Iterator, MutableMapping +from decimal import Decimal from functools import cached_property from typing import Any, ClassVar, TypeVar, overload from typing_extensions import Self, TypeAlias @@ -71,7 +72,7 @@ class Graph(Collection[_Node]): def add_edges_from(self, ebunch_to_add: Iterable[_EdgePlus[_Node]], **attr: Any) -> None: ... # attr: Edge data (or labels or objects) can be assigned using keyword arguments def add_weighted_edges_from( - self, ebunch_to_add: Iterable[tuple[_Node, _Node, float]], weight: str = "weight", **attr: Any + self, ebunch_to_add: Iterable[tuple[_Node, _Node, float | Decimal | None]], weight: str = "weight", **attr: Any ) -> None: ... # attr: Edge attributes to add/update for all edges. def remove_edge(self, u: _Node, v: _Node) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/adjlist.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/adjlist.pyi index a4f2c6188186..d1013ef80255 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/adjlist.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/adjlist.pyi @@ -5,7 +5,7 @@ from networkx.utils.backends import _dispatchable __all__ = ["generate_adjlist", "write_adjlist", "parse_adjlist", "read_adjlist"] -def generate_adjlist(G: Graph[_Node], delimiter: str = " ") -> Generator[str, None, None]: ... +def generate_adjlist(G: Graph[_Node], delimiter: str = " ") -> Generator[str]: ... def write_adjlist(G: Graph[_Node], path, comments: str = "#", delimiter: str = " ", encoding: str = "utf-8") -> None: ... @_dispatchable def parse_adjlist(lines, comments: str = "#", delimiter=None, create_using=None, nodetype=None): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/edgelist.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/edgelist.pyi index 1ae09b2b4f49..feb3ab0587b3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/edgelist.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/edgelist.pyi @@ -13,7 +13,7 @@ __all__ = [ "write_weighted_edgelist", ] -def generate_edgelist(G: Graph[_Node], delimiter: str = " ", data: bool = True) -> Generator[Incomplete, None, None]: ... +def generate_edgelist(G: Graph[_Node], delimiter: str = " ", data: bool = True) -> Generator[Incomplete]: ... def write_edgelist( G: Graph[_Node], path, comments: str = "#", delimiter: str = " ", data: bool = True, encoding: str = "utf-8" ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/gexf.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/gexf.pyi index 32825bfa608b..dee0838cf004 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/gexf.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/gexf.pyi @@ -10,7 +10,7 @@ __all__ = ["write_gexf", "read_gexf", "relabel_gexf_graph", "generate_gexf"] def write_gexf(G: Graph[_Node], path, encoding: str = "utf-8", prettyprint: bool = True, version: str = "1.2draft") -> None: ... def generate_gexf( G: Graph[_Node], encoding: str = "utf-8", prettyprint: bool = True, version: str = "1.2draft" -) -> Generator[Incomplete, Incomplete, None]: ... +) -> Generator[Incomplete, Incomplete]: ... @_dispatchable def read_gexf(path, node_type=None, relabel: bool = False, version: str = "1.2draft"): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/gml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/gml.pyi index ca73eb3cd4a2..23817841dc6d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/gml.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/gml.pyi @@ -37,5 +37,5 @@ LIST_START_VALUE: Final = "_networkx_list_start" def parse_gml_lines(lines, label, destringizer): ... def literal_stringizer(value) -> str: ... -def generate_gml(G: Graph[_Node], stringizer=None) -> Generator[Incomplete, Incomplete, None]: ... +def generate_gml(G: Graph[_Node], stringizer=None) -> Generator[Incomplete, Incomplete]: ... def write_gml(G: Graph[_Node], path, stringizer=None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/graphml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/graphml.pyi index ffe71779ae6f..f2395a328f8e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/graphml.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/graphml.pyi @@ -36,7 +36,7 @@ def write_graphml_lxml( ): ... def generate_graphml( G: Graph[_Node], encoding: str = "utf-8", prettyprint: bool = True, named_key_ids: bool = False, edge_id_from_attribute=None -) -> Generator[Incomplete, Incomplete, None]: ... +) -> Generator[Incomplete, Incomplete]: ... @_dispatchable def read_graphml(path, node_type=..., edge_key_type=..., force_multigraph: bool = False): ... @_dispatchable @@ -121,7 +121,7 @@ class GraphMLReader(GraphML): edge_ids: Incomplete def __init__(self, node_type=..., edge_key_type=..., force_multigraph: bool = False) -> None: ... xml: Incomplete - def __call__(self, path=None, string=None) -> Generator[Incomplete, None, None]: ... + def __call__(self, path=None, string=None) -> Generator[Incomplete]: ... def make_graph(self, graph_xml, graphml_keys, defaults, G=None): ... def add_node(self, G: Graph[_Node], node_xml, graphml_keys, defaults) -> None: ... def add_edge(self, G: Graph[_Node], edge_element, graphml_keys) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/multiline_adjlist.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/multiline_adjlist.pyi index ba5e0ad89858..6de1e02a4e8b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/multiline_adjlist.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/multiline_adjlist.pyi @@ -5,7 +5,7 @@ from networkx.utils.backends import _dispatchable __all__ = ["generate_multiline_adjlist", "write_multiline_adjlist", "parse_multiline_adjlist", "read_multiline_adjlist"] -def generate_multiline_adjlist(G: Graph[_Node], delimiter: str = " ") -> Generator[str, None, None]: ... +def generate_multiline_adjlist(G: Graph[_Node], delimiter: str = " ") -> Generator[str]: ... def write_multiline_adjlist(G: Graph[_Node], path, delimiter=" ", comments="#", encoding="utf-8") -> None: ... @_dispatchable def parse_multiline_adjlist(lines, comments: str = "#", delimiter=None, create_using=None, nodetype=None, edgetype=None): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/pajek.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/pajek.pyi index f51b8cd6815a..ec6d1d0d68b9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/pajek.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/readwrite/pajek.pyi @@ -6,7 +6,7 @@ from networkx.utils.backends import _dispatchable __all__ = ["read_pajek", "parse_pajek", "generate_pajek", "write_pajek"] -def generate_pajek(G: Graph[_Node]) -> Generator[Incomplete, None, None]: ... +def generate_pajek(G: Graph[_Node]) -> Generator[Incomplete]: ... def write_pajek(G: Graph[_Node], path, encoding: str = "UTF-8") -> None: ... @_dispatchable def read_pajek(path, encoding: str = "UTF-8"): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/utils/configs.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/utils/configs.pyi index 780ccf7233a2..b9206c9ace09 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/utils/configs.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/utils/configs.pyi @@ -7,7 +7,7 @@ from typing_extensions import Self __all__ = ["Config"] -# TODO: Our pyright test doesn't understand `requires_python` in METADATA.toml +# TODO: Our pyright test doesn't understand `requires-python` in METADATA.toml # https://github.com/python/typeshed/issues/14025 if sys.version_info >= (3, 10): @dataclass(init=False, eq=False, slots=True, kw_only=True, match_args=False) diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/utils/rcm.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/utils/rcm.pyi index 2c138df6750a..ec892f2f6712 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/utils/rcm.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/utils/rcm.pyi @@ -5,7 +5,7 @@ from networkx.classes.graph import Graph, _Node __all__ = ["cuthill_mckee_ordering", "reverse_cuthill_mckee_ordering"] -def cuthill_mckee_ordering(G: Graph[_Node], heuristic=None) -> Generator[Incomplete, Incomplete, None]: ... +def cuthill_mckee_ordering(G: Graph[_Node], heuristic=None) -> Generator[Incomplete, Incomplete]: ... def reverse_cuthill_mckee_ordering(G: Graph[_Node], heuristic=None): ... def connected_cuthill_mckee_ordering(G: Graph[_Node], heuristic=None): ... def pseudo_peripheral_node(G: Graph[_Node]): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/METADATA.toml index dcc24fcec5c9..6b2d25dc6222 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/METADATA.toml @@ -1,2 +1,2 @@ version = "3.3.*" -upstream_repository = "https://github.com/oauthlib/oauthlib" +upstream-repository = "https://github.com/oauthlib/oauthlib" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/common.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/common.pyi index 15112d51863c..c11e1ec3afae 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/common.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/common.pyi @@ -67,6 +67,36 @@ class Request: decoded_body: list[tuple[str, str]] | None oauth_params: list[str] validator_log: dict[str, Any] # value type depends on the key + access_token: Incomplete | None + client: Incomplete | None + client_id: Incomplete | None + client_secret: Incomplete | None + code: Incomplete | None + code_challenge: Incomplete | None + code_challenge_method: Incomplete | None + code_verifier: Incomplete | None + extra_credentials: Incomplete | None + grant_type: Incomplete | None + redirect_uri: Incomplete | None + refresh_token: Incomplete | None + request_token: Incomplete | None + response_type: Incomplete | None + scope: Incomplete | None + scopes: Incomplete | None + state: Incomplete | None + token: Incomplete | None + user: Incomplete | None + token_type_hint: Incomplete | None + response_mode: Incomplete | None + nonce: Incomplete | None + display: Incomplete | None + prompt: Incomplete | None + claims: Incomplete | None + max_age: Incomplete | None + ui_locales: Incomplete | None + id_token_hint: Incomplete | None + login_hint: Incomplete | None + acr_values: Incomplete | None def __init__( self, uri: str, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/__init__.pyi index a909c15b1d78..c5e4a4127326 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/__init__.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from collections.abc import Callable, Mapping from logging import Logger -from typing import Any, Final +from typing import Final from oauthlib.common import _HTTPMethod @@ -25,20 +25,20 @@ class Client: SIGNATURE_METHODS: dict[str, Callable[[str, Incomplete], str]] @classmethod def register_signature_method(cls, method_name, method_callback) -> None: ... - client_key: Any - client_secret: Any - resource_owner_key: Any - resource_owner_secret: Any - signature_method: Any - signature_type: Any - callback_uri: Any - rsa_key: Any - verifier: Any - realm: Any - encoding: Any - decoding: Any - nonce: Any - timestamp: Any + client_key: Incomplete + client_secret: Incomplete + resource_owner_key: Incomplete + resource_owner_secret: Incomplete + signature_method: Incomplete + signature_type: Incomplete + callback_uri: Incomplete + rsa_key: Incomplete + verifier: Incomplete + realm: Incomplete + encoding: Incomplete + decoding: Incomplete + nonce: Incomplete + timestamp: Incomplete def __init__( self, client_key: str, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/base.pyi index 6ba5cb7a6471..c409738cdaa9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/endpoints/base.pyi @@ -1,6 +1,6 @@ -from typing import Any +from _typeshed import Incomplete class BaseEndpoint: - request_validator: Any - token_generator: Any + request_validator: Incomplete + token_generator: Incomplete def __init__(self, request_validator, token_generator=None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/errors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/errors.pyi index 1337e5b76355..31973a6da123 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/errors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/errors.pyi @@ -1,10 +1,10 @@ -from typing import Any +from _typeshed import Incomplete class OAuth1Error(Exception): - error: Any + error: Incomplete description: str - uri: Any - status_code: Any + uri: Incomplete + status_code: Incomplete def __init__(self, description=None, uri=None, status_code: int = 400, request=None) -> None: ... def in_uri(self, uri): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/parameters.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/parameters.pyi index 068ab541d353..49c06be9d17e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/parameters.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/parameters.pyi @@ -1,5 +1,3 @@ -from _typeshed import Incomplete - -def prepare_headers(params, headers: Incomplete | None = ..., realm: Incomplete | None = ...): ... +def prepare_headers(params, headers=None, realm=None): ... def prepare_form_encoded_body(oauth_params, body): ... def prepare_request_uri_query(oauth_params, uri): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/utils.pyi index 14f91fd1434c..46e93ea192fc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth1/rfc5849/utils.pyi @@ -1,16 +1,16 @@ from collections.abc import Callable, Iterable -from typing import Any, Final, TypeVar +from typing import Final, TypeVar _T = TypeVar("_T") UNICODE_ASCII_CHARACTER_SET: Final[str] def filter_params( - target: Callable[[dict[str, Any] | Iterable[tuple[str, Any]], _T], object], + target: Callable[[dict[str, object] | Iterable[tuple[str, object]], _T], object], ) -> Callable[[list[str], _T], object]: ... def filter_oauth_params( - params: dict[str, Any] | Iterable[tuple[str, Any]], -) -> list[str]: ... # we don't care about second (Any) part + params: dict[str, object] | Iterable[tuple[str, object]], +) -> list[str]: ... # we don't care about second (object) part def escape(u: str) -> str: ... def unescape(u: str) -> str: ... def parse_keqv_list(l: list[str]) -> dict[str, str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/errors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/errors.pyi index de88e00f0619..c0b8901d0b60 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/errors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/oauth2/rfc6749/errors.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete -from typing import Any, NoReturn +from typing import NoReturn from oauthlib.common import Request @@ -11,7 +11,7 @@ class OAuth2Error(Exception): state: str | None redirect_uri: str | None client_id: str | None - scopes: Any + scopes: Incomplete | None response_type: str | None response_mode: str | None grant_type: str | None diff --git a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/signals.pyi b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/signals.pyi index 29021251576a..e24c057315a5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/signals.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/oauthlib/oauthlib/signals.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete signals_available: bool @@ -7,14 +7,14 @@ class Namespace: class _FakeSignal: name: str - __doc__: Any + __doc__: str | None def __init__(self, name: str, doc: str | None = None) -> None: ... - send: Any - connect: Any - disconnect: Any - has_receivers_for: Any - receivers_for: Any - temporarily_connected_to: Any - connected_to: Any + send: Incomplete + connect: Incomplete + disconnect: Incomplete + has_receivers_for: Incomplete + receivers_for: Incomplete + temporarily_connected_to: Incomplete + connected_to: Incomplete scope_changed: _FakeSignal diff --git a/packages/pyright-internal/typeshed-fallback/stubs/objgraph/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/objgraph/METADATA.toml index 2ea5dba9e6f4..5ed5672fc501 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/objgraph/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/objgraph/METADATA.toml @@ -1,2 +1,2 @@ version = "3.6.*" -upstream_repository = "https://github.com/mgedmin/objgraph" +upstream-repository = "https://github.com/mgedmin/objgraph" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/olefile/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/olefile/METADATA.toml index 3789bd8a2ec8..63c57f41365d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/olefile/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/olefile/METADATA.toml @@ -1,2 +1,2 @@ version = "0.47.*" -upstream_repository = "https://github.com/decalage2/olefile" +upstream-repository = "https://github.com/decalage2/olefile" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/METADATA.toml index 1edc2adc4fcb..076eb0ab762f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/METADATA.toml @@ -1,2 +1,2 @@ version = "3.1.5" -upstream_repository = "https://foss.heptapod.net/openpyxl/openpyxl" +upstream-repository = "https://foss.heptapod.net/openpyxl/openpyxl" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/reference.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/reference.pyi index 264bd4a599f8..6eb1f7e98198 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/reference.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/reference.pyi @@ -42,9 +42,9 @@ class Reference(Strict): def __len__(self) -> int: ... def __eq__(self, other: object) -> bool: ... @property - def rows(self) -> Generator[Reference, None, None]: ... + def rows(self) -> Generator[Reference]: ... @property - def cols(self) -> Generator[Reference, None, None]: ... + def cols(self) -> Generator[Reference]: ... def pop(self): ... @property def sheetname(self) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comment_sheet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comment_sheet.pyi index 51799b51ce1f..4f51dac78f57 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comment_sheet.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comment_sheet.pyi @@ -116,7 +116,7 @@ class CommentSheet(Serialisable): def __init__(self, authors: AuthorList, commentList=None, extLst: Unused = None) -> None: ... def to_tree(self) -> Element: ... # type: ignore[override] @property - def comments(self) -> Generator[tuple[str, Comment], None, None]: ... + def comments(self) -> Generator[tuple[str, Comment]]: ... @classmethod def from_comments(cls, comments): ... def write_shapes(self, vml=None): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/sequence.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/sequence.pyi index ffad3ba356fc..01e44ca1a375 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/sequence.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/sequence.pyi @@ -32,9 +32,7 @@ class Sequence(Descriptor[_ContainerT]): container: type # internal container type, defaults to `list` # seq must be an instance of any of the declared `seq_types`. def __set__(self, instance: Serialisable | Strict, seq: Any) -> None: ... - def to_tree( - self, tagname: str | None, obj: Iterable[object], namespace: str | None = None - ) -> Generator[Element, None, None]: ... + def to_tree(self, tagname: str | None, obj: Iterable[object], namespace: str | None = None) -> Generator[Element]: ... # `_T` is the type of the elements in the sequence. class UniqueSequence(Sequence[set[_T]]): @@ -46,7 +44,7 @@ class ValueSequence(Sequence[_ContainerT]): attribute: str def to_tree( self, tagname: str, obj: Iterable[object], namespace: str | None = None # type: ignore[override] - ) -> Generator[Element, None, None]: ... + ) -> Generator[Element]: ... def from_tree(self, node: _HasGet[_T]) -> _T: ... @type_check_only @@ -68,7 +66,7 @@ class MultiSequence(Sequence[list[_T]]): def __set__(self, instance: Serialisable | Strict, seq: tuple[_T, ...] | list[_T]) -> None: ... def to_tree( self, tagname: Unused, obj: Iterable[_SupportsToTree], namespace: str | None = None # type: ignore[override] - ) -> Generator[Element, None, None]: ... + ) -> Generator[Element]: ... class MultiSequencePart(Alias): expected_type: type[Incomplete] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/manifest.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/manifest.pyi index 8d0f3a15f13f..9700c10e2871 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/manifest.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/manifest.pyi @@ -37,5 +37,5 @@ class Manifest(Serialisable): def to_tree(self) -> Element: ... # type: ignore[override] def __contains__(self, content_type: str) -> bool: ... def find(self, content_type): ... - def findall(self, content_type) -> Generator[Incomplete, None, None]: ... + def findall(self, content_type) -> Generator[Incomplete]: ... def append(self, obj) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/relationship.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/relationship.pyi index 1a1ea10a191c..219fe46da085 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/relationship.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/relationship.pyi @@ -34,7 +34,7 @@ class Relationship(Serialisable): class RelationshipList(ElementList[Relationship]): expected_type: type[Relationship] - def find(self, content_type: str) -> Generator[Relationship, None, None]: ... + def find(self, content_type: str) -> Generator[Relationship]: ... def get(self, key: str) -> Relationship: ... def to_dict(self) -> dict[Incomplete, Relationship]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/reader/workbook.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/reader/workbook.pyi index 4faa3c1f5e6c..7a8f3bec60a7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/reader/workbook.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/reader/workbook.pyi @@ -18,7 +18,7 @@ class WorkbookParser: # Errors if "parse" is never called. caches: list[PivotCache] def parse(self) -> None: ... - def find_sheets(self) -> Generator[tuple[ChildSheet, Relationship], None, None]: ... + def find_sheets(self) -> Generator[tuple[ChildSheet, Relationship]]: ... def assign_names(self) -> None: ... @property def pivot_caches(self) -> dict[int, CacheDefinition]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/colors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/colors.pyi index 37ba17d847cd..69975c0787e5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/colors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/colors.pyi @@ -13,7 +13,7 @@ _S = TypeVar("_S", bound=Serialisable) COLOR_INDEX: Final[tuple[str, ...]] BLACK: Final = "00000000" WHITE: Final = "00FFFFFF" -BLUE: Final = "00FFFFFF" +BLUE: Final = "000000FF" aRGB_REGEX: Final[Pattern[str]] class RGB(Typed[str, _N]): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/cell.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/cell.pyi index 22a05774e7fc..49e751e7a922 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/cell.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/cell.pyi @@ -20,8 +20,8 @@ def absolute_coordinate(coord_string: str) -> str: ... def get_column_letter(col_idx: int) -> str: ... def column_index_from_string(col: str) -> int: ... def range_boundaries(range_string: str) -> _RangeBoundariesTuple: ... -def rows_from_range(range_string: str) -> Generator[tuple[str, ...], None, None]: ... -def cols_from_range(range_string: str) -> Generator[tuple[str, ...], None, None]: ... +def rows_from_range(range_string: str) -> Generator[tuple[str, ...]]: ... +def cols_from_range(range_string: str) -> Generator[tuple[str, ...]]: ... def coordinate_to_tuple(coordinate: str) -> tuple[int, int]: ... def range_to_tuple(range_string: str) -> tuple[str, _RangeBoundariesTuple]: ... def quote_sheetname(sheetname: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/dataframe.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/dataframe.pyi index d82d6c3c63fd..592aded19426 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/dataframe.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/dataframe.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete from collections.abc import Generator -def dataframe_to_rows(df, index: bool = True, header: bool = True) -> Generator[Incomplete, None, None]: ... -def expand_index(index, header: bool = False) -> Generator[Incomplete, None, None]: ... +def dataframe_to_rows(df, index: bool = True, header: bool = True) -> Generator[Incomplete]: ... +def expand_index(index, header: bool = False) -> Generator[Incomplete]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/defined_name.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/defined_name.pyi index aeda5c7e8fc1..aa8780463371 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/defined_name.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/defined_name.pyi @@ -53,7 +53,7 @@ class DefinedName(Serialisable): @property def type(self) -> _TokenTypesNotOperand | _TokenOperandSubtypes: ... @property - def destinations(self) -> Generator[tuple[str, str], None, None]: ... + def destinations(self) -> Generator[tuple[str, str]]: ... @property def is_reserved(self) -> str | None: ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi index fbd34ec813a3..a1f95ee4b577 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi @@ -15,11 +15,11 @@ class ReadOnlyWorksheet: # Same as Worksheet.values # https://github.com/python/mypy/issues/6700 @property - def values(self) -> Generator[tuple[_CellGetValue, ...], None, None]: ... + def values(self) -> Generator[tuple[_CellGetValue, ...]]: ... # Same as Worksheet.rows # https://github.com/python/mypy/issues/6700 @property - def rows(self) -> Generator[tuple[_CellOrMergedCell, ...], None, None]: ... + def rows(self) -> Generator[tuple[_CellOrMergedCell, ...]]: ... __getitem__ = Worksheet.__getitem__ __iter__ = Worksheet.__iter__ parent: Workbook diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_reader.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_reader.pyi index 420fc3dac2d9..789dd30f6c6f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_reader.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_reader.pyi @@ -84,7 +84,7 @@ class WorkSheetParser: timedelta_formats: Container[int] = ..., rich_text: bool = False, ) -> None: ... - def parse(self) -> Generator[Incomplete, None, None]: ... + def parse(self) -> Generator[Incomplete]: ... def parse_dimensions(self) -> _RangeBoundariesTuple | None: ... def parse_cell(self, element) -> dict[str, _AnyCellValue]: ... def parse_formula(self, element): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_writer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_writer.pyi index 92ca8dc7b9a6..f1672f3f13a7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_writer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_writer.pyi @@ -24,7 +24,7 @@ def create_temporary_file(suffix: str = "") -> str: ... class WorksheetWriter: ws: Worksheet | WriteOnlyWorksheet out: _OutType - xf: Generator[Incomplete | None, Incomplete, None] + xf: Generator[Incomplete | None, Incomplete] def __init__(self, ws: Worksheet | WriteOnlyWorksheet, out: _OutType | None = None) -> None: ... def write_properties(self) -> None: ... def write_dimensions(self) -> None: ... @@ -51,7 +51,7 @@ class WorksheetWriter: def write_drawings(self) -> None: ... def write_legacy(self) -> None: ... def write_tables(self) -> None: ... - def get_stream(self) -> Generator[Incomplete | None, bool | None, None]: ... + def get_stream(self) -> Generator[Incomplete | None, bool | None]: ... def write_tail(self) -> None: ... def write(self) -> None: ... def close(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_range.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_range.pyi index 9b2ca08e58c2..5d5094755fb6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_range.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_range.pyi @@ -53,9 +53,9 @@ class CellRange(Serialisable): @property def coord(self) -> str: ... @property - def rows(self) -> Generator[list[tuple[int, int]], None, None]: ... + def rows(self) -> Generator[list[tuple[int, int]]]: ... @property - def cols(self) -> Generator[list[tuple[int, int]], None, None]: ... + def cols(self) -> Generator[list[tuple[int, int]]]: ... @property def cells(self) -> product[tuple[int, int]]: ... def __copy__(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi index 87819280da3a..36a98ebc827c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi @@ -119,7 +119,7 @@ class Worksheet(_WorkbookChild): @overload def iter_rows( self, min_row: int | None, max_row: int | None, min_col: int | None, max_col: int | None, values_only: Literal[True] - ) -> Generator[tuple[_CellGetValue, ...], None, None]: ... + ) -> Generator[tuple[_CellGetValue, ...]]: ... @overload def iter_rows( self, @@ -129,7 +129,7 @@ class Worksheet(_WorkbookChild): max_col: int | None = None, *, values_only: Literal[True], - ) -> Generator[tuple[_CellGetValue, ...], None, None]: ... + ) -> Generator[tuple[_CellGetValue, ...]]: ... @overload def iter_rows( self, @@ -138,11 +138,11 @@ class Worksheet(_WorkbookChild): min_col: int | None = None, max_col: int | None = None, values_only: Literal[False] = False, - ) -> Generator[tuple[_CellOrMergedCell, ...], None, None]: ... + ) -> Generator[tuple[_CellOrMergedCell, ...]]: ... @overload def iter_rows( self, min_row: int | None, max_row: int | None, min_col: int | None, max_col: int | None, values_only: bool - ) -> Generator[tuple[_CellOrMergedCell, ...], None, None] | Generator[tuple[_CellGetValue, ...], None, None]: ... + ) -> Generator[tuple[_CellOrMergedCell, ...]] | Generator[tuple[_CellGetValue, ...]]: ... @overload def iter_rows( self, @@ -152,15 +152,15 @@ class Worksheet(_WorkbookChild): max_col: int | None = None, *, values_only: bool, - ) -> Generator[tuple[_CellOrMergedCell, ...], None, None] | Generator[tuple[_CellGetValue, ...], None, None]: ... + ) -> Generator[tuple[_CellOrMergedCell, ...]] | Generator[tuple[_CellGetValue, ...]]: ... @property - def rows(self) -> Generator[tuple[_CellOrMergedCell, ...], None, None]: ... + def rows(self) -> Generator[tuple[_CellOrMergedCell, ...]]: ... @property def values(self) -> Generator[tuple[_CellGetValue, ...]]: ... @overload def iter_cols( self, min_col: int | None, max_col: int | None, min_row: int | None, max_row: int | None, values_only: Literal[True] - ) -> Generator[tuple[_CellGetValue, ...], None, None]: ... + ) -> Generator[tuple[_CellGetValue, ...]]: ... @overload def iter_cols( self, @@ -170,7 +170,7 @@ class Worksheet(_WorkbookChild): max_row: int | None = None, *, values_only: Literal[True], - ) -> Generator[tuple[_CellGetValue, ...], None, None]: ... + ) -> Generator[tuple[_CellGetValue, ...]]: ... @overload def iter_cols( self, @@ -179,11 +179,11 @@ class Worksheet(_WorkbookChild): min_row: int | None = None, max_row: int | None = None, values_only: Literal[False] = False, - ) -> Generator[tuple[_CellOrMergedCell, ...], None, None]: ... + ) -> Generator[tuple[_CellOrMergedCell, ...]]: ... @overload def iter_cols( self, min_col: int | None, max_col: int | None, min_row: int | None, max_row: int | None, values_only: bool - ) -> Generator[tuple[_CellOrMergedCell, ...], None, None] | Generator[tuple[_CellGetValue, ...], None, None]: ... + ) -> Generator[tuple[_CellOrMergedCell, ...]] | Generator[tuple[_CellGetValue, ...]]: ... @overload def iter_cols( self, @@ -193,9 +193,9 @@ class Worksheet(_WorkbookChild): max_row: int | None = None, *, values_only: bool, - ) -> Generator[tuple[_CellOrMergedCell, ...], None, None] | Generator[tuple[_CellGetValue, ...], None, None]: ... + ) -> Generator[tuple[_CellOrMergedCell, ...]] | Generator[tuple[_CellGetValue, ...]]: ... @property - def columns(self) -> Generator[tuple[_CellOrMergedCell, ...], None, None]: ... + def columns(self) -> Generator[tuple[_CellOrMergedCell, ...]]: ... @property def column_groups(self) -> list[str]: ... def set_printer_settings( diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi index cbdac51f363c..6dfbd17513c1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi @@ -2,7 +2,7 @@ from _typeshed import Incomplete, ReadableBuffer from collections.abc import Iterable, Iterator, Mapping, Sequence -from typing import Any, Protocol, TypeVar, overload +from typing import Any, Protocol, TypeVar, overload, type_check_only from typing_extensions import TypeAlias from xml.etree.ElementTree import Element, ElementTree, QName, XMLParser, _FileRead @@ -17,34 +17,52 @@ _T_co = TypeVar("_T_co", covariant=True) # Usually an Element() from either lxml or xml.etree (has a 'tag' element) # lxml.etree._Element # xml.etree.Element +@type_check_only class _HasTag(Protocol): tag: str +@type_check_only class _HasGet(Protocol[_T_co]): def get(self, value: str, /) -> _T_co | None: ... +@type_check_only class _HasText(Protocol): text: str +@type_check_only class _HasAttrib(Protocol): attrib: Iterable[Any] # AnyOf[dict[str, str], Iterable[tuple[str, str]]] +@type_check_only class _HasTagAndGet(_HasTag, _HasGet[_T_co], Protocol[_T_co]): ... # noqa: Y046 + +@type_check_only class _HasTagAndText(_HasTag, _HasText, Protocol): ... # noqa: Y046 + +@type_check_only class _HasTagAndTextAndAttrib(_HasTag, _HasText, _HasAttrib, Protocol): ... # noqa: Y046 +@type_check_only class _SupportsFindChartLines(Protocol): def find(self, path: str, /) -> ChartLines | None: ... +@type_check_only class _SupportsFindAndIterAndAttribAndText( # noqa: Y046 _SupportsFindChartLines, Iterable[Incomplete], _HasAttrib, _HasText, Protocol ): ... + +@type_check_only class _SupportsIterAndAttrib(Iterable[Incomplete], _HasAttrib, Protocol): ... # noqa: Y046 + +@type_check_only class _SupportsIterAndAttribAndTextAndTag(Iterable[Incomplete], _HasAttrib, _HasText, _HasTag, Protocol): ... # noqa: Y046 + +@type_check_only class _SupportsIterAndAttribAndTextAndGet( # noqa: Y046 Iterable[Incomplete], _HasAttrib, _HasText, _HasGet[Incomplete], Protocol ): ... +@type_check_only class _ParentElement(Protocol[_T]): def makeelement(self, tag: str, attrib: dict[str, str], /) -> _T: ... def append(self, element: _T, /) -> object: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/METADATA.toml index 80a499c5b6a3..110d9ccd1660 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/opentracing/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/opentracing/METADATA.toml @@ -1,2 +1,2 @@ version = "2.4.*" -upstream_repository = "https://github.com/opentracing/opentracing-python" +upstream-repository = "https://github.com/opentracing/opentracing-python" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/METADATA.toml index 1531573c8118..c8dd52bb39f4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/METADATA.toml @@ -1,8 +1,8 @@ version = "4.0.*" -upstream_repository = "https://github.com/paramiko/paramiko" +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 -ci_platforms = ["linux", "win32"] +ci-platforms = ["linux", "win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/util.pyi index f45123625b4e..be94a8a23053 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/paramiko/paramiko/util.pyi @@ -3,15 +3,12 @@ from collections.abc import Iterable from hashlib import _Hash from logging import Logger, LogRecord from types import TracebackType -from typing import IO, AnyStr, Protocol +from typing import IO, AnyStr from typing_extensions import Self from paramiko.config import SSHConfig, SSHConfigDict from paramiko.hostkeys import HostKeys -class SupportsClose(Protocol): - def close(self) -> None: ... - def inflate_long(s: bytes | bytearray, always_positive: bool = False) -> int: ... def deflate_long(n: int, add_sign_padding: bool = True) -> bytes: ... def format_binary(data: bytes | bytearray, prefix: str = "") -> list[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/METADATA.toml index 8d2d5ca5fe07..4cd095524d0e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/parsimonious/METADATA.toml @@ -1,2 +1,2 @@ version = "0.11.*" -upstream_repository = "https://github.com/erikrose/parsimonious" +upstream-repository = "https://github.com/erikrose/parsimonious" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/passpy/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/passpy/METADATA.toml index 106c6bf5e359..e72164f1cb04 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/passpy/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/passpy/METADATA.toml @@ -1,2 +1,2 @@ version = "1.0.*" -upstream_repository = "https://github.com/bfrascher/passpy" +upstream-repository = "https://github.com/bfrascher/passpy" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/peewee/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/peewee/METADATA.toml index 5fc0f5088484..f97c0bd4732b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/peewee/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/peewee/METADATA.toml @@ -1,10 +1,10 @@ version = "4.0.0" -upstream_repository = "https://github.com/coleifer/peewee" +upstream-repository = "https://github.com/coleifer/peewee" # We're not providing stubs for all playhouse modules right now # https://github.com/python/typeshed/pull/11731#issuecomment-2065729058 -partial_stub = true +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 +ignore-missing-stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/peewee/peewee.pyi b/packages/pyright-internal/typeshed-fallback/stubs/peewee/peewee.pyi index 13f5b1922710..158614cd7f6f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/peewee/peewee.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/peewee/peewee.pyi @@ -44,7 +44,7 @@ CSQ_PARENTHESES_NEVER: Final = 0 CSQ_PARENTHESES_ALWAYS: Final = 1 CSQ_PARENTHESES_UNNESTED: Final = 2 -def chunked(it, n) -> Generator[Incomplete, None, None]: ... +def chunked(it, n) -> Generator[Incomplete]: ... class _callable_context_manager: def __call__(self, fn): ... @@ -573,7 +573,7 @@ class SelectBase(_HashableSource, Source, SelectQuery): # type: ignore[misc] def peek(self, database=None, n: int = 1): ... def first(self, database=None, n: int = 1): ... def scalar(self, database=None, as_tuple: bool = False, as_dict: bool = False): ... - def scalars(self, database=None) -> Generator[Incomplete, None, None]: ... + def scalars(self, database=None) -> Generator[Incomplete]: ... def count(self, database=None, clear_limit: bool = False): ... def exists(self, database=None) -> bool: ... def get(self, database=None): ... @@ -818,7 +818,7 @@ class Database(_callable_context_manager): def begin(self) -> None: ... def commit(self) -> None: ... def rollback(self) -> None: ... - def batch_commit(self, it, n) -> Generator[Incomplete, None, None]: ... + def batch_commit(self, it, n) -> Generator[Incomplete]: ... def table_exists(self, table_name, schema: str | None = None) -> bool: ... def get_tables(self, schema: str | None = None) -> list[str]: ... def get_indexes(self, table, schema: str | None = None) -> list[IndexMetadata]: ... @@ -1057,7 +1057,7 @@ class CursorWrapper: def initialize(self) -> None: ... def iterate(self, cache: bool = True): ... def process_row(self, row): ... - def iterator(self) -> Generator[Incomplete, None, None]: ... + def iterator(self) -> Generator[Incomplete]: ... def fill_cache(self, n: int = 0) -> None: ... class DictCursorWrapper(CursorWrapper): @@ -1666,9 +1666,7 @@ class Model(metaclass=ModelBase): def dirty_fields(self) -> list[Incomplete]: ... @property def dirty_field_names(self) -> list[Incomplete]: ... - def dependencies( - self, search_nullable: bool = True, exclude_null_children: bool = False - ) -> Generator[Incomplete, None, None]: ... + def dependencies(self, search_nullable: bool = True, exclude_null_children: bool = False) -> Generator[Incomplete]: ... def delete_instance(self, recursive: bool = False, delete_nullable: bool = False): ... def __hash__(self) -> int: ... def __eq__(self, other) -> Expression | bool: ... # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pep8-naming/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pep8-naming/METADATA.toml index 7f9d2dc3ec32..3b73248f1786 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pep8-naming/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pep8-naming/METADATA.toml @@ -1,2 +1,2 @@ version = "0.15.*" -upstream_repository = "https://github.com/PyCQA/pep8-naming" +upstream-repository = "https://github.com/PyCQA/pep8-naming" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pexpect/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pexpect/METADATA.toml index 1cc4d2731df2..6e7cab5fa1ad 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pexpect/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pexpect/METADATA.toml @@ -1,2 +1,2 @@ version = "4.9.*" -upstream_repository = "https://github.com/pexpect/pexpect" +upstream-repository = "https://github.com/pexpect/pexpect" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pika/METADATA.toml index e3b0e6a04e05..a8d7d10908ab 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pika/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/METADATA.toml @@ -1,10 +1,10 @@ version = "1.3.*" -upstream_repository = "https://github.com/pika/pika" -stub_distribution = "types-pika-ts" # https://github.com/python/typeshed/issues/9246 -extra_description = """\ +upstream-repository = "https://github.com/pika/pika" +stub-distribution = "types-pika-ts" # https://github.com/python/typeshed/issues/9246 +extra-description = """\ The `types-pika` package contains alternate, more complete type stubs, that \ are maintained outside of typeshed.\ """ [tool.stubtest] -stubtest_requirements = ["gevent", "tornado", "twisted"] +stubtest-dependencies = ["gevent", "tornado", "twisted"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/blocking_connection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/blocking_connection.pyi index 4dece0843e82..6832239c6198 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/blocking_connection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pika/pika/adapters/blocking_connection.pyi @@ -196,7 +196,7 @@ class BlockingChannel: def stop_consuming(self, consumer_tag=None) -> None: ... def consume( self, queue, auto_ack: bool = False, exclusive: bool = False, arguments=None, inactivity_timeout=None - ) -> Generator[Incomplete, None, None]: ... + ) -> Generator[Incomplete]: ... def get_waiting_message_count(self): ... def cancel(self): ... def basic_ack(self, delivery_tag: int = 0, multiple: bool = False) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/polib/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/polib/METADATA.toml index 5b7355447c2d..959b3806d798 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/polib/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/polib/METADATA.toml @@ -1,2 +1,2 @@ version = "1.2.*" -upstream_repository = "https://github.com/izimobil/polib" +upstream-repository = "https://github.com/izimobil/polib" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pony/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pony/METADATA.toml index 4110f557f94f..a5975306faa8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pony/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pony/METADATA.toml @@ -1,3 +1,3 @@ version = "0.7.*" -upstream_repository = "https://github.com/ponyorm/pony" -requires = ["types-psycopg2", "types-PyMySQL"] +upstream-repository = "https://github.com/ponyorm/pony" +dependencies = ["types-psycopg2", "types-PyMySQL"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pony/pony/flask/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pony/pony/flask/__init__.pyi index ce220f1b7d60..080bcc2272aa 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pony/pony/flask/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pony/pony/flask/__init__.pyi @@ -1,8 +1,9 @@ from _typeshed import Incomplete from types import ModuleType -from typing import Protocol +from typing import Protocol, type_check_only # Protocol for flask.Flask class +@type_check_only class _Flask(Protocol): def before_request(self, f): ... def after_request(self, f): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/portpicker/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/portpicker/METADATA.toml index 626dbf6c4518..17d27f8a5e10 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/portpicker/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/portpicker/METADATA.toml @@ -1,2 +1,2 @@ version = "1.6.*" -upstream_repository = "https://github.com/google/python_portpicker" +upstream-repository = "https://github.com/google/python_portpicker" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/METADATA.toml index fc8dfe341705..78387ac33475 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/METADATA.toml @@ -1,9 +1,9 @@ # Using an exact number in the specifier for scripts/sync_protobuf/google_protobuf.py # When updating, also re-run the script -version = "~=6.32.1" -upstream_repository = "https://github.com/protocolbuffers/protobuf" -extra_description = "Partially generated using [mypy-protobuf==3.6.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.6.0) and libprotoc 31.1 on [protobuf v32.1](https://github.com/protocolbuffers/protobuf/releases/tag/v32.1) (python `protobuf==6.32.1`)." -partial_stub = true +version = "~=7.34.1" +upstream-repository = "https://github.com/protocolbuffers/protobuf" +extra-description = "Partially generated using [mypy-protobuf==3.6.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.6.0) and libprotoc 34.1 on [protobuf v34.1](https://github.com/protocolbuffers/protobuf/releases/tag/v34.1) (python `protobuf==7.34.1`)." +partial-stub = true [tool.stubtest] -ignore_missing_stub = true +ignore-missing-stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/_upb/_message.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/_upb/_message.pyi index 3ebfc2808dd8..454b93febff5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/_upb/_message.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/_upb/_message.pyi @@ -1,6 +1,23 @@ -from _typeshed import Incomplete -from typing import ClassVar, final -from typing_extensions import Self +from collections.abc import Callable, Iterable, Mapping, Sequence +from typing import Any, ClassVar, final +from typing_extensions import Self, disjoint_base + +from google.protobuf.descriptor_pb2 import ( + DescriptorProto, + EnumDescriptorProto, + EnumOptions, + EnumValueOptions, + FeatureSetDefaults, + FieldOptions, + FileDescriptorProto, + FileOptions, + MessageOptions, + MethodDescriptorProto, + MethodOptions, + OneofOptions, + ServiceDescriptorProto, + ServiceOptions, +) default_pool: DescriptorPool @@ -9,93 +26,93 @@ class Arena: ... @final class Descriptor: - containing_type: Incomplete - enum_types: Incomplete - enum_types_by_name: Incomplete - enum_values_by_name: Incomplete - extension_ranges: Incomplete - extensions: Incomplete - extensions_by_name: Incomplete - fields: Incomplete - fields_by_camelcase_name: Incomplete - fields_by_name: Incomplete - fields_by_number: Incomplete - file: Incomplete - full_name: Incomplete - has_options: Incomplete - is_extendable: Incomplete - name: Incomplete - nested_types: Incomplete - nested_types_by_name: Incomplete - oneofs: Incomplete - oneofs_by_name: Incomplete - def __new__(cls, *args, **kwargs) -> Self: ... # incomplete - def CopyToProto(self, object, /): ... - def EnumValueName(self, *args, **kwargs): ... # incomplete - def GetOptions(self): ... + containing_type: Descriptor | None + enum_types: Sequence[EnumDescriptor] + enum_types_by_name: Mapping[str, EnumDescriptor] + enum_values_by_name: dict[str, EnumValueDescriptor] + extension_ranges: list[tuple[int, int]] + extensions: Sequence[FieldDescriptor] + extensions_by_name: Mapping[str, FieldDescriptor] + fields: Sequence[FieldDescriptor] + fields_by_camelcase_name: Mapping[str, FieldDescriptor] + fields_by_name: Mapping[str, FieldDescriptor] + fields_by_number: Mapping[int, FieldDescriptor] + file: FileDescriptor + full_name: str + has_options: bool + is_extendable: bool + name: str + nested_types: Sequence[Descriptor] + nested_types_by_name: Mapping[str, Descriptor] + oneofs: Sequence[OneofDescriptor] + oneofs_by_name: Mapping[str, OneofDescriptor] + def __new__(cls, *args, **kwargs) -> Self: ... + def CopyToProto(self, proto: DescriptorProto, /) -> None: ... + def EnumValueName(self, enum: str, value: int) -> str: ... + def GetOptions(self) -> MessageOptions: ... @final class DescriptorPool: - def __new__(cls, *args, **kwargs) -> Self: ... # incomplete - def Add(self, object, /): ... - def AddSerializedFile(self, object, /): ... - def FindAllExtensions(self, object, /): ... - def FindEnumTypeByName(self, object, /): ... - def FindExtensionByName(self, object, /): ... - def FindExtensionByNumber(self, *args, **kwargs): ... # incomplete - def FindFieldByName(self, object, /): ... - def FindFileByName(self, object, /): ... - def FindFileContainingSymbol(self, object, /): ... - def FindMessageTypeByName(self, object, /): ... - def FindMethodByName(self, object, /): ... - def FindOneofByName(self, object, /): ... - def FindServiceByName(self, object, /): ... - def SetFeatureSetDefaults(self, object, /): ... + def __new__(cls, *args, **kwargs) -> Self: ... + def Add(self, file_desc_proto: FileDescriptorProto, /) -> None: ... + def AddSerializedFile(self, serialized_file_desc_proto: bytes, /) -> FileDescriptor: ... + def FindAllExtensions(self, message_descriptor: Descriptor, /) -> list[FieldDescriptor]: ... + def FindEnumTypeByName(self, full_name: str, /) -> EnumDescriptor: ... + def FindExtensionByName(self, full_name: str, /) -> FieldDescriptor: ... + def FindExtensionByNumber(self, message_descriptor: Descriptor, number: int, /) -> FieldDescriptor: ... + def FindFieldByName(self, full_name: str, /) -> FieldDescriptor: ... + def FindFileByName(self, file_name: str, /) -> FileDescriptor: ... + def FindFileContainingSymbol(self, symbol: str, /) -> FileDescriptor: ... + def FindMessageTypeByName(self, full_name: str, /) -> Descriptor: ... + def FindMethodByName(self, full_name: str, /) -> MethodDescriptor: ... + def FindOneofByName(self, full_name: str, /) -> OneofDescriptor: ... + def FindServiceByName(self, full_name: str, /) -> ServiceDescriptor: ... + def SetFeatureSetDefaults(self, defaults: FeatureSetDefaults, /) -> None: ... @final class EnumDescriptor: - containing_type: Incomplete - file: Incomplete - full_name: Incomplete - has_options: Incomplete - is_closed: Incomplete - name: Incomplete - values: Incomplete - values_by_name: Incomplete - values_by_number: Incomplete - def __new__(cls, *args, **kwargs) -> Self: ... # incomplete - def CopyToProto(self, object, /): ... - def GetOptions(self): ... + containing_type: Descriptor | None + file: FileDescriptor + full_name: str + has_options: bool + is_closed: bool + name: str + values: Sequence[EnumValueDescriptor] + values_by_name: Mapping[str, EnumValueDescriptor] + values_by_number: Mapping[int, EnumValueDescriptor] + def __new__(cls, *args, **kwargs) -> Self: ... + def CopyToProto(self, proto: EnumDescriptorProto, /) -> None: ... + def GetOptions(self) -> EnumOptions: ... @final class EnumValueDescriptor: - has_options: Incomplete - index: Incomplete - name: Incomplete - number: Incomplete - type: Incomplete - def __new__(cls, *args, **kwargs) -> Self: ... # incomplete - def GetOptions(self): ... + has_options: bool + index: int + name: str + number: int + type: EnumDescriptor + def __new__(cls, *args, **kwargs) -> Self: ... + def GetOptions(self) -> EnumValueOptions: ... @final class ExtensionDict: - def __contains__(self, other, /) -> bool: ... - def __delitem__(self, other, /) -> None: ... + def __contains__(self, extension_handle: FieldDescriptor, /) -> bool: ... + def __delitem__(self, extension_handle: FieldDescriptor, /) -> None: ... def __eq__(self, other: object, /) -> bool: ... def __ge__(self, other: object, /) -> bool: ... - def __getitem__(self, index, /): ... + def __getitem__(self, extension_handle: FieldDescriptor, /) -> Any: ... # Any: Message, scalar, or container def __gt__(self, other: object, /) -> bool: ... - def __iter__(self): ... + def __iter__(self) -> ExtensionIterator: ... def __le__(self, other: object, /) -> bool: ... def __len__(self) -> int: ... def __lt__(self, other: object, /) -> bool: ... def __ne__(self, other: object, /) -> bool: ... - def __setitem__(self, index, object, /) -> None: ... + def __setitem__(self, extension_handle: FieldDescriptor, value: Any, /) -> None: ... # Any: Message, scalar, or container @final class ExtensionIterator: - def __iter__(self): ... - def __next__(self): ... + def __iter__(self) -> Self: ... + def __next__(self) -> FieldDescriptor: ... @final class FieldDescriptor: @@ -131,181 +148,187 @@ class FieldDescriptor: TYPE_STRING: ClassVar[int] = ... TYPE_UINT32: ClassVar[int] = ... TYPE_UINT64: ClassVar[int] = ... - camelcase_name: Incomplete - containing_oneof: Incomplete - containing_type: Incomplete - cpp_type: Incomplete - default_value: Incomplete - enum_type: Incomplete - extension_scope: Incomplete - file: Incomplete - full_name: Incomplete - has_default_value: Incomplete - has_options: Incomplete - has_presence: Incomplete - index: Incomplete - is_extension: Incomplete - is_packed: Incomplete - json_name: Incomplete - label: Incomplete - message_type: Incomplete - name: Incomplete - number: Incomplete - type: Incomplete - def __new__(cls, *args, **kwargs) -> Self: ... # incomplete - def GetOptions(self): ... + camelcase_name: str + containing_oneof: OneofDescriptor | None + containing_type: Descriptor | None + cpp_type: int + default_value: Any # Any: str, int, float, bytes, or bool + enum_type: EnumDescriptor | None + extension_scope: Descriptor | None + file: FileDescriptor + full_name: str + has_default_value: bool + has_options: bool + has_presence: bool + index: int + is_extension: bool + is_packed: bool + is_repeated: bool + is_required: bool + json_name: str + message_type: Descriptor | None + name: str + number: int + type: int + def __new__(cls, *args, **kwargs) -> Self: ... + def GetOptions(self) -> FieldOptions: ... @final class FileDescriptor: - dependencies: Incomplete - enum_types_by_name: Incomplete - extensions_by_name: Incomplete - has_options: Incomplete - message_types_by_name: Incomplete - name: Incomplete - package: Incomplete - pool: Incomplete - public_dependencies: Incomplete - serialized_pb: Incomplete - services_by_name: Incomplete - def __new__(cls, *args, **kwargs) -> Self: ... # incomplete - def CopyToProto(self, object, /): ... - def GetOptions(self): ... + dependencies: Sequence[FileDescriptor] + enum_types_by_name: Mapping[str, EnumDescriptor] + extensions_by_name: Mapping[str, FieldDescriptor] + has_options: bool + message_types_by_name: Mapping[str, Descriptor] + name: str + package: str + pool: DescriptorPool + public_dependencies: Sequence[FileDescriptor] + serialized_pb: bytes + services_by_name: Mapping[str, ServiceDescriptor] + def __new__(cls, *args, **kwargs) -> Self: ... + def CopyToProto(self, proto: FileDescriptorProto, /) -> None: ... + def GetOptions(self) -> FileOptions: ... @final class MapIterator: - def __iter__(self): ... - def __next__(self): ... + def __iter__(self) -> Self: ... + def __next__(self) -> bool | int | str: ... @final class Message: - Extensions: Incomplete - def __init__(self, *args, **kwargs) -> None: ... # incomplete - def ByteSize(self): ... - def Clear(self): ... - def ClearExtension(self, object, /): ... - def ClearField(self, object, /): ... - def CopyFrom(self, object, /): ... - def DiscardUnknownFields(self): ... - def FindInitializationErrors(self): ... - @classmethod - def FromString(cls, object, /): ... - def HasExtension(self, object, /): ... - def HasField(self, object, /): ... - def IsInitialized(self, *args, **kwargs): ... # incomplete - def ListFields(self): ... - def MergeFrom(self, object, /): ... - def MergeFromString(self, object, /): ... - def ParseFromString(self, object, /): ... - def SerializePartialToString(self, *args, **kwargs): ... # incomplete - def SerializeToString(self, *args, **kwargs): ... # incomplete - def SetInParent(self): ... - def UnknownFields(self): ... - def WhichOneof(self, object, /): ... - def __contains__(self, other, /) -> bool: ... - def __deepcopy__(self, memo=None): ... - def __delattr__(self, name, /): ... + Extensions: ExtensionDict + def __init__(self, *args, **kwargs) -> None: ... + def __contains__(self, field_name_or_key: str, /) -> bool: ... + def __deepcopy__(self, memo: Any = None) -> Self: ... + def __delattr__(self, name: str, /) -> None: ... def __eq__(self, other: object, /) -> bool: ... def __ge__(self, other: object, /) -> bool: ... def __gt__(self, other: object, /) -> bool: ... def __le__(self, other: object, /) -> bool: ... def __lt__(self, other: object, /) -> bool: ... def __ne__(self, other: object, /) -> bool: ... - def __setattr__(self, name, value, /): ... + def __setattr__(self, name: str, value: Any, /) -> None: ... # Any: str, int, float, bytes, bool, or Message + def MergeFrom(self, other_msg: Message, /) -> None: ... + def CopyFrom(self, other_msg: Message, /) -> None: ... + def Clear(self) -> None: ... + def SetInParent(self) -> None: ... + def IsInitialized(self, errors: list[str] | None = None) -> bool: ... + def MergeFromString(self, serialized: bytes, /) -> int: ... + def ParseFromString(self, serialized: bytes, /) -> int: ... + def SerializeToString(self, *, deterministic: bool = ...) -> bytes: ... + def SerializePartialToString(self, *, deterministic: bool = ...) -> bytes: ... + def ListFields(self) -> list[tuple[FieldDescriptor, Any]]: ... # Any: str, int, float, bytes, bool, or Message + def HasField(self, field_name: str, /) -> bool: ... + def ClearField(self, field_name: str, /) -> None: ... + def WhichOneof(self, oneof_group: str, /) -> str | None: ... + def HasExtension(self, field_descriptor: FieldDescriptor, /) -> bool: ... + def ClearExtension(self, field_descriptor: FieldDescriptor, /) -> None: ... + def UnknownFields(self) -> UnknownFieldSet: ... + def DiscardUnknownFields(self) -> None: ... + def ByteSize(self) -> int: ... + @classmethod + def FromString(cls, s: bytes, /) -> Self: ... + def FindInitializationErrors(self) -> list[str]: ... -@final +@disjoint_base class MessageMeta(type): ... @final class MethodDescriptor: - client_streaming: Incomplete - containing_service: Incomplete - full_name: Incomplete - index: Incomplete - input_type: Incomplete - name: Incomplete - output_type: Incomplete - server_streaming: Incomplete - def __new__(cls, *args, **kwargs) -> Self: ... # incomplete - def CopyToProto(self, object, /): ... - def GetOptions(self): ... + client_streaming: bool + containing_service: ServiceDescriptor + full_name: str + has_options: bool + index: int + input_type: Descriptor + name: str + output_type: Descriptor + server_streaming: bool + def __new__(cls, *args, **kwargs) -> Self: ... + def CopyToProto(self, proto: MethodDescriptorProto, /) -> None: ... + def GetOptions(self) -> MethodOptions: ... @final class OneofDescriptor: - containing_type: Incomplete - fields: Incomplete - full_name: Incomplete - has_options: Incomplete - index: Incomplete - name: Incomplete - def __new__(cls, *args, **kwargs) -> Self: ... # incomplete - def GetOptions(self): ... + containing_type: Descriptor + fields: Sequence[FieldDescriptor] + full_name: str + has_options: bool + index: int + name: str + def __new__(cls, *args, **kwargs) -> Self: ... + def GetOptions(self) -> OneofOptions: ... @final class RepeatedCompositeContainer: - def __new__(cls, *args, **kwargs) -> Self: ... # incomplete - def MergeFrom(self, object, /): ... - def add(self, *args, **kwargs): ... # incomplete - def append(self, object, /): ... - def extend(self, object, /): ... - def insert(self, *args, **kwargs): ... # incomplete - def pop(self, *args, **kwargs): ... # incomplete - def remove(self, object, /): ... - def reverse(self): ... - def sort(self, *args, **kwargs): ... # incomplete - def __deepcopy__(self, memo=None): ... - def __delitem__(self, other, /) -> None: ... + def __new__(cls, *args, **kwargs) -> Self: ... + def MergeFrom(self, other: RepeatedCompositeContainer | Iterable[Message], /) -> None: ... + def add(self, **kwargs: Any) -> Message: ... # Any: field names and values + def append(self, value: Message, /) -> None: ... + def extend(self, values: Iterable[Message], /) -> None: ... + def insert(self, key: int, value: Message, /) -> None: ... + def pop(self, key: int = -1, /) -> Message: ... + def remove(self, value: Message, /) -> None: ... + def reverse(self) -> None: ... + def sort(self, *, key: Callable[[Any], Any] | None = None, reverse: bool = False) -> None: ... + def clear(self) -> None: ... + def __deepcopy__(self, memo: Any = None) -> RepeatedCompositeContainer: ... + def __delitem__(self, key: int | slice, /) -> None: ... def __eq__(self, other: object, /) -> bool: ... def __ge__(self, other: object, /) -> bool: ... - def __getitem__(self, index, /): ... + def __getitem__(self, index: int | slice, /) -> Message: ... def __gt__(self, other: object, /) -> bool: ... def __le__(self, other: object, /) -> bool: ... def __len__(self) -> int: ... def __lt__(self, other: object, /) -> bool: ... def __ne__(self, other: object, /) -> bool: ... - def __setitem__(self, index, object, /) -> None: ... + def __setitem__(self, index: int | slice, value: Message, /) -> None: ... @final class RepeatedScalarContainer: - def __new__(cls, *args, **kwargs) -> Self: ... # incomplete - def MergeFrom(self, object, /): ... - def append(self, object, /): ... - def extend(self, object, /): ... - def insert(self, *args, **kwargs): ... # incomplete - def pop(self, *args, **kwargs): ... # incomplete - def remove(self, object, /): ... - def reverse(self): ... - def sort(self, *args, **kwargs): ... # incomplete - def __deepcopy__(self, memo=None): ... - def __delitem__(self, other, /) -> None: ... + def __new__(cls, *args, **kwargs) -> Self: ... + def MergeFrom(self, other: Any, /) -> None: ... # Any: bool, int, float, str, or bytes + def append(self, value: Any, /) -> None: ... + def extend(self, values: Any, /) -> None: ... + def insert(self, key: int, value: Any, /) -> None: ... + def pop(self, key: int = -1, /) -> Any: ... + def remove(self, value: Any, /) -> None: ... + def reverse(self) -> None: ... + def sort(self, *, key: Callable[[Any], Any] | None = None, reverse: bool = False) -> None: ... + def clear(self) -> None: ... + def __array__(self, dtype: Any = None, copy: bool | None = None) -> Any: ... # Any: numpy types + def __deepcopy__(self, memo: Any = None) -> RepeatedScalarContainer: ... + def __delitem__(self, key: int | slice, /) -> None: ... def __eq__(self, other: object, /) -> bool: ... def __ge__(self, other: object, /) -> bool: ... - def __getitem__(self, index, /): ... + def __getitem__(self, index: int | slice, /) -> Any: ... def __gt__(self, other: object, /) -> bool: ... def __le__(self, other: object, /) -> bool: ... def __len__(self) -> int: ... def __lt__(self, other: object, /) -> bool: ... def __ne__(self, other: object, /) -> bool: ... - def __reduce__(self): ... - def __setitem__(self, index, object, /) -> None: ... + def __reduce__(self) -> tuple[Any, ...]: ... + def __setitem__(self, index: int | slice, value: Any, /) -> None: ... @final class ServiceDescriptor: - file: Incomplete - full_name: Incomplete - index: Incomplete - methods: Incomplete - methods_by_name: Incomplete - name: Incomplete - def __new__(cls, *args, **kwargs) -> Self: ... # incomplete - def CopyToProto(self, object, /): ... - def FindMethodByName(self, object, /): ... - def GetOptions(self): ... + file: FileDescriptor + full_name: str + has_options: bool + index: int + methods: Sequence[MethodDescriptor] + methods_by_name: Mapping[str, MethodDescriptor] + name: str + def __new__(cls, *args, **kwargs) -> Self: ... + def CopyToProto(self, proto: ServiceDescriptorProto, /) -> None: ... + def FindMethodByName(self, name: str, /) -> MethodDescriptor: ... + def GetOptions(self) -> ServiceOptions: ... @final class UnknownFieldSet: - def __new__(cls, *args, **kwargs) -> Self: ... # incomplete - def __getitem__(self, index, /): ... + def __new__(cls, *args, **kwargs) -> Self: ... + def __getitem__(self, index: int, /) -> Any: ... # Any: internal unknown field object def __len__(self) -> int: ... -def SetAllowOversizeProtos(object, /): ... # incomplete +def SetAllowOversizeProtos(allow: bool, /) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/any.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/any.pyi new file mode 100644 index 000000000000..72be6e49e191 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/any.pyi @@ -0,0 +1,13 @@ +from typing import TypeVar + +from google.protobuf.any_pb2 import Any +from google.protobuf.descriptor import Descriptor +from google.protobuf.message import Message + +_MessageT = TypeVar("_MessageT", bound=Message) + +def pack(msg: Message, type_url_prefix: str | None = "type.googleapis.com/", deterministic: bool | None = None) -> Any: ... +def unpack(any_msg: Any, msg: Message) -> bool: ... +def unpack_as(any_msg: Any, message_type: type[_MessageT]) -> _MessageT: ... +def type_name(any_msg: Any) -> str: ... +def is_type(any_msg: Any, des: Descriptor) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor.pyi index 10fc7ef906f5..d470af98907f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor.pyi @@ -1,36 +1,43 @@ +from collections.abc import Mapping, Sequence from typing import Any from .descriptor_pb2 import ( + DescriptorProto, + EnumDescriptorProto, EnumOptions, EnumValueOptions, FieldOptions, + FileDescriptorProto, FileOptions, MessageOptions, + MethodDescriptorProto, MethodOptions, OneofOptions, + ServiceDescriptorProto, ServiceOptions, ) +from .descriptor_pool import DescriptorPool from .message import Message class Error(Exception): ... class TypeTransformationError(Error): ... class DescriptorMetaclass(type): - def __instancecheck__(self, obj: Any) -> bool: ... + def __instancecheck__(cls, obj: object) -> bool: ... _internal_create_key: object _USE_C_DESCRIPTORS: bool class DescriptorBase(metaclass=DescriptorMetaclass): - has_options: Any + has_options: bool def __init__(self, file, options, serialized_options, options_class_name) -> None: ... - def GetOptions(self): ... + def GetOptions(self) -> Any: ... # Any: overridden with specific *Options in subclasses class _NestedDescriptorBase(DescriptorBase): - name: Any - full_name: Any - file: Any - containing_type: Any + name: str + full_name: str + file: FileDescriptor + containing_type: Descriptor | None def __init__( self, options, @@ -43,87 +50,89 @@ class _NestedDescriptorBase(DescriptorBase): serialized_end=None, serialized_options=None, ) -> None: ... - def CopyToProto(self, proto): ... + def CopyToProto(self, proto: Any) -> None: ... # Any: overridden with specific *Proto in subclasses class Descriptor(_NestedDescriptorBase): - fields: Any - fields_by_number: Any - fields_by_name: Any - nested_types: Any - nested_types_by_name: Any - enum_types: Any - enum_types_by_name: Any - enum_values_by_name: Any - extensions: Any - extensions_by_name: Any - is_extendable: Any - extension_ranges: Any - oneofs: Any - oneofs_by_name: Any + fields: Sequence[FieldDescriptor] + fields_by_number: Mapping[int, FieldDescriptor] + fields_by_name: Mapping[str, FieldDescriptor] + @property + def fields_by_camelcase_name(self) -> Mapping[str, FieldDescriptor]: ... + nested_types: Sequence[Descriptor] + nested_types_by_name: Mapping[str, Descriptor] + enum_types: Sequence[EnumDescriptor] + enum_types_by_name: Mapping[str, EnumDescriptor] + enum_values_by_name: dict[str, EnumValueDescriptor] + extensions: Sequence[FieldDescriptor] + extensions_by_name: Mapping[str, FieldDescriptor] + is_extendable: bool + extension_ranges: list[tuple[int, int]] + oneofs: Sequence[OneofDescriptor] + oneofs_by_name: Mapping[str, OneofDescriptor] def __init__( self, name: str, full_name: str, - filename: Any, + filename: str | None, containing_type: Descriptor | None, fields: list[FieldDescriptor], nested_types: list[FieldDescriptor], enum_types: list[EnumDescriptor], extensions: list[FieldDescriptor], - options=None, - serialized_options=None, + options: MessageOptions | None = None, + serialized_options: bytes | None = None, is_extendable: bool | None = True, - extension_ranges=None, + extension_ranges: list[tuple[int, int]] | None = None, oneofs: list[OneofDescriptor] | None = None, file: FileDescriptor | None = None, - serialized_start=None, - serialized_end=None, + serialized_start: int | None = None, + serialized_end: int | None = None, syntax: str | None = None, - is_map_entry=False, - create_key=None, + is_map_entry: bool = False, + create_key: object | None = None, ): ... - def EnumValueName(self, enum, value): ... - def CopyToProto(self, proto): ... + def EnumValueName(self, enum: str, value: int) -> str: ... + def CopyToProto(self, proto: DescriptorProto) -> None: ... def GetOptions(self) -> MessageOptions: ... class FieldDescriptor(DescriptorBase): - TYPE_DOUBLE: Any - TYPE_FLOAT: Any - TYPE_INT64: Any - TYPE_UINT64: Any - TYPE_INT32: Any - TYPE_FIXED64: Any - TYPE_FIXED32: Any - TYPE_BOOL: Any - TYPE_STRING: Any - TYPE_GROUP: Any - TYPE_MESSAGE: Any - TYPE_BYTES: Any - TYPE_UINT32: Any - TYPE_ENUM: Any - TYPE_SFIXED32: Any - TYPE_SFIXED64: Any - TYPE_SINT32: Any - TYPE_SINT64: Any - MAX_TYPE: Any - CPPTYPE_INT32: Any - CPPTYPE_INT64: Any - CPPTYPE_UINT32: Any - CPPTYPE_UINT64: Any - CPPTYPE_DOUBLE: Any - CPPTYPE_FLOAT: Any - CPPTYPE_BOOL: Any - CPPTYPE_ENUM: Any - CPPTYPE_STRING: Any - CPPTYPE_MESSAGE: Any - MAX_CPPTYPE: Any - LABEL_OPTIONAL: Any - LABEL_REQUIRED: Any - LABEL_REPEATED: Any - MAX_LABEL: Any - MAX_FIELD_NUMBER: Any - FIRST_RESERVED_FIELD_NUMBER: Any - LAST_RESERVED_FIELD_NUMBER: Any + TYPE_DOUBLE: int + TYPE_FLOAT: int + TYPE_INT64: int + TYPE_UINT64: int + TYPE_INT32: int + TYPE_FIXED64: int + TYPE_FIXED32: int + TYPE_BOOL: int + TYPE_STRING: int + TYPE_GROUP: int + TYPE_MESSAGE: int + TYPE_BYTES: int + TYPE_UINT32: int + TYPE_ENUM: int + TYPE_SFIXED32: int + TYPE_SFIXED64: int + TYPE_SINT32: int + TYPE_SINT64: int + MAX_TYPE: int + CPPTYPE_INT32: int + CPPTYPE_INT64: int + CPPTYPE_UINT32: int + CPPTYPE_UINT64: int + CPPTYPE_DOUBLE: int + CPPTYPE_FLOAT: int + CPPTYPE_BOOL: int + CPPTYPE_ENUM: int + CPPTYPE_STRING: int + CPPTYPE_MESSAGE: int + MAX_CPPTYPE: int + LABEL_OPTIONAL: int + LABEL_REQUIRED: int + LABEL_REPEATED: int + MAX_LABEL: int + MAX_FIELD_NUMBER: int + FIRST_RESERVED_FIELD_NUMBER: int + LAST_RESERVED_FIELD_NUMBER: int def __new__( cls, name, @@ -147,14 +156,12 @@ class FieldDescriptor(DescriptorBase): file=None, create_key=None, ): ... - name: Any - full_name: Any - index: Any - number: Any - type: Any - cpp_type: Any - @property - def label(self): ... + name: str + full_name: str + index: int + number: int + type: int + cpp_type: int @property def is_required(self) -> bool: ... @property @@ -165,14 +172,15 @@ class FieldDescriptor(DescriptorBase): def has_presence(self) -> bool: ... @property def is_packed(self) -> bool: ... - has_default_value: Any - default_value: Any - containing_type: Any - message_type: Any - enum_type: Any - is_extension: Any - extension_scope: Any - containing_oneof: Any + has_default_value: bool + default_value: Any # Any: str, int, float, bytes, or bool + containing_type: Descriptor | None + message_type: Descriptor | None + enum_type: EnumDescriptor | None + is_extension: bool + extension_scope: Descriptor | None + containing_oneof: OneofDescriptor | None + json_name: str def __init__( self, name, @@ -197,7 +205,7 @@ class FieldDescriptor(DescriptorBase): create_key=None, ) -> None: ... @staticmethod - def ProtoTypeToCppProtoType(proto_type): ... + def ProtoTypeToCppProtoType(proto_type: int) -> int: ... def GetOptions(self) -> FieldOptions: ... class EnumDescriptor(_NestedDescriptorBase): @@ -215,9 +223,9 @@ class EnumDescriptor(_NestedDescriptorBase): serialized_end=None, create_key=None, ): ... - values: Any - values_by_name: Any - values_by_number: Any + values: Sequence[EnumValueDescriptor] + values_by_name: Mapping[str, EnumValueDescriptor] + values_by_number: Mapping[int, EnumValueDescriptor] def __init__( self, name, @@ -232,34 +240,36 @@ class EnumDescriptor(_NestedDescriptorBase): serialized_end=None, create_key=None, ) -> None: ... - def CopyToProto(self, proto): ... + @property + def is_closed(self) -> bool: ... + def CopyToProto(self, proto: EnumDescriptorProto) -> None: ... def GetOptions(self) -> EnumOptions: ... class EnumValueDescriptor(DescriptorBase): def __new__(cls, name, index, number, type=None, options=None, serialized_options=None, create_key=None): ... - name: Any - index: Any - number: Any - type: Any + name: str + index: int + number: int + type: EnumDescriptor def __init__(self, name, index, number, type=None, options=None, serialized_options=None, create_key=None) -> None: ... def GetOptions(self) -> EnumValueOptions: ... -class OneofDescriptor: +class OneofDescriptor(DescriptorBase): def __new__(cls, name, full_name, index, containing_type, fields, options=None, serialized_options=None, create_key=None): ... - name: Any - full_name: Any - index: Any - containing_type: Any - fields: Any + name: str + full_name: str + index: int + containing_type: Descriptor + fields: Sequence[FieldDescriptor] def __init__( self, name, full_name, index, containing_type, fields, options=None, serialized_options=None, create_key=None ) -> None: ... def GetOptions(self) -> OneofOptions: ... class ServiceDescriptor(_NestedDescriptorBase): - index: Any - methods: Any - methods_by_name: Any + index: int + methods: Sequence[MethodDescriptor] + methods_by_name: Mapping[str, MethodDescriptor] def __init__( self, name: str, @@ -267,14 +277,14 @@ class ServiceDescriptor(_NestedDescriptorBase): index: int, methods: list[MethodDescriptor], options: ServiceOptions | None = None, - serialized_options=None, + serialized_options: bytes | None = None, file: FileDescriptor | None = None, - serialized_start=None, - serialized_end=None, - create_key=None, + serialized_start: int | None = None, + serialized_end: int | None = None, + create_key: object | None = None, ): ... - def FindMethodByName(self, name): ... - def CopyToProto(self, proto): ... + def FindMethodByName(self, name: str) -> MethodDescriptor: ... + def CopyToProto(self, proto: ServiceDescriptorProto) -> None: ... def GetOptions(self) -> ServiceOptions: ... class MethodDescriptor(DescriptorBase): @@ -292,12 +302,12 @@ class MethodDescriptor(DescriptorBase): serialized_options=None, create_key=None, ): ... - name: Any - full_name: Any - index: Any - containing_service: Any - input_type: Any - output_type: Any + name: str + full_name: str + index: int + containing_service: ServiceDescriptor + input_type: Descriptor + output_type: Descriptor client_streaming: bool server_streaming: bool def __init__( @@ -314,6 +324,7 @@ class MethodDescriptor(DescriptorBase): serialized_options=None, create_key=None, ) -> None: ... + def CopyToProto(self, proto: MethodDescriptorProto) -> None: ... def GetOptions(self) -> MethodOptions: ... class FileDescriptor(DescriptorBase): @@ -332,16 +343,16 @@ class FileDescriptor(DescriptorBase): create_key=None, ): ... _options: Any - pool: Any - message_types_by_name: Any - name: Any - package: Any - serialized_pb: Any - enum_types_by_name: Any - extensions_by_name: Any - services_by_name: Any - dependencies: Any - public_dependencies: Any + pool: DescriptorPool + message_types_by_name: Mapping[str, Descriptor] + name: str + package: str + serialized_pb: bytes + enum_types_by_name: Mapping[str, EnumDescriptor] + extensions_by_name: Mapping[str, FieldDescriptor] + services_by_name: Mapping[str, ServiceDescriptor] + dependencies: Sequence[FileDescriptor] + public_dependencies: Sequence[FileDescriptor] def __init__( self, name, @@ -356,8 +367,15 @@ class FileDescriptor(DescriptorBase): pool=None, create_key=None, ) -> None: ... - def CopyToProto(self, proto): ... + def CopyToProto(self, proto: FileDescriptorProto) -> None: ... def GetOptions(self) -> FileOptions: ... -def MakeDescriptor(desc_proto, package="", build_file_if_cpp=True, syntax=None, edition=None, file_desc=None): ... def _ParseOptions(message: Message, string: bytes) -> Message: ... +def MakeDescriptor( + desc_proto: DescriptorProto, + package: str = "", + build_file_if_cpp: bool = True, + syntax: str | None = None, + edition: str | None = None, + file_desc: FileDescriptor | None = None, +) -> Descriptor: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_database.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_database.pyi index 6568fc2159cc..8f0b1927b502 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_database.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_database.pyi @@ -9,8 +9,8 @@ class DescriptorDatabaseConflictingDefinitionError(Error): ... class DescriptorDatabase: def __init__(self) -> None: ... - def Add(self, file_desc_proto) -> None: ... - def FindFileByName(self, name): ... - def FindFileContainingSymbol(self, symbol): ... - def FindFileContainingExtension(self, extendee_name, extension_number) -> FileDescriptorProto | None: ... - def FindAllExtensionNumbers(self, extendee_name) -> list[int]: ... + def Add(self, file_desc_proto: FileDescriptorProto) -> None: ... + def FindFileByName(self, name: str) -> FileDescriptorProto: ... + def FindFileContainingSymbol(self, symbol: str) -> FileDescriptorProto: ... + def FindFileContainingExtension(self, extendee_name: str, extension_number: int) -> FileDescriptorProto | None: ... + def FindAllExtensionNumbers(self, extendee_name: str) -> list[int]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pool.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pool.pyi index bb1d19004e84..59767efd7817 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pool.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor_pool.pyi @@ -1,22 +1,36 @@ from _typeshed import Unused +from typing import Any +from typing_extensions import Self + +from .descriptor import ( + Descriptor, + EnumDescriptor, + FieldDescriptor, + FileDescriptor, + MethodDescriptor, + OneofDescriptor, + ServiceDescriptor, +) +from .descriptor_pb2 import FeatureSetDefaults, FileDescriptorProto class DescriptorPool: - def __new__(cls, descriptor_db=None): ... + def __new__(cls, descriptor_db: Any = None) -> Self: ... def __init__( # pyright: ignore[reportInconsistentConstructor] - self, descriptor_db=None, use_deprecated_legacy_json_field_conflicts: Unused = False + self, descriptor_db: Any = None, use_deprecated_legacy_json_field_conflicts: Unused = False ) -> None: ... - def Add(self, file_desc_proto): ... - def AddSerializedFile(self, serialized_file_desc_proto): ... - def FindFileByName(self, file_name): ... - def FindFileContainingSymbol(self, symbol): ... - def FindMessageTypeByName(self, full_name): ... - def FindEnumTypeByName(self, full_name): ... - def FindFieldByName(self, full_name): ... - def FindOneofByName(self, full_name): ... - def FindExtensionByName(self, full_name): ... - def FindExtensionByNumber(self, message_descriptor, number): ... - def FindAllExtensions(self, message_descriptor): ... - def FindServiceByName(self, full_name): ... - def FindMethodByName(self, full_name): ... + def Add(self, file_desc_proto: FileDescriptorProto) -> None: ... + def AddSerializedFile(self, serialized_file_desc_proto: bytes) -> FileDescriptor: ... + def FindFileByName(self, file_name: str) -> FileDescriptor: ... + def FindFileContainingSymbol(self, symbol: str) -> FileDescriptor: ... + def FindMessageTypeByName(self, full_name: str) -> Descriptor: ... + def FindEnumTypeByName(self, full_name: str) -> EnumDescriptor: ... + def FindFieldByName(self, full_name: str) -> FieldDescriptor: ... + def FindOneofByName(self, full_name: str) -> OneofDescriptor: ... + def FindExtensionByName(self, full_name: str) -> FieldDescriptor: ... + def FindExtensionByNumber(self, message_descriptor: Descriptor, number: int) -> FieldDescriptor: ... + def FindAllExtensions(self, message_descriptor: Descriptor) -> list[FieldDescriptor]: ... + def FindServiceByName(self, full_name: str) -> ServiceDescriptor: ... + def FindMethodByName(self, full_name: str) -> MethodDescriptor: ... + def SetFeatureSetDefaults(self, defaults: FeatureSetDefaults) -> None: ... -def Default(): ... +def Default() -> DescriptorPool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/duration.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/duration.pyi new file mode 100644 index 000000000000..c7e858fedbf3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/duration.pyi @@ -0,0 +1,16 @@ +from datetime import timedelta + +from google.protobuf.duration_pb2 import Duration + +def from_json_string(value: str) -> Duration: ... +def from_microseconds(micros: float) -> Duration: ... +def from_milliseconds(millis: float) -> Duration: ... +def from_nanoseconds(nanos: float) -> Duration: ... +def from_seconds(seconds: float) -> Duration: ... +def from_timedelta(td: timedelta) -> Duration: ... +def to_json_string(duration: Duration) -> str: ... +def to_microseconds(duration: Duration) -> int: ... +def to_milliseconds(duration: Duration) -> int: ... +def to_nanoseconds(duration: Duration) -> int: ... +def to_seconds(duration: Duration) -> int: ... +def to_timedelta(duration: Duration) -> timedelta: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/builder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/builder.pyi index 0491b8e54357..a183f4c16d13 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/builder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/builder.pyi @@ -1,4 +1,9 @@ +from types import ModuleType from typing import Any -def BuildMessageAndEnumDescriptors(file_des, module: dict[str, Any]) -> None: ... -def BuildTopDescriptorsAndMessages(file_des, module_name: str, module: dict[str, Any]) -> None: ... +from google.protobuf.descriptor import FileDescriptor + +def BuildMessageAndEnumDescriptors(file_des: FileDescriptor, module: dict[str, Any]) -> None: ... +def BuildTopDescriptorsAndMessages(file_des: FileDescriptor, module_name: str, module: dict[str, Any]) -> None: ... +def AddHelpersToExtensions(file_des: FileDescriptor) -> None: ... +def BuildServices(file_des: FileDescriptor, module_name: str, module: ModuleType) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/containers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/containers.pyi index 6fa55546e9ae..37f681eb2d2f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/containers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/containers.pyi @@ -1,8 +1,7 @@ from collections.abc import Callable, Iterable, Iterator, MutableMapping, MutableSequence, Sequence from typing import Any, Protocol, SupportsIndex, TypeVar, overload, type_check_only -from typing_extensions import Self -from google.protobuf.descriptor import Descriptor +from google.protobuf.descriptor import Descriptor, FieldDescriptor from google.protobuf.internal.message_listener import MessageListener from google.protobuf.internal.python_message import GeneratedProtocolMessageType from google.protobuf.message import Message @@ -20,24 +19,26 @@ class _ValueChecker(Protocol[_T]): class BaseContainer(Sequence[_T]): __slots__ = ["_message_listener", "_values"] def __init__(self, message_listener: MessageListener) -> None: ... + @overload + def __getitem__(self, key: SupportsIndex) -> _T: ... + @overload + def __getitem__(self, key: slice) -> list[_T]: ... def __len__(self) -> int: ... def __ne__(self, other: object) -> bool: ... def __hash__(self) -> int: ... # Same as list.sort, the extra sort_function kwarg errors in Python 3 def sort(self, *, key: Callable[[_T], Any] | None = None, reverse: bool = False) -> None: ... def reverse(self) -> None: ... - @overload - def __getitem__(self, key: SupportsIndex) -> _T: ... - @overload - def __getitem__(self, key: slice) -> list[_T]: ... class RepeatedScalarFieldContainer(BaseContainer[_ScalarV], MutableSequence[_ScalarV]): __slots__ = ["_type_checker"] - def __init__(self, message_listener: MessageListener, type_checker: _ValueChecker[_ScalarV]) -> None: ... + def __init__( + self, message_listener: MessageListener, type_checker: _ValueChecker[_ScalarV], field: FieldDescriptor | None = None + ) -> None: ... def append(self, value: _ScalarV) -> None: ... def insert(self, key: int, value: _ScalarV) -> None: ... def extend(self, elem_seq: Iterable[_ScalarV] | None) -> None: ... - def MergeFrom(self, other: Self | Iterable[_ScalarV]) -> None: ... + def MergeFrom(self, other: RepeatedScalarFieldContainer[_ScalarV] | Iterable[_ScalarV]) -> None: ... def remove(self, elem: _ScalarV) -> None: ... def pop(self, key: int = -1) -> _ScalarV: ... @overload @@ -46,15 +47,17 @@ class RepeatedScalarFieldContainer(BaseContainer[_ScalarV], MutableSequence[_Sca def __setitem__(self, key: slice, value: Iterable[_ScalarV]) -> None: ... def __delitem__(self, key: int | slice) -> None: ... def __eq__(self, other: object) -> bool: ... + def __deepcopy__(self, unused_memo: Any = None) -> RepeatedScalarFieldContainer[_ScalarV]: ... + def __array__(self, dtype: Any = None, copy: bool | None = None) -> Any: ... # Any: numpy types class RepeatedCompositeFieldContainer(BaseContainer[_MessageV], MutableSequence[_MessageV]): __slots__ = ["_message_descriptor"] def __init__(self, message_listener: MessageListener, message_descriptor: Descriptor) -> None: ... - def add(self, **kwargs: Any) -> _MessageV: ... + def add(self, **kwargs: Any) -> _MessageV: ... # Any: field names and values def append(self, value: _MessageV) -> None: ... def insert(self, key: int, value: _MessageV) -> None: ... def extend(self, elem_seq: Iterable[_MessageV]) -> None: ... - def MergeFrom(self, other: Self | Iterable[_MessageV]) -> None: ... + def MergeFrom(self, other: RepeatedCompositeFieldContainer[_MessageV] | Iterable[_MessageV]) -> None: ... def remove(self, elem: _MessageV) -> None: ... def pop(self, key: int = -1) -> _MessageV: ... @overload @@ -73,21 +76,22 @@ class ScalarMap(MutableMapping[_K, _ScalarV]): value_checker: _ValueChecker[_ScalarV], entry_descriptor: Descriptor, ) -> None: ... - def __setitem__(self, k: _K, v: _ScalarV) -> None: ... - def __delitem__(self, v: _K) -> None: ... - def __getitem__(self, k: _K) -> _ScalarV: ... - def __len__(self) -> int: ... - def __iter__(self) -> Iterator[_K]: ... - def __eq__(self, other: object) -> bool: ... + def __getitem__(self, key: _K) -> _ScalarV: ... @overload def get(self, key: _K, default: None = None) -> _ScalarV | None: ... @overload def get(self, key: _K, default: _ScalarV) -> _ScalarV: ... @overload def get(self, key: _K, default: _T) -> _ScalarV | _T: ... + def __setitem__(self, key: _K, value: _ScalarV) -> None: ... + def __delitem__(self, key: _K) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_K]: ... + def __eq__(self, other: object) -> bool: ... def setdefault(self, key: _K, value: _ScalarV | None = None) -> _ScalarV: ... - def MergeFrom(self, other: Self): ... + def MergeFrom(self, other: ScalarMap[_K, _ScalarV]) -> None: ... def InvalidateIterators(self) -> None: ... + def clear(self) -> None: ... def GetEntryClass(self) -> GeneratedProtocolMessageType: ... class MessageMap(MutableMapping[_K, _MessageV]): @@ -99,20 +103,37 @@ class MessageMap(MutableMapping[_K, _MessageV]): key_checker: _ValueChecker[_K], entry_descriptor: Descriptor, ) -> None: ... - def __setitem__(self, k: _K, v: _MessageV) -> None: ... - def __delitem__(self, v: _K) -> None: ... - def __getitem__(self, k: _K) -> _MessageV: ... - def __len__(self) -> int: ... - def __iter__(self) -> Iterator[_K]: ... - def __eq__(self, other: object) -> bool: ... + def __getitem__(self, key: _K) -> _MessageV: ... + def get_or_create(self, key: _K) -> _MessageV: ... @overload def get(self, key: _K, default: None = None) -> _MessageV | None: ... @overload def get(self, key: _K, default: _MessageV) -> _MessageV: ... @overload def get(self, key: _K, default: _T) -> _MessageV | _T: ... - def get_or_create(self, key: _K) -> _MessageV: ... + def __setitem__(self, key: _K, value: _MessageV) -> None: ... + def __delitem__(self, key: _K) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_K]: ... + def __eq__(self, other: object) -> bool: ... def setdefault(self, key: _K, value: _MessageV | None = None) -> _MessageV: ... - def MergeFrom(self, other: Self): ... + def MergeFrom(self, other: MessageMap[_K, _MessageV]) -> None: ... def InvalidateIterators(self) -> None: ... + def clear(self) -> None: ... def GetEntryClass(self) -> GeneratedProtocolMessageType: ... + +class UnknownFieldRef: + def __init__(self, parent: UnknownFieldSet, index: int) -> None: ... + @property + def field_number(self) -> int: ... + @property + def wire_type(self) -> int: ... + @property + def data(self) -> Any: ... # Any: int, bytes, or UnknownFieldSet + +class UnknownFieldSet: + __slots__ = ["_values"] + def __init__(self) -> None: ... + def __getitem__(self, index: int) -> UnknownFieldRef: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[UnknownFieldRef]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/decoder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/decoder.pyi index 94ed7f615360..3c052bad665a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/decoder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/decoder.pyi @@ -8,7 +8,17 @@ from google.protobuf.message import Message _Decoder: TypeAlias = Callable[[str, int, int, Message, dict[FieldDescriptor, Any]], int] _NewDefault: TypeAlias = Callable[[Message], Message] -def ReadTag(buffer, pos): ... +def IsDefaultScalarValue(value: Any) -> bool: ... +def ReadTag(buffer: bytes, pos: int) -> tuple[bytes, int]: ... +def DecodeTag(tag_bytes: bytes) -> tuple[int, int]: ... +def EnumDecoder( + field_number: int, + is_repeated: bool, + is_packed: bool, + key: FieldDescriptor, + new_default: _NewDefault, + clear_if_default: bool = False, +) -> _Decoder: ... Int32Decoder: _Decoder Int64Decoder: _Decoder @@ -24,14 +34,6 @@ FloatDecoder: _Decoder DoubleDecoder: _Decoder BoolDecoder: _Decoder -def EnumDecoder( - field_number: int, - is_repeated: bool, - is_packed: bool, - key: FieldDescriptor, - new_default: _NewDefault, - clear_if_default: bool = False, -) -> _Decoder: ... def StringDecoder( field_number: int, is_repeated: bool, @@ -58,4 +60,9 @@ def MessageDecoder( MESSAGE_SET_ITEM_TAG: bytes def MessageSetItemDecoder(descriptor: Descriptor) -> _Decoder: ... -def MapDecoder(field_descriptor, new_default, is_message_map) -> _Decoder: ... +def UnknownMessageSetItemDecoder() -> _Decoder: ... +def MapDecoder(field_descriptor: FieldDescriptor, new_default: _NewDefault, is_message_map: bool) -> _Decoder: ... + +DEFAULT_RECURSION_LIMIT: int + +def SetRecursionLimit(new_limit: int) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/enum_type_wrapper.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/enum_type_wrapper.pyi index ca207f214950..6573a8262a81 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/enum_type_wrapper.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/enum_type_wrapper.pyi @@ -19,4 +19,5 @@ class _EnumTypeWrapper(type, Generic[_V]): def values(self) -> list[_V]: ... def items(self) -> list[tuple[str, _V]]: ... -class EnumTypeWrapper(_EnumTypeWrapper[int]): ... +class EnumTypeWrapper(_EnumTypeWrapper[int]): + ValueType = int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/extension_dict.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/extension_dict.pyi index 3071e4aa2ade..f2a4c1290a8e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/extension_dict.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/extension_dict.pyi @@ -19,10 +19,10 @@ class _ExtensionDict(Generic[_ContainerMessageT]): def __getitem__( self, extension_handle: _ExtensionFieldDescriptor[_ContainerMessageT, _ExtenderMessageT] ) -> _ExtenderMessageT: ... + def __len__(self) -> int: ... def __setitem__( self, extension_handle: _ExtensionFieldDescriptor[_ContainerMessageT, _ExtenderMessageT], value: _ExtenderMessageT ) -> None: ... def __delitem__(self, extension_handle: _ExtensionFieldDescriptor[_ContainerMessageT, _ExtenderMessageT]) -> None: ... - def __contains__(self, extension_handle: _ExtensionFieldDescriptor[_ContainerMessageT, _ExtenderMessageT]) -> bool: ... def __iter__(self) -> Iterator[_ExtensionFieldDescriptor[_ContainerMessageT, Any]]: ... - def __len__(self) -> int: ... + def __contains__(self, extension_handle: _ExtensionFieldDescriptor[_ContainerMessageT, _ExtenderMessageT]) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/field_mask.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/field_mask.pyi new file mode 100644 index 000000000000..bd0c7f9aef77 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/field_mask.pyi @@ -0,0 +1,14 @@ +from google.protobuf.descriptor import Descriptor, FieldDescriptor as FieldDescriptor +from google.protobuf.message import Message + +class FieldMask: + def ToJsonString(self) -> str: ... + def FromJsonString(self, value: str) -> None: ... + def IsValidForDescriptor(self, message_descriptor: Descriptor) -> bool: ... + def AllFieldsFromDescriptor(self, message_descriptor: Descriptor) -> None: ... + def CanonicalFormFromMask(self, mask: FieldMask) -> None: ... + def Union(self, mask1: FieldMask, mask2: FieldMask) -> None: ... + def Intersect(self, mask1: FieldMask, mask2: FieldMask) -> None: ... + def MergeMessage( + self, source: Message, destination: Message, replace_message_field: bool = False, replace_repeated_field: bool = False + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/message_listener.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/message_listener.pyi index 01c3be010c38..c1c9d3632b4f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/message_listener.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/message_listener.pyi @@ -1,5 +1,5 @@ class MessageListener: def Modified(self) -> None: ... -class NullMessageListener(MessageListener): +class NullMessageListener: def Modified(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/python_edition_defaults.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/python_edition_defaults.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/python_message.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/python_message.pyi index 0395ff64707c..2b37dda98989 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/python_message.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/python_message.pyi @@ -1,3 +1,5 @@ +from typing import Any + class GeneratedProtocolMessageType(type): - def __new__(cls, name, bases, dictionary): ... - def __init__(cls, name, bases, dictionary): ... + def __new__(cls, name: str, bases: tuple[type, ...], dictionary: dict[str, Any]) -> GeneratedProtocolMessageType: ... + def __init__(cls, name: str, bases: tuple[type, ...], dictionary: dict[str, Any]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/testing_refleaks.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/testing_refleaks.pyi new file mode 100644 index 000000000000..f77663b566b6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/testing_refleaks.pyi @@ -0,0 +1,21 @@ +from _typeshed import OptExcInfo +from collections.abc import Callable +from typing import TypeVar +from unittest import TestCase as _TestCase, TestResult + +_T = TypeVar("_T") + +class LocalTestResult(TestResult): + parent_result: TestResult + def __init__(self, parent_result: TestResult) -> None: ... + def addError(self, test: _TestCase, error: OptExcInfo) -> None: ... + def addFailure(self, test: _TestCase, error: OptExcInfo) -> None: ... + def addSkip(self, test: _TestCase, reason: str) -> None: ... + def addDuration(self, test: _TestCase, duration: float) -> None: ... + +class ReferenceLeakCheckerMixin: + NB_RUNS: int + def run(self, result: TestResult | None = None) -> TestResult: ... + +def SkipReferenceLeakChecker(reason: str) -> Callable[[_T], _T]: ... +def TestCase(test_class: _T) -> _T: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/type_checkers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/type_checkers.pyi index e050e9558738..6486de0124b5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/type_checkers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/type_checkers.pyi @@ -1,7 +1,16 @@ -from typing import Generic, TypeVar +from collections.abc import Callable +from typing import Any, Generic, TypeVar + +from google.protobuf.descriptor import EnumDescriptor, FieldDescriptor _T = TypeVar("_T") +def TruncateToFourByteFloat(original: float) -> float: ... +def ToShortestFloat(original: float) -> float: ... +def GetTypeChecker( + field: FieldDescriptor, +) -> TypeChecker[Any] | IntValueChecker | EnumValueChecker | UnicodeValueChecker | DoubleValueChecker | BoolValueChecker: ... + class TypeChecker(Generic[_T]): def __init__(self, *acceptable_types: _T): ... def CheckValue(self, proposed_value: _T) -> _T: ... @@ -9,3 +18,38 @@ class TypeChecker(Generic[_T]): class TypeCheckerWithDefault(TypeChecker[_T]): def __init__(self, default_value: _T, *acceptable_types: _T): ... def DefaultValue(self) -> _T: ... + +class BoolValueChecker: + def CheckValue(self, proposed_value: bool) -> bool: ... + def DefaultValue(self) -> bool: ... + +class IntValueChecker: + def CheckValue(self, proposed_value: int) -> int: ... + def DefaultValue(self) -> int: ... + +class EnumValueChecker: + def __init__(self, enum_type: EnumDescriptor) -> None: ... + def CheckValue(self, proposed_value: int) -> int: ... + def DefaultValue(self) -> int: ... + +class UnicodeValueChecker: + def CheckValue(self, proposed_value: str) -> str: ... + def DefaultValue(self) -> str: ... + +class Int32ValueChecker(IntValueChecker): ... +class Uint32ValueChecker(IntValueChecker): ... +class Int64ValueChecker(IntValueChecker): ... +class Uint64ValueChecker(IntValueChecker): ... + +class DoubleValueChecker: + def CheckValue(self, proposed_value: float) -> float: ... + def DefaultValue(self) -> float: ... + +class FloatValueChecker(DoubleValueChecker): + def CheckValue(self, proposed_value: float) -> float: ... + +TYPE_TO_BYTE_SIZE_FN: dict[int, Callable[..., int]] +TYPE_TO_ENCODER: dict[int, Callable[..., Any]] +TYPE_TO_SIZER: dict[int, Callable[..., Any]] +TYPE_TO_DECODER: dict[int, Callable[..., Any]] +FIELD_TYPE_TO_WIRE_TYPE: dict[int, int] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/well_known_types.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/well_known_types.pyi index 6527d3f6978e..df48b7574ea1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/well_known_types.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/well_known_types.pyi @@ -1,19 +1,21 @@ -from _typeshed import Incomplete, SupportsItems +from _typeshed import SupportsItems from collections.abc import Iterable, Iterator, KeysView, Mapping, Sequence from datetime import datetime, timedelta, tzinfo from typing import Any as tAny from typing_extensions import TypeAlias from google.protobuf import struct_pb2 +from google.protobuf.descriptor import Descriptor +from google.protobuf.message import Message as _Message class Any: __slots__ = () type_url: str - value: Incomplete - def Pack(self, msg, type_url_prefix: str = "type.googleapis.com/", deterministic=None) -> None: ... - def Unpack(self, msg) -> bool: ... + value: bytes + def Pack(self, msg: _Message, type_url_prefix: str = "type.googleapis.com/", deterministic: bool | None = None) -> None: ... + def Unpack(self, msg: _Message) -> bool: ... def TypeName(self) -> str: ... - def Is(self, descriptor) -> bool: ... + def Is(self, descriptor: Descriptor) -> bool: ... class Timestamp: __slots__ = () @@ -32,13 +34,17 @@ class Timestamp: def FromSeconds(self, seconds: int) -> None: ... def ToDatetime(self, tzinfo: tzinfo | None = None) -> datetime: ... def FromDatetime(self, dt: datetime) -> None: ... + def __add__(self, value: Duration | timedelta) -> datetime: ... + def __radd__(self, value: tAny) -> datetime: ... + def __sub__(self, value: Timestamp | Duration | timedelta) -> datetime | timedelta: ... + def __rsub__(self, dt: datetime) -> timedelta: ... class Duration: __slots__ = () def ToJsonString(self) -> str: ... seconds: int nanos: int - def FromJsonString(self, value: tAny) -> None: ... + def FromJsonString(self, value: str) -> None: ... def ToNanoseconds(self) -> int: ... def ToMicroseconds(self) -> int: ... def ToMilliseconds(self) -> int: ... @@ -49,18 +55,22 @@ class Duration: def FromSeconds(self, seconds: int) -> None: ... def ToTimedelta(self) -> timedelta: ... def FromTimedelta(self, td: timedelta) -> None: ... + def __add__(self, value: Timestamp | timedelta) -> datetime | timedelta: ... + def __radd__(self, value: tAny) -> datetime | timedelta: ... + def __sub__(self, value: Duration | timedelta) -> timedelta: ... + def __rsub__(self, value: datetime | timedelta) -> datetime | timedelta: ... class FieldMask: __slots__ = () def ToJsonString(self) -> str: ... - def FromJsonString(self, value: tAny) -> None: ... - def IsValidForDescriptor(self, message_descriptor: tAny): ... - def AllFieldsFromDescriptor(self, message_descriptor: tAny) -> None: ... - def CanonicalFormFromMask(self, mask: tAny) -> None: ... - def Union(self, mask1: tAny, mask2: tAny) -> None: ... - def Intersect(self, mask1: tAny, mask2: tAny) -> None: ... + def FromJsonString(self, value: str) -> None: ... + def IsValidForDescriptor(self, message_descriptor: Descriptor) -> bool: ... + def AllFieldsFromDescriptor(self, message_descriptor: Descriptor) -> None: ... + def CanonicalFormFromMask(self, mask: FieldMask) -> None: ... + def Union(self, mask1: FieldMask, mask2: FieldMask) -> None: ... + def Intersect(self, mask1: FieldMask, mask2: FieldMask) -> None: ... def MergeMessage( - self, source: tAny, destination: tAny, replace_message_field: bool = False, replace_repeated_field: bool = False + self, source: _Message, destination: _Message, replace_message_field: bool = False, replace_repeated_field: bool = False ) -> None: ... _StructValue: TypeAlias = struct_pb2.Struct | struct_pb2.ListValue | str | float | bool | None diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/wire_format.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/wire_format.pyi index 3dcbd04324ed..0d4aa04031ec 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/wire_format.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/wire_format.pyi @@ -1,50 +1,50 @@ -from typing import Any +from google.protobuf.message import Message -TAG_TYPE_BITS: Any -TAG_TYPE_MASK: Any -WIRETYPE_VARINT: Any -WIRETYPE_FIXED64: Any -WIRETYPE_LENGTH_DELIMITED: Any -WIRETYPE_START_GROUP: Any -WIRETYPE_END_GROUP: Any -WIRETYPE_FIXED32: Any -INT32_MAX: Any -INT32_MIN: Any -UINT32_MAX: Any -INT64_MAX: Any -INT64_MIN: Any -UINT64_MAX: Any -FORMAT_UINT32_LITTLE_ENDIAN: Any -FORMAT_UINT64_LITTLE_ENDIAN: Any -FORMAT_FLOAT_LITTLE_ENDIAN: Any -FORMAT_DOUBLE_LITTLE_ENDIAN: Any +TAG_TYPE_BITS: int +TAG_TYPE_MASK: int +WIRETYPE_VARINT: int +WIRETYPE_FIXED64: int +WIRETYPE_LENGTH_DELIMITED: int +WIRETYPE_START_GROUP: int +WIRETYPE_END_GROUP: int +WIRETYPE_FIXED32: int +INT32_MAX: int +INT32_MIN: int +UINT32_MAX: int +INT64_MAX: int +INT64_MIN: int +UINT64_MAX: int +FORMAT_UINT32_LITTLE_ENDIAN: str +FORMAT_UINT64_LITTLE_ENDIAN: str +FORMAT_FLOAT_LITTLE_ENDIAN: str +FORMAT_DOUBLE_LITTLE_ENDIAN: str -def PackTag(field_number, wire_type): ... -def UnpackTag(tag): ... -def ZigZagEncode(value): ... -def ZigZagDecode(value): ... -def Int32ByteSize(field_number, int32): ... -def Int32ByteSizeNoTag(int32): ... -def Int64ByteSize(field_number, int64): ... -def UInt32ByteSize(field_number, uint32): ... -def UInt64ByteSize(field_number, uint64): ... -def SInt32ByteSize(field_number, int32): ... -def SInt64ByteSize(field_number, int64): ... -def Fixed32ByteSize(field_number, fixed32): ... -def Fixed64ByteSize(field_number, fixed64): ... -def SFixed32ByteSize(field_number, sfixed32): ... -def SFixed64ByteSize(field_number, sfixed64): ... -def FloatByteSize(field_number, flt): ... -def DoubleByteSize(field_number, double): ... -def BoolByteSize(field_number, b): ... -def EnumByteSize(field_number, enum): ... -def StringByteSize(field_number, string): ... -def BytesByteSize(field_number, b): ... -def GroupByteSize(field_number, message): ... -def MessageByteSize(field_number, message): ... -def MessageSetItemByteSize(field_number, msg): ... -def TagByteSize(field_number): ... +def PackTag(field_number: int, wire_type: int) -> int: ... +def UnpackTag(tag: int) -> tuple[int, int]: ... +def ZigZagEncode(value: int) -> int: ... +def ZigZagDecode(value: int) -> int: ... +def Int32ByteSize(field_number: int, int32: int) -> int: ... +def Int32ByteSizeNoTag(int32: int) -> int: ... +def Int64ByteSize(field_number: int, int64: int) -> int: ... +def UInt32ByteSize(field_number: int, uint32: int) -> int: ... +def UInt64ByteSize(field_number: int, uint64: int) -> int: ... +def SInt32ByteSize(field_number: int, int32: int) -> int: ... +def SInt64ByteSize(field_number: int, int64: int) -> int: ... +def Fixed32ByteSize(field_number: int, fixed32: int) -> int: ... +def Fixed64ByteSize(field_number: int, fixed64: int) -> int: ... +def SFixed32ByteSize(field_number: int, sfixed32: int) -> int: ... +def SFixed64ByteSize(field_number: int, sfixed64: int) -> int: ... +def FloatByteSize(field_number: int, flt: float) -> int: ... +def DoubleByteSize(field_number: int, double: float) -> int: ... +def BoolByteSize(field_number: int, b: bool) -> int: ... +def EnumByteSize(field_number: int, enum: int) -> int: ... +def StringByteSize(field_number: int, string: str) -> int: ... +def BytesByteSize(field_number: int, b: bytes) -> int: ... +def GroupByteSize(field_number: int, message: Message) -> int: ... +def MessageByteSize(field_number: int, message: Message) -> int: ... +def MessageSetItemByteSize(field_number: int, msg: Message) -> int: ... +def TagByteSize(field_number: int) -> int: ... -NON_PACKABLE_TYPES: Any +NON_PACKABLE_TYPES: tuple[int, ...] -def IsTypePackable(field_type): ... +def IsTypePackable(field_type: int) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/json_format.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/json_format.pyi index 89eba0c4eabe..44a21b5a34f9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/json_format.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/json_format.pyi @@ -6,8 +6,9 @@ from google.protobuf.message import Message _MessageT = TypeVar("_MessageT", bound=Message) class Error(Exception): ... -class ParseError(Error): ... class SerializeToJsonError(Error): ... +class ParseError(Error): ... +class EnumStringValueParseError(ParseError): ... def MessageToJson( message: Message, @@ -16,7 +17,6 @@ def MessageToJson( sort_keys: bool = False, use_integers_for_enums: bool = False, descriptor_pool: DescriptorPool | None = None, - float_precision: int | None = None, ensure_ascii: bool = True, always_print_fields_with_no_presence: bool = False, ) -> str: ... @@ -26,7 +26,6 @@ def MessageToDict( preserving_proto_field_name: bool = False, use_integers_for_enums: bool = False, descriptor_pool: DescriptorPool | None = None, - float_precision: int | None = None, ) -> dict[str, Any]: ... def Parse( text: bytes | str, @@ -36,7 +35,7 @@ def Parse( max_recursion_depth: int = 100, ) -> _MessageT: ... def ParseDict( - js_dict: Any, + js_dict: dict[str, Any], message: _MessageT, ignore_unknown_fields: bool = False, descriptor_pool: DescriptorPool | None = None, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/message.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/message.pyi index bd2aff9b7676..bca40ddb4667 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/message.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/message.pyi @@ -15,8 +15,9 @@ class Message: __slots__: tuple[str, ...] = () DESCRIPTOR: Descriptor | _upb_Descriptor def __deepcopy__(self, memo: Any = None) -> Self: ... - def __eq__(self, other_msg): ... - def __ne__(self, other_msg): ... + def __eq__(self, other_msg: object) -> bool: ... + def __ne__(self, other_msg: object) -> bool: ... + def __contains__(self, field_name_or_key: str) -> bool: ... def MergeFrom(self, other_msg: Self) -> None: ... def CopyFrom(self, other_msg: Self) -> None: ... def Clear(self) -> None: ... @@ -26,21 +27,23 @@ class Message: def ParseFromString(self, serialized: bytes) -> int: ... def SerializeToString(self, *, deterministic: bool = ...) -> bytes: ... def SerializePartialToString(self, *, deterministic: bool = ...) -> bytes: ... - def ListFields(self) -> Sequence[tuple[FieldDescriptor, Any]]: ... + def ListFields(self) -> Sequence[tuple[FieldDescriptor, Any]]: ... # Any: str, int, float, bytes, bool, or Message + # Intentionally left out typing on these three methods, because they are + # stringly typed and it is not useful to call them on a Message directly. + # We prefer more specific typing on individual subclasses of Message + # See https://github.com/dropbox/mypy-protobuf/issues/62 for details + def HasField(self, field_name: Any) -> bool: ... + def ClearField(self, field_name: Any) -> None: ... + def WhichOneof(self, oneof_group: Any) -> Any: ... def HasExtension(self, field_descriptor: _ExtensionFieldDescriptor[Self, Any]) -> bool: ... def ClearExtension(self, field_descriptor: _ExtensionFieldDescriptor[Self, Any]) -> None: ... # The TypeVar must be bound to `Message` or we get mypy errors, so we cannot use `Self` for `Extensions` @property def Extensions(self) -> _ExtensionDict[Self]: ... + def UnknownFields(self) -> Any: ... # Any: subclasses return UnknownFieldSet + def DiscardUnknownFields(self) -> None: ... def ByteSize(self) -> int: ... @classmethod def FromString(cls, s: bytes) -> Self: ... - # Intentionally left out typing on these three methods, because they are - # stringly typed and it is not useful to call them on a Message directly. - # We prefer more specific typing on individual subclasses of Message - # See https://github.com/dropbox/mypy-protobuf/issues/62 for details - def HasField(self, field_name: Any) -> bool: ... - def ClearField(self, field_name: Any) -> None: ... - def WhichOneof(self, oneof_group: Any) -> Any: ... # TODO: check kwargs def __new__(cls, *args, **kwargs) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/message_factory.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/message_factory.pyi index 6422284aaad3..8a902254d2d9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/message_factory.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/message_factory.pyi @@ -1,15 +1,15 @@ from collections.abc import Iterable -from typing import Any from google.protobuf.descriptor import Descriptor from google.protobuf.descriptor_pb2 import FileDescriptorProto from google.protobuf.descriptor_pool import DescriptorPool from google.protobuf.message import Message +def GetMessageClass(descriptor: Descriptor) -> type[Message]: ... +def GetMessageClassesForFiles(files: Iterable[str], pool: DescriptorPool) -> dict[str, type[Message]]: ... + class MessageFactory: - pool: Any + pool: DescriptorPool def __init__(self, pool: DescriptorPool | None = None) -> None: ... -def GetMessageClass(descriptor: Descriptor) -> type[Message]: ... -def GetMessageClassesForFiles(files: Iterable[str], pool: DescriptorPool) -> dict[str, type[Message]]: ... def GetMessages(file_protos: Iterable[FileDescriptorProto], pool: DescriptorPool | None = None) -> dict[str, type[Message]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/proto.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/proto.pyi new file mode 100644 index 000000000000..1f1cb47037cc --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/proto.pyi @@ -0,0 +1,14 @@ +from io import BytesIO +from typing import TypeVar + +from google.protobuf.message import Message + +_MessageT = TypeVar("_MessageT", bound=Message) + +def serialize(message: Message, deterministic: bool | None = None) -> bytes: ... +def parse(message_class: type[_MessageT], payload: bytes) -> _MessageT: ... +def serialize_length_prefixed(message: Message, output: BytesIO) -> None: ... +def parse_length_prefixed(message_class: type[_MessageT], input_bytes: BytesIO) -> _MessageT: ... +def byte_size(message: Message) -> int: ... +def clear_message(message: Message) -> None: ... +def clear_field(message: Message, field_name: str) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/proto_builder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/proto_builder.pyi new file mode 100644 index 000000000000..b204ba32eb69 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/proto_builder.pyi @@ -0,0 +1,8 @@ +from collections import OrderedDict + +from google.protobuf.descriptor_pool import DescriptorPool +from google.protobuf.message import Message + +def MakeSimpleProtoClass( + fields: dict[str, int] | OrderedDict[str, int], full_name: str | None = None, pool: DescriptorPool | None = None +) -> type[Message]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/proto_json.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/proto_json.pyi new file mode 100644 index 000000000000..9a63de676bb1 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/proto_json.pyi @@ -0,0 +1,21 @@ +from typing import Any, TypeVar + +from google.protobuf.descriptor_pool import DescriptorPool +from google.protobuf.message import Message + +_MessageT = TypeVar("_MessageT", bound=Message) + +def serialize( + message: Message, + always_print_fields_with_no_presence: bool = False, + preserving_proto_field_name: bool = False, + use_integers_for_enums: bool = False, + descriptor_pool: DescriptorPool | None = None, +) -> dict[str, Any]: ... +def parse( + message_class: type[_MessageT], + js_dict: dict[str, Any], + ignore_unknown_fields: bool = False, + descriptor_pool: DescriptorPool | None = None, + max_recursion_depth: int = 100, +) -> _MessageT: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/proto_text.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/proto_text.pyi new file mode 100644 index 000000000000..ca45131c7141 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/proto_text.pyi @@ -0,0 +1,32 @@ +from collections.abc import Callable +from typing import TypeVar +from typing_extensions import TypeAlias + +from google.protobuf.descriptor_pool import DescriptorPool +from google.protobuf.message import Message + +_MessageT = TypeVar("_MessageT", bound=Message) +_MsgFormatter: TypeAlias = Callable[[Message, int, bool], str | None] + +def serialize( + message: Message, + as_utf8: bool = True, + as_one_line: bool = False, + use_short_repeated_primitives: bool = False, + pointy_brackets: bool = False, + use_index_order: bool = False, + use_field_number: bool = False, + descriptor_pool: DescriptorPool | None = None, + indent: int = 0, + message_formatter: _MsgFormatter | None = None, + print_unknown_fields: bool = False, + force_colon: bool = False, +) -> str: ... +def parse( + message_class: type[_MessageT], + text: str | bytes, + allow_unknown_extension: bool = False, + allow_field_number: bool = False, + descriptor_pool: DescriptorPool | None = None, + allow_unknown_field: bool = False, +) -> _MessageT: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/reflection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/reflection.pyi index 2836b3fcf11f..0c700523e712 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/reflection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/reflection.pyi @@ -1,2 +1,10 @@ -class GeneratedProtocolMessageType(type): - def __new__(cls, name, bases, dictionary): ... +from typing import Any + +from google._upb._message import MessageMeta + +MESSAGE_CLASS_CACHE: dict[str, Any] + +class GeneratedProtocolMessageType(MessageMeta): + def __new__( # noqa: Y034 + cls, name: str, bases: tuple[type, ...], dictionary: dict[str, Any] + ) -> GeneratedProtocolMessageType: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/service_reflection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/service_reflection.pyi new file mode 100644 index 000000000000..c9949d13baca --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/service_reflection.pyi @@ -0,0 +1,7 @@ +from typing import Any + +class GeneratedServiceType(type): + def __init__(cls, name: str, bases: tuple[type, ...], dictionary: dict[str, Any]) -> None: ... + +class GeneratedServiceStubType(GeneratedServiceType): + def __init__(cls, name: str, bases: tuple[type, ...], dictionary: dict[str, Any]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/symbol_database.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/symbol_database.pyi index c595d9c525b9..6fda0df00fd4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/symbol_database.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/symbol_database.pyi @@ -1,10 +1,11 @@ from collections.abc import Iterable from google.protobuf.descriptor import Descriptor, EnumDescriptor, FileDescriptor, ServiceDescriptor +from google.protobuf.descriptor_pool import DescriptorPool from google.protobuf.message import Message -from google.protobuf.message_factory import MessageFactory -class SymbolDatabase(MessageFactory): +class SymbolDatabase: + def __init__(self, pool: DescriptorPool | None = None) -> None: ... def RegisterMessage(self, message: type[Message] | Message) -> type[Message] | Message: ... def RegisterMessageDescriptor(self, message_descriptor: Descriptor) -> None: ... def RegisterEnumDescriptor(self, enum_descriptor: EnumDescriptor) -> EnumDescriptor: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/text_encoding.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/text_encoding.pyi new file mode 100644 index 000000000000..69a69bf0e9e6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/text_encoding.pyi @@ -0,0 +1,2 @@ +def CEscape(text: bytes, as_utf8: bool) -> str: ... +def CUnescape(text: str) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/text_format.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/text_format.pyi index c9a9da29a125..ef1fcf8cef19 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/text_format.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/text_format.pyi @@ -9,6 +9,8 @@ from .message import Message _M = TypeVar("_M", bound=Message) # message type (of self) +__all__ = ["MessageToString", "Parse", "PrintMessage", "PrintField", "PrintFieldValue", "Merge", "MessageToBytes"] + class Error(Exception): ... class ParseError(Error): @@ -19,8 +21,8 @@ class ParseError(Error): class TextWriter: def __init__(self, as_utf8: bool) -> None: ... def write(self, val: str) -> int: ... - def getvalue(self) -> str: ... def close(self) -> None: ... + def getvalue(self) -> str: ... _MessageFormatter: TypeAlias = Callable[[Message, int, bool], str | None] @@ -31,8 +33,6 @@ def MessageToString( use_short_repeated_primitives: bool = False, pointy_brackets: bool = False, use_index_order: bool = False, - float_format: str | None = None, - double_format: str | None = None, use_field_number: bool = False, descriptor_pool: DescriptorPool | None = None, indent: int = 0, @@ -49,8 +49,6 @@ def MessageToBytes( use_short_repeated_primitives: bool = False, pointy_brackets: bool = False, use_index_order: bool = False, - float_format: str | None = None, - double_format: str | None = None, use_field_number: bool = False, descriptor_pool: DescriptorPool | None = None, indent: int = 0, @@ -67,8 +65,6 @@ def PrintMessage( use_short_repeated_primitives: bool = False, pointy_brackets: bool = False, use_index_order: bool = False, - float_format: str | None = None, - double_format: str | None = None, use_field_number: bool = False, descriptor_pool: DescriptorPool | None = None, message_formatter: _MessageFormatter | None = None, @@ -85,8 +81,6 @@ def PrintField( use_short_repeated_primitives: bool = False, pointy_brackets: bool = False, use_index_order: bool = False, - float_format: str | None = None, - double_format: str | None = None, message_formatter: _MessageFormatter | None = None, print_unknown_fields: bool = False, force_colon: bool = False, @@ -101,8 +95,6 @@ def PrintFieldValue( use_short_repeated_primitives: bool = False, pointy_brackets: bool = False, use_index_order: bool = False, - float_format: str | None = None, - double_format: str | None = None, message_formatter: _MessageFormatter | None = None, print_unknown_fields: bool = False, force_colon: bool = False, @@ -116,8 +108,6 @@ class _Printer: use_short_repeated_primitives: bool pointy_brackets: bool use_index_order: bool - float_format: str | None - double_format: str | None use_field_number: bool descriptor_pool: DescriptorPool | None message_formatter: _MessageFormatter | None @@ -132,8 +122,6 @@ class _Printer: use_short_repeated_primitives: bool = False, pointy_brackets: bool = False, use_index_order: bool = False, - float_format: str | None = None, - double_format: str | None = None, use_field_number: bool = False, descriptor_pool: DescriptorPool | None = None, message_formatter: _MessageFormatter | None = None, @@ -208,6 +196,8 @@ class Tokenizer: def ConsumeString(self) -> str: ... def ConsumeByteString(self) -> bytes: ... def ConsumeEnum(self, field: FieldDescriptor) -> int: ... + def ConsumeUrlChars(self) -> str: ... + def TryConsumeUrlChars(self) -> bool: ... def ParseErrorPreviousToken(self, message: Message) -> _ParseError: ... def ParseError(self, message: Message) -> _ParseError: ... def NextToken(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/timestamp.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/timestamp.pyi new file mode 100644 index 000000000000..b6687a744e45 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/timestamp.pyi @@ -0,0 +1,16 @@ +from datetime import datetime, tzinfo + +from google.protobuf.timestamp_pb2 import Timestamp + +def from_json_string(value: str) -> Timestamp: ... +def from_microseconds(micros: float) -> Timestamp: ... +def from_milliseconds(millis: float) -> Timestamp: ... +def from_nanoseconds(nanos: float) -> Timestamp: ... +def from_seconds(seconds: float) -> Timestamp: ... +def from_current_time() -> Timestamp: ... +def to_json_string(ts: Timestamp) -> str: ... +def to_microseconds(ts: Timestamp) -> int: ... +def to_milliseconds(ts: Timestamp) -> int: ... +def to_nanoseconds(ts: Timestamp) -> int: ... +def to_seconds(ts: Timestamp) -> int: ... +def to_datetime(ts: Timestamp, tz: tzinfo | None = None) -> datetime: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/unknown_fields.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/unknown_fields.pyi new file mode 100644 index 000000000000..7329b00a4128 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/unknown_fields.pyi @@ -0,0 +1,9 @@ +from typing import Any, final + +from google.protobuf.message import Message + +@final +class UnknownFieldSet: + def __new__(cls, msg: Message) -> UnknownFieldSet: ... # noqa: Y034 + def __getitem__(self, index: int, /) -> Any: ... # Any: internal unknown field object + def __len__(self) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/psutil/METADATA.toml index e09e37981e46..4700066c4768 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/METADATA.toml @@ -1,5 +1,5 @@ version = "7.2.2" -upstream_repository = "https://github.com/giampaolo/psutil" +upstream-repository = "https://github.com/giampaolo/psutil" [tool.stubtest] -ci_platforms = ["darwin", "linux", "win32"] +ci-platforms = ["darwin", "linux", "win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi index 77e4728ddbd5..d3fb630a0f97 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi @@ -46,12 +46,12 @@ if sys.platform == "win32": # These noqas workaround https://github.com/astral-sh/ruff/issues/10874 class Priority(enum.IntEnum): - ABOVE_NORMAL_PRIORITY_CLASS = _psutil_windows.ABOVE_NORMAL_PRIORITY_CLASS # noqa: F811 - BELOW_NORMAL_PRIORITY_CLASS = _psutil_windows.BELOW_NORMAL_PRIORITY_CLASS # noqa: F811 - HIGH_PRIORITY_CLASS = _psutil_windows.HIGH_PRIORITY_CLASS # noqa: F811 - IDLE_PRIORITY_CLASS = _psutil_windows.IDLE_PRIORITY_CLASS # noqa: F811 - NORMAL_PRIORITY_CLASS = _psutil_windows.NORMAL_PRIORITY_CLASS # noqa: F811 - REALTIME_PRIORITY_CLASS = _psutil_windows.REALTIME_PRIORITY_CLASS # noqa: F811 + ABOVE_NORMAL_PRIORITY_CLASS = _psutil_windows.ABOVE_NORMAL_PRIORITY_CLASS + BELOW_NORMAL_PRIORITY_CLASS = _psutil_windows.BELOW_NORMAL_PRIORITY_CLASS + HIGH_PRIORITY_CLASS = _psutil_windows.HIGH_PRIORITY_CLASS + IDLE_PRIORITY_CLASS = _psutil_windows.IDLE_PRIORITY_CLASS + NORMAL_PRIORITY_CLASS = _psutil_windows.NORMAL_PRIORITY_CLASS + REALTIME_PRIORITY_CLASS = _psutil_windows.REALTIME_PRIORITY_CLASS class IOPriority(enum.IntEnum): IOPRIO_VERYLOW = 0 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/METADATA.toml index 0a5a3e73adda..5d8e21b66912 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/psycopg2/METADATA.toml @@ -1,3 +1,3 @@ version = "2.9.11" -upstream_repository = "https://github.com/psycopg/psycopg2" -partial_stub = false +upstream-repository = "https://github.com/psycopg/psycopg2" +partial-stub = false diff --git a/packages/pyright-internal/typeshed-fallback/stubs/punq/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/punq/METADATA.toml index 99e472d4bbd4..f29f602eea39 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/punq/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/punq/METADATA.toml @@ -1,4 +1,4 @@ version = "0.7.*" -upstream_repository = "https://github.com/bobthemighty/punq" +upstream-repository = "https://github.com/bobthemighty/punq" [tool.stubtest] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/METADATA.toml index 2fa96d4bc8c5..c9d5651dfeeb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/METADATA.toml @@ -1,2 +1,2 @@ version = "0.6.*" -upstream_repository = "https://github.com/pyasn1/pyasn1" +upstream-repository = "https://github.com/pyasn1/pyasn1" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/streaming.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/streaming.pyi index 1752e5cc8a4e..b9ff83bec767 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/streaming.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/streaming.pyi @@ -16,6 +16,6 @@ class CachingStreamWrapper(io.IOBase): def tell(self): ... def asSeekableStream(substrate): ... -def isEndOfStream(substrate) -> Generator[Incomplete, None, None]: ... -def peekIntoStream(substrate, size: int = -1) -> Generator[Incomplete, None, None]: ... -def readFromStream(substrate, size: int = -1, context=None) -> Generator[Incomplete, None, None]: ... +def isEndOfStream(substrate) -> Generator[Incomplete]: ... +def peekIntoStream(substrate, size: int = -1) -> Generator[Incomplete]: ... +def readFromStream(substrate, size: int = -1, context=None) -> Generator[Incomplete]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/base.pyi index 6889e8007d59..ab443c197304 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/base.pyi @@ -126,7 +126,7 @@ AbstractSimpleAsn1Item = SimpleAsn1Type class ConstructedAsn1Type(Asn1Type): strictConstraints: bool - componentType: namedtype.NamedTypes | None + componentType: namedtype.NamedTypes | Asn1Type | None sizeSpec: constraint.ConstraintsIntersection def __init__(self, **kwargs) -> None: ... def __eq__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/namedval.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/namedval.pyi index 20c1904706b5..1f638b960f6d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/namedval.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/namedval.pyi @@ -18,7 +18,7 @@ class NamedValues: def __iter__(self): ... def values(self): ... def keys(self): ... - def items(self) -> Generator[Incomplete, None, None]: ... + def items(self) -> Generator[Incomplete]: ... def __add__(self, namedValues): ... def clone(self, *args, **kwargs): ... def getName(self, value): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/univ.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/univ.pyi index 6d285b658890..ad2a65391381 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/univ.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/type/univ.pyi @@ -241,13 +241,13 @@ class Enumerated(Integer): namedValues: namedval.NamedValues class SequenceOfAndSetOfBase(base.ConstructedAsn1Type): - componentType: namedtype.NamedTypes | None + componentType: base.Asn1Type | None tagSet: TagSet subtypeSpec: constraint.ConstraintsIntersection def __init__( self, *args, - componentType: namedtype.NamedTypes | None = ..., + componentType: base.Asn1Type | None = ..., tagSet: TagSet = ..., subtypeSpec: constraint.ConstraintsIntersection = ..., ) -> None: ... @@ -303,9 +303,9 @@ class SequenceAndSetBase(base.ConstructedAsn1Type): def __contains__(self, key) -> bool: ... def __len__(self) -> int: ... def __iter__(self): ... - def values(self) -> Generator[Incomplete, None, None]: ... + def values(self) -> Generator[Incomplete]: ... def keys(self): ... - def items(self) -> Generator[Incomplete, None, None]: ... + def items(self) -> Generator[Incomplete]: ... def update(self, *iterValue, **mappingValue) -> None: ... def clear(self): ... def reset(self): ... @@ -371,9 +371,9 @@ class Choice(Set): def __len__(self) -> int: ... def __contains__(self, key) -> bool: ... def __iter__(self): ... - def values(self) -> Generator[Incomplete, None, None]: ... - def keys(self) -> Generator[Incomplete, None, None]: ... - def items(self) -> Generator[Incomplete, None, None]: ... + def values(self) -> Generator[Incomplete]: ... + def keys(self) -> Generator[Incomplete]: ... + def items(self) -> Generator[Incomplete]: ... def checkConsistency(self) -> None: ... def getComponentByPosition(self, idx, default=..., instantiate: bool = True): ... def setComponentByPosition( diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyaudio/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyaudio/METADATA.toml index d05035bf5989..29a84c09f459 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyaudio/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyaudio/METADATA.toml @@ -1,9 +1,9 @@ version = "0.2.*" # There is no web portal for the source, this is the official source link: -# upstream_repository = "https://people.csail.mit.edu/hubert/pyaudio/#sources" +# upstream-repository = "https://people.csail.mit.edu/hubert/pyaudio/#sources" [tool.stubtest] # linux and win32 are equivalent -ci_platforms = ["darwin", "linux"] -apt_dependencies = ["portaudio19-dev"] -brew_dependencies = ["portaudio"] +ci-platforms = ["darwin", "linux"] +apt-dependencies = ["portaudio19-dev"] +brew-dependencies = ["portaudio"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/METADATA.toml index cd764fe93749..672320ca392c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pycocotools/METADATA.toml @@ -1,3 +1,3 @@ version = "2.0.*" -upstream_repository = "https://github.com/ppwwyyxx/cocoapi" -requires = ["numpy>=2.0.0rc1"] +upstream-repository = "https://github.com/ppwwyyxx/cocoapi" +dependencies = ["numpy>=2.0.0rc1"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pycurl/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pycurl/METADATA.toml index 8d6e2d58ebb3..24000bcfb731 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pycurl/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pycurl/METADATA.toml @@ -1,5 +1,5 @@ version = "7.45.7" -upstream_repository = "https://github.com/pycurl/pycurl" +upstream-repository = "https://github.com/pycurl/pycurl" [tool.stubtest] -ci_platforms = ["darwin", "linux", "win32"] +ci-platforms = ["darwin", "linux", "win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pycurl/pycurl.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pycurl/pycurl.pyi index f5920dd8564a..7e3b1a42d6a1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pycurl/pycurl.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pycurl/pycurl.pyi @@ -85,9 +85,9 @@ CAINFO: Final = 10065 CAINFO_BLOB: Final = 40309 CAPATH: Final = 10097 CLOSESOCKETFUNCTION: Final = 20208 -COMPILE_LIBCURL_VERSION_NUM: Final = 525824 -COMPILE_PY_VERSION_HEX: Final = 50925040 -COMPILE_SSL_LIB: Final = "schannel" +COMPILE_LIBCURL_VERSION_NUM: Final[int] +COMPILE_PY_VERSION_HEX: Final[int] +COMPILE_SSL_LIB: Final[str] CONDITION_UNMET: Final = 2097187 CONNECTTIMEOUT: Final = 78 CONNECTTIMEOUT_MS: Final = 156 @@ -333,7 +333,7 @@ HTTPAUTH_NEGOTIATE: Final = 4 HTTPAUTH_NONE: Final = 0 HTTPAUTH_NTLM: Final = 8 HTTPAUTH_NTLM_WB: Final = 32 -HTTPAUTH_ONLY: Final = -2147483648 +HTTPAUTH_ONLY: Final[int] HTTPGET: Final = 80 HTTPHEADER: Final = 10023 HTTPPOST: Final = 10024 @@ -646,7 +646,7 @@ SSLVERSION_MAX_TLSv1_2: Final = 393216 SSLVERSION_MAX_TLSv1_3: Final = 458752 SSLVERSION_SSLv2: Final = 2 SSLVERSION_SSLv3: Final = 3 -SSLVERSION_TLSv1: Final = 0 +SSLVERSION_TLSv1: Final = 1 SSLVERSION_TLSv1_0: Final = 4 SSLVERSION_TLSv1_1: Final = 5 SSLVERSION_TLSv1_2: Final = 6 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyfarmhash/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyfarmhash/METADATA.toml index 8762bdc0e304..3160c1245acf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyfarmhash/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyfarmhash/METADATA.toml @@ -1,2 +1,2 @@ version = "0.4.*" -upstream_repository = "https://github.com/veelion/python-farmhash" +upstream-repository = "https://github.com/veelion/python-farmhash" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyflakes/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyflakes/METADATA.toml index 6c88c0c0ec41..4619a579594b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyflakes/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyflakes/METADATA.toml @@ -1,2 +1,2 @@ version = "3.4.*" -upstream_repository = "https://github.com/PyCQA/pyflakes" +upstream-repository = "https://github.com/PyCQA/pyflakes" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/METADATA.toml index 2da8e52679a8..f1aaecd52ed7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/METADATA.toml @@ -1,2 +1,2 @@ version = "6.19.*" -upstream_repository = "https://github.com/pyinstaller/pyinstaller" +upstream-repository = "https://github.com/pyinstaller/pyinstaller" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/depend/imphookapi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/depend/imphookapi.pyi index f8b50d40326a..286aac070973 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/depend/imphookapi.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/depend/imphookapi.pyi @@ -60,7 +60,7 @@ class PostGraphAPI: @property def node(self) -> Package: ... @property - def imports(self) -> Generator[Package, None, None]: ... + def imports(self) -> Generator[Package]: ... def add_imports(self, *module_names: str) -> None: ... def del_imports(self, *module_names: str) -> None: ... def add_binaries(self, binaries: TOC | Iterable[tuple[StrOrBytesPath, StrOrBytesPath]]) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi index 83df57a0ca30..2783e2249008 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi @@ -3,8 +3,9 @@ # Anything not referenced in the PyInstaller stubs doesn't need to be added here. from types import CodeType -from typing import Protocol +from typing import Protocol, type_check_only +@type_check_only class _SupportsGraphident(Protocol): graphident: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyjks/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyjks/METADATA.toml index ccc64c3d6904..20eeae1e0c06 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyjks/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyjks/METADATA.toml @@ -1,3 +1,3 @@ version = "20.0.*" -upstream_repository = "https://github.com/kurtbrose/pyjks" -requires = ["types-pyasn1"] +upstream-repository = "https://github.com/kurtbrose/pyjks" +dependencies = ["types-pyasn1"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyluach/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyluach/METADATA.toml index 172f950ccedc..102e7dfd01db 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyluach/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyluach/METADATA.toml @@ -1,2 +1,2 @@ version = "2.3.*" -upstream_repository = "https://github.com/simlist/pyluach" +upstream-repository = "https://github.com/simlist/pyluach" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pynput/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pynput/METADATA.toml index ef8d6c438859..66307d3bc98e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pynput/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pynput/METADATA.toml @@ -1,5 +1,5 @@ version = "~=1.8.1" -upstream_repository = "https://github.com/moses-palmer/pynput" +upstream-repository = "https://github.com/moses-palmer/pynput" [tool.stubtest] -ci_platforms = ["darwin", "linux", "win32"] +ci-platforms = ["darwin", "linux", "win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyperclip/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyperclip/METADATA.toml index 9e2c211f627d..a2f5db7c354d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyperclip/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyperclip/METADATA.toml @@ -1,6 +1,6 @@ version = "1.11.*" -upstream_repository = "https://github.com/asweigart/pyperclip" +upstream-repository = "https://github.com/asweigart/pyperclip" [tool.stubtest] -ci_platforms = ["win32", "linux", "darwin"] -apt_dependencies = ["xclip"] +ci-platforms = ["win32", "linux", "darwin"] +apt-dependencies = ["xclip"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/METADATA.toml index effb2598ba68..3726b119da44 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/METADATA.toml @@ -1,6 +1,6 @@ version = "3.5.*" -upstream_repository = "https://github.com/pyserial/pyserial" +upstream-repository = "https://github.com/pyserial/pyserial" [tool.stubtest] -ci_platforms = ["darwin", "linux", "win32"] +ci-platforms = ["darwin", "linux", "win32"] extras = ["cp2110"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pysftp/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pysftp/METADATA.toml index 8296a25da395..7088c729d7c6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pysftp/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pysftp/METADATA.toml @@ -1,6 +1,6 @@ version = "0.2.*" -upstream_repository = "https://bitbucket.org/dundeemt/pysftp" -requires = ["types-paramiko"] +upstream-repository = "https://bitbucket.org/dundeemt/pysftp" +dependencies = ["types-paramiko"] [tool.stubtest] -stubtest_requirements = ["paramiko~=3.0"] +stubtest-dependencies = ["paramiko~=3.0"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pysftp/pysftp/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pysftp/pysftp/__init__.pyi index 188e13aff8ac..15f816429dab 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pysftp/pysftp/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pysftp/pysftp/__init__.pyi @@ -76,7 +76,7 @@ class Connection: confirm: bool = True, ) -> paramiko.SFTPAttributes: ... def execute(self, command: str) -> list[str]: ... - def cd(self, remotepath: _Path | None = None) -> AbstractContextManager[None]: ... # noqa: F811 + def cd(self, remotepath: _Path | None = None) -> AbstractContextManager[None]: ... def chdir(self, remotepath: _Path) -> None: ... def cwd(self, remotepath: _Path) -> None: ... def chmod(self, remotepath: _Path, mode: int = 777) -> None: ... @@ -102,7 +102,7 @@ class Connection: def lexists(self, remotepath: _Path) -> bool: ... def symlink(self, remote_src: _Path, remote_dest: _Path) -> None: ... def truncate(self, remotepath: _Path, size: int) -> int: ... - def walktree( # noqa: F811 + def walktree( self, remotepath: _Path, fcallback: _PathCallback, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pytest-lazy-fixture/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pytest-lazy-fixture/METADATA.toml index 68ac0cb52446..60f7b81673f3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pytest-lazy-fixture/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pytest-lazy-fixture/METADATA.toml @@ -1,2 +1,2 @@ version = "0.6.*" -upstream_repository = "https://github.com/tvorog/pytest-lazy-fixture" +upstream-repository = "https://github.com/tvorog/pytest-lazy-fixture" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/METADATA.toml index c379fed74189..6a47d346981a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/METADATA.toml @@ -1,3 +1,3 @@ version = "3.3.*" -upstream_repository = "https://gitlab.com/doctormo/python-crontab" -requires = ["types-croniter"] +upstream-repository = "https://gitlab.com/doctormo/python-crontab" +dependencies = ["types-croniter"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/cronlog.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/cronlog.pyi index 4cde497b944f..00774e321eb6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/cronlog.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-crontab/cronlog.pyi @@ -19,7 +19,7 @@ class LogReader: self, error_type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... def __iter__(self) -> Iterator[str]: ... - def readlines(self, until: int = ...) -> Generator[tuple[int, str], None, None]: ... + def readlines(self, until: int = ...) -> Generator[tuple[int, str]]: ... def cron_date_to_datetime(cron_str: str) -> datetime: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/METADATA.toml index 9aa35b672cc2..995b1aa6aa82 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/METADATA.toml @@ -1,2 +1,2 @@ version = "2.9.*" -upstream_repository = "https://github.com/dateutil/dateutil" +upstream-repository = "https://github.com/dateutil/dateutil" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/parser/_parser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/parser/_parser.pyi index 94fc991691a1..509fe6206375 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/parser/_parser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/parser/_parser.pyi @@ -153,7 +153,7 @@ class _tzparser: day: int | None time: int | None - def __init__(self): ... + def __init__(self) -> None: ... def parse(self, tzstr: str | re.Pattern[str]) -> _result | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/parser/isoparser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/parser/isoparser.pyi index 51a9c153af81..b0940e2905b3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/parser/isoparser.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/parser/isoparser.pyi @@ -8,7 +8,7 @@ _TakesAscii: TypeAlias = str | bytes | _Readable __all__ = ["isoparse", "isoparser"] class isoparser: - def __init__(self, sep: str | bytes | None = None): ... + def __init__(self, sep: str | bytes | None = None) -> None: ... def isoparse(self, dt_str: _TakesAscii) -> datetime: ... def parse_isodate(self, datestr: _TakesAscii) -> date: ... def parse_isotime(self, timestr: _TakesAscii) -> time: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/rrule.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/rrule.pyi index dd712283fd3a..62fe9bb928d7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/rrule.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/rrule.pyi @@ -62,8 +62,8 @@ class rrulebase: def __getitem__(self, item: int | slice) -> datetime.datetime: ... def __contains__(self, item: datetime.datetime) -> bool: ... def count(self) -> int | None: ... - def before(self, dt: datetime.datetime, inc: bool = False): ... - def after(self, dt: datetime.datetime, inc: bool = False): ... + def before(self, dt: datetime.datetime, inc: bool = False) -> datetime.datetime | None: ... + def after(self, dt: datetime.datetime, inc: bool = False) -> datetime.datetime | None: ... def xafter(self, dt: datetime.datetime, count: int | None = None, inc: bool = False) -> Generator[datetime.datetime]: ... def between( self, after: datetime.datetime, before: datetime.datetime, inc: bool = False, count: int = 1 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/tz/_common.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/tz/_common.pyi index 23bce452e8bb..56117f232d68 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/tz/_common.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/tz/_common.pyi @@ -10,9 +10,10 @@ __all__ = ["tzname_in_python2", "enfold"] _P = ParamSpec("_P") _R = TypeVar("_R") +_DateTimeT = TypeVar("_DateTimeT", bound=datetime) def tzname_in_python2(namefunc: Callable[_P, _R]) -> Callable[_P, _R]: ... -def enfold(dt: datetime, fold: int = 1): ... +def enfold(dt: _DateTimeT, fold: int = 1) -> _DateTimeT: ... # Doesn't actually have ABCMeta as the metaclass at runtime, # but mypy complains if we don't have it in the stub. diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/tz/tz.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/tz/tz.pyi index 0fad227656a0..fe2eaf50ee22 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/tz/tz.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/tz/tz.pyi @@ -13,7 +13,7 @@ else: tzwin: None tzwinlocal: None -_DT = TypeVar("_DT", bound=datetime) +_DateTimeT = TypeVar("_DateTimeT", bound=datetime) ZERO: timedelta EPOCH: datetime @@ -24,7 +24,7 @@ class tzutc(tzinfo): def dst(self, dt: datetime | None) -> timedelta | None: ... def tzname(self, dt: datetime | None) -> str: ... def is_ambiguous(self, dt: datetime | None) -> bool: ... - def fromutc(self, dt: _DT) -> _DT: ... + def fromutc(self, dt: _DateTimeT) -> _DateTimeT: ... def __eq__(self, other: object) -> bool: ... __hash__: ClassVar[None] # type: ignore[assignment] def __ne__(self, other: object) -> bool: ... @@ -38,7 +38,7 @@ class tzoffset(tzinfo): def dst(self, dt: datetime | None) -> timedelta | None: ... def is_ambiguous(self, dt: datetime | None) -> bool: ... def tzname(self, dt: datetime | None) -> str: ... - def fromutc(self, dt: _DT) -> _DT: ... + def fromutc(self, dt: _DateTimeT) -> _DateTimeT: ... def __eq__(self, other: object) -> bool: ... __hash__: ClassVar[None] # type: ignore[assignment] def __ne__(self, other: object) -> bool: ... @@ -126,12 +126,14 @@ TZPATHS: list[str] def datetime_exists(dt: datetime, tz: tzinfo | None = None) -> bool: ... def datetime_ambiguous(dt: datetime, tz: tzinfo | None = None) -> bool: ... -def resolve_imaginary(dt: datetime) -> datetime: ... +def resolve_imaginary(dt: _DateTimeT) -> _DateTimeT: ... # Singleton type defined locally in a function. Calls itself "GettzFunc". @type_check_only class _GetTZ: - def __call__(self, name: str | None = ...) -> tzinfo | None: ... + def __call__(self, name: str | None = None) -> tzinfo | None: ... + def set_cache_size(self, size: int) -> None: ... + def cache_clear(self) -> None: ... def nocache(self, name: str | None) -> tzinfo | None: ... gettz: _GetTZ diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/utils.pyi index 512c241832c9..ce4d8d38ccc0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/utils.pyi @@ -1,5 +1,8 @@ from datetime import _TzInfo, datetime, timedelta +from typing import TypeVar + +_DateTimeT = TypeVar("_DateTimeT", bound=datetime) def today(tzinfo: _TzInfo | None = None) -> datetime: ... -def default_tzinfo(dt: datetime, tzinfo: _TzInfo) -> datetime: ... +def default_tzinfo(dt: _DateTimeT, tzinfo: _TzInfo) -> _DateTimeT: ... def within_delta(dt1: datetime, dt2: datetime, delta: timedelta) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-http-client/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/python-http-client/METADATA.toml index 73ce01ef67e7..f93b0770d472 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-http-client/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-http-client/METADATA.toml @@ -1,2 +1,2 @@ version = "3.3.7" -upstream_repository = "https://github.com/sendgrid/python-http-client" +upstream-repository = "https://github.com/sendgrid/python-http-client" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-jenkins/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/python-jenkins/METADATA.toml index fdf458654ee0..c7623bffe1df 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-jenkins/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-jenkins/METADATA.toml @@ -1,3 +1,3 @@ version = "~=1.8.3" -upstream_repository = "https://opendev.org/jjb/python-jenkins" -requires = ["types-requests"] +upstream-repository = "https://opendev.org/jjb/python-jenkins" +dependencies = ["types-requests"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/python-jose/METADATA.toml index fe3ccd39f7c8..5248bfa71dfb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-jose/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/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 +upstream-repository = "https://github.com/mpdavis/python-jose" +dependencies = ["types-pyasn1"] # excluding pyrsa, cryptography until typing is available diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-nmap/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/python-nmap/METADATA.toml index 03ac98d97e07..5adab60f78fd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-nmap/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-nmap/METADATA.toml @@ -1,2 +1,2 @@ version = "0.7.*" -upstream_repository = "https://bitbucket.org/xael/python-nmap" +upstream-repository = "https://bitbucket.org/xael/python-nmap" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/METADATA.toml index 949a79c20435..8bb5fab0a6bd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-xlib/METADATA.toml @@ -1,2 +1,2 @@ version = "0.33.*" -upstream_repository = "https://github.com/python-xlib/python-xlib" +upstream-repository = "https://github.com/python-xlib/python-xlib" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pytz/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pytz/METADATA.toml index 275d74666e10..9e678a6d8541 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pytz/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pytz/METADATA.toml @@ -1,3 +1,3 @@ version = "2026.1.post1" # This is a mirror of https://git.launchpad.net/pytz/tree, see https://pythonhosted.org/pytz/#latest-versions -upstream_repository = "https://github.com/stub42/pytz" +upstream-repository = "https://github.com/stub42/pytz" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/METADATA.toml index 7e375492009f..6dbaac600ca5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/METADATA.toml @@ -1,6 +1,6 @@ version = "311.*" -upstream_repository = "https://github.com/mhammond/pywin32" +upstream-repository = "https://github.com/mhammond/pywin32" [tool.stubtest] -supported_platforms = ["win32"] -ci_platforms = ["win32"] +supported-platforms = ["win32"] +ci-platforms = ["win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/_win32typing.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/_win32typing.pyi index 38d9d578b468..9ba6d2246000 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/_win32typing.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/_win32typing.pyi @@ -174,12 +174,10 @@ class PyACL: def Initialize(self) -> None: ... def IsValid(self) -> bool: ... @overload - @deprecated( - """\ + @deprecated("""\ Early versions of this function supported only two arguments. \ This has been deprecated in preference of the three argument version, \ -which reflects the win32 API and the new functions in this module.""" - ) +which reflects the win32 API and the new functions in this module.""") def AddAccessAllowedAce(self, access: int, sid: PySID, /) -> None: ... @overload def AddAccessAllowedAce(self, revision: int, access: int, sid: PySID, /) -> None: ... @@ -188,12 +186,10 @@ which reflects the win32 API and the new functions in this module.""" self, AceRevision, AceFlags, AccessMask, ObjectTypeGuid: PyIID, InheritedObjectTypeGuid: PyIID, sid: PySID, / ) -> None: ... @overload - @deprecated( - """\ + @deprecated("""\ Early versions of this function supported only two arguments. \ This has been deprecated in preference of the three argument version, \ -which reflects the win32 API and the new functions in this module.""" - ) +which reflects the win32 API and the new functions in this module.""") def AddAccessDeniedAce(self, access: int, sid: PySID, /) -> None: ... @overload def AddAccessDeniedAce(self, revision: int, access: int, sid: PySID, /) -> None: ... @@ -244,13 +240,11 @@ class PyCERTSTORE: @overload def CertCloseStore(self) -> None: ... @overload - @deprecated( - """\ + @deprecated("""\ `Flags` argument has been deprecated as it is likely to crash the process if \ `CERT_CLOSE_STORE_FORCE_FLAG` is specified. The underlying function is now \ always called with `CERT_CLOSE_STORE_CHECK_FLAG`, and support for this \ -param will be dropped at some point in the future.""" - ) +param will be dropped at some point in the future.""") def CertCloseStore(self, Flags: int) -> None: ... def CertControlStore(self, Flags, CtrlType, CtrlPara: int) -> None: ... def CertEnumCertificatesInStore(self) -> list[PyCERT_CONTEXT]: ... @@ -609,8 +603,8 @@ class PyConsoleScreenBuffer: def ReadConsoleInput(self, Length) -> tuple[PyINPUT_RECORD, ...]: ... def PeekConsoleInput(self, Length) -> tuple[PyINPUT_RECORD, ...]: ... def GetNumberOfConsoleInputEvents(self): ... - def Close(self, *args): ... # incomplete - def Detach(self, *args): ... # incomplete + def Close(self) -> None: ... + def Detach(self) -> int: ... @disjoint_base class PyCredHandle: @@ -929,7 +923,7 @@ class PyHDESK: def EnumDesktopWindows(self) -> tuple[int, ...]: ... def SwitchDesktop(self) -> None: ... def CloseDesktop(self) -> None: ... - def Detach(self, *args): ... # incomplete + def Detach(self) -> int: ... class PyHDEVNOTIFY: ... @@ -1066,7 +1060,7 @@ class PyHWINSTA: def EnumDesktops(self) -> tuple[Incomplete, ...]: ... def SetProcessWindowStation(self) -> None: ... def CloseWindowStation(self) -> None: ... - def Detach(self, *args): ... # incomplete + def Detach(self) -> int: ... class PyICONINFO: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythoncom.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythoncom.pyi index 6368357725a9..e31342781069 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythoncom.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythoncom.pyi @@ -54,13 +54,13 @@ def CoRevokeClassObject(reg: int, /) -> None: ... def CoTreatAsClass(clsidold: _win32typing.PyIID, clsidnew: _win32typing.PyIID, /) -> None: ... def CoWaitForMultipleHandles(Flags, Timeout, Handles: list[int], /): ... def Connect(cls, /) -> _win32typing.PyIDispatch: ... -def connect(*args): ... # incomplete +def connect(cls, /) -> _win32typing.PyIDispatch: ... def CreateGuid() -> _win32typing.PyIID: ... def CreateBindCtx() -> _win32typing.PyIBindCtx: ... def CreateFileMoniker(filename: str, /) -> _win32typing.PyIMoniker: ... def CreateItemMoniker(delim: str, item: str, /) -> _win32typing.PyIMoniker: ... def CreatePointerMoniker(IUnknown: _win32typing.PyIUnknown, /) -> _win32typing.PyIMoniker: ... -def CreateURLMonikerEx(*args): ... # incomplete +def CreateURLMonikerEx(Context, URL, Flags: int = ..., /): ... def CreateTypeLib(): ... def CreateTypeLib2(): ... def CreateStreamOnHGlobal(hGlobal: int | None = ..., DeleteOnRelease: bool = ..., /) -> _win32typing.PyIStream: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/dde.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/dde.pyi index 41f2e65d894b..ed3e6d13e9f7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/dde.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/dde.pyi @@ -16,11 +16,11 @@ CBF_SKIP_CONNECT_CONFIRMS: int CBF_SKIP_DISCONNECTS: int CBF_SKIP_REGISTRATIONS: int -def CreateConversation(*args): ... # incomplete -def CreateServer(*args): ... # incomplete -def CreateServerSystemTopic(*args): ... # incomplete -def CreateStringItem(*args): ... # incomplete -def CreateTopic(*args): ... # incomplete +def CreateConversation(Server, /): ... +def CreateServer(): ... +def CreateServerSystemTopic(): ... +def CreateStringItem(name, /): ... +def CreateTopic(name, /): ... MF_CALLBACKS: int MF_CONV: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/win32ui.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/win32ui.pyi index b9ea26ca26e6..ea569a8dc85b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/win32ui.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/win32ui.pyi @@ -145,13 +145,13 @@ def TranslateMessage(): ... def TranslateVirtualKey(vk, /) -> str: ... def WinHelp(arg, data: str, /) -> None: ... def WriteProfileVal(section: str, entry: str, value: str, /) -> None: ... -def AddToRecentFileList(*args): ... # incomplete -def CreateImageList(*args): ... # incomplete -def CreateListCtrl(*args): ... # incomplete -def CreateListView(*args): ... # incomplete -def CreateRectRgn(*args): ... # incomplete -def GetRecentFileList(*args): ... # incomplete -def OutputDebug(*args): ... # incomplete +def AddToRecentFileList(fname, /): ... +def CreateImageList(cx, cy, mask, initial, grow, /): ... +def CreateListCtrl(): ... +def CreateListView(doc, /): ... +def CreateRectRgn(rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], /): ... +def GetRecentFileList() -> list[Incomplete]: ... +def OutputDebug(msg: str, /) -> None: ... AFX_IDW_PANE_FIRST: int AFX_IDW_PANE_LAST: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/win32uiole.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/win32uiole.pyi index 7d3e524c0c78..01e3e02e5bf7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/win32uiole.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/pythonwin/win32uiole.pyi @@ -12,7 +12,7 @@ def OleGetUserCtrl(): ... def OleSetUserCtrl(bUserCtrl, /): ... def SetMessagePendingDelay(delay, /) -> None: ... def EnableNotRespondingDialog(enabled, /) -> None: ... -def EnableBusyDialog(*args): ... # incomplete +def EnableBusyDialog(enabled, /) -> None: ... COleClientItem_activeState: int COleClientItem_activeUIState: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win2kras.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win2kras.pyi index 6924f7b319bd..ecb1da748f7e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win2kras.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win2kras.pyi @@ -2,7 +2,7 @@ RASEAPF_Logon: int RASEAPF_NonInteractive: int RASEAPF_Preview: int -def GetEapUserIdentity(*args): ... # incomplete +def GetEapUserIdentity(phoneBook: str | None, entry: str, flags: int, hwnd=None, /): ... RASCS_AllDevicesConnected: int RASCS_AuthAck: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32gui_struct.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32gui_struct.pyi index e7f2c24f6786..0bce3711549e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32gui_struct.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/lib/win32gui_struct.pyi @@ -1,16 +1,17 @@ from _typeshed import Incomplete, ReadableBuffer from array import array -from typing import NamedTuple +from typing import NamedTuple, type_check_only is64bit: bool +@type_check_only class _WMNOTIFY(NamedTuple): hwndFrom: Incomplete idFrom: Incomplete code: Incomplete def UnpackWMNOTIFY(lparam: int) -> _WMNOTIFY: ... - +@type_check_only class _NMITEMACTIVATE(NamedTuple): hwndFrom: Incomplete idFrom: Incomplete @@ -37,7 +38,7 @@ def PackMENUITEMINFO( hbmpItem: Incomplete | None = ..., dwTypeData: Incomplete | None = ..., ) -> tuple[array[int], list[Incomplete]]: ... - +@type_check_only class _MENUITEMINFO(NamedTuple): fType: int | None fState: int | None @@ -59,7 +60,7 @@ def PackMENUINFO( dwMenuData: Incomplete | None = ..., fMask: int = ..., ) -> array[int]: ... - +@type_check_only class _MENUINFO(NamedTuple): dwStyle: Incomplete | None cyMax: Incomplete | None @@ -72,7 +73,7 @@ def EmptyMENUINFO(mask: Incomplete | None = ...) -> array[int]: ... def PackTVINSERTSTRUCT(parent, insertAfter, tvitem) -> tuple[bytes, list[Incomplete]]: ... def PackTVITEM(hitem, state, stateMask, text, image, selimage, citems, param) -> tuple[array[int], list[Incomplete]]: ... def EmptyTVITEM(hitem, mask: Incomplete | None = ..., text_buf_size: int = ...) -> tuple[array[int], list[Incomplete]]: ... - +@type_check_only class _TVITEM(NamedTuple): item_hItem: Incomplete item_state: Incomplete | None @@ -84,7 +85,7 @@ class _TVITEM(NamedTuple): item_param: Incomplete | None def UnpackTVITEM(buffer: ReadableBuffer) -> _TVITEM: ... - +@type_check_only class _TVNOTIFY(NamedTuple): hwndFrom: Incomplete id: Incomplete @@ -94,7 +95,7 @@ class _TVNOTIFY(NamedTuple): item_new: _TVITEM def UnpackTVNOTIFY(lparam: int) -> _TVNOTIFY: ... - +@type_check_only class _TVDISPINFO(NamedTuple): hwndFrom: Incomplete id: Incomplete @@ -112,7 +113,7 @@ def PackLVITEM( param: Incomplete | None = ..., indent: Incomplete | None = ..., ) -> tuple[array[int], list[Incomplete]]: ... - +@type_check_only class _LVITEM(NamedTuple): item_item: Incomplete item_subItem: Incomplete @@ -124,7 +125,7 @@ class _LVITEM(NamedTuple): item_indent: Incomplete | None def UnpackLVITEM(buffer: ReadableBuffer) -> _LVITEM: ... - +@type_check_only class _LVDISPINFO(NamedTuple): hwndFrom: Incomplete id: Incomplete @@ -132,7 +133,7 @@ class _LVDISPINFO(NamedTuple): item: _LVITEM def UnpackLVDISPINFO(lparam: int) -> _LVDISPINFO: ... - +@type_check_only class _UnpackLVNOTIFY(NamedTuple): hwndFrom: Incomplete id: Incomplete @@ -157,7 +158,7 @@ def PackLVCOLUMN( image: Incomplete | None = ..., order: Incomplete | None = ..., ) -> tuple[array[int], list[Incomplete]]: ... - +@type_check_only class _LVCOLUMN(NamedTuple): fmt: Incomplete | None cx: Incomplete | None @@ -169,7 +170,7 @@ class _LVCOLUMN(NamedTuple): def UnpackLVCOLUMN(lparam: ReadableBuffer) -> _LVCOLUMN: ... def EmptyLVCOLUMN(mask: Incomplete | None = ..., text_buf_size: int = ...) -> tuple[array[int], list[Incomplete]]: ... def PackLVHITTEST(pt) -> tuple[array[int], None]: ... - +@type_check_only class _LVHITTEST(NamedTuple): pt: tuple[Incomplete, Incomplete] flags: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32api.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32api.pyi index 1577e5e95c6d..e06fea623e44 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32api.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32api.pyi @@ -314,13 +314,13 @@ def RGB(red: int, green: int, blue: int, /) -> int: ... def MAKELANGID(PrimaryLanguage, SubLanguage, /): ... def MAKEWORD(low, high, /): ... def MAKELONG(low, high, /): ... -def CommandLineToArgv(*args): ... # incomplete +def CommandLineToArgv(cmdLine: str, /) -> list[str]: ... def GetKeyboardLayoutList() -> tuple[int, int]: ... -def MapVirtualKey(*args): ... # incomplete -def MessageBoxEx(*args): ... # incomplete -def OpenThread(*args): ... # incomplete -def SleepEx(*args): ... # incomplete -def VkKeyScanEx(*args): ... # incomplete +def MapVirtualKey(vk: int, type: int, hlayout=None, /) -> int: ... +def MessageBoxEx(hwnd, message: str, title: str | None = ..., style: int = ..., language: int = ..., /) -> int: ... +def OpenThread(reqdAccess: int, bInherit, pid: int, /): ... +def SleepEx(time: int, bAlterable=0, /) -> int: ... +def VkKeyScanEx(char: str | bytes, hkl, /) -> int: ... NameCanonical: int NameCanonicalEx: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32event.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32event.pyi index c00d5e37e999..91ea664f69a5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32event.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32event.pyi @@ -36,7 +36,7 @@ def WaitForMultipleObjectsEx(handlelist: list[int], bWaitAll, milliseconds, bAle def WaitForSingleObject(hHandle: int, milliseconds: int, /) -> int: ... def WaitForSingleObjectEx(hHandle: int, milliseconds, bAlertable, /): ... def WaitForInputIdle(hProcess: int, milliseconds, /): ... -def SignalObjectAndWait(*args): ... # incomplete +def SignalObjectAndWait(hSignal, hWaitOn, milliseconds, bAlertable, /): ... CREATE_WAITABLE_TIMER_HIGH_RESOLUTION: int CREATE_WAITABLE_TIMER_MANUAL_RESET: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32file.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32file.pyi index aef4e1af9c2e..f2b1ff59a390 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32file.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32file.pyi @@ -267,8 +267,8 @@ def OpenFileById( Flags, SecurityAttributes: _win32typing.PySECURITY_ATTRIBUTES | None = ..., ) -> int: ... -def DCB(*args): ... # incomplete -def GetFileAttributesExW(*args): ... # incomplete +def DCB() -> _win32typing.PyDCB: ... +def GetFileAttributesExW(FileName: str, InfoLevelId: int = ..., Transaction: int | None = None): ... def OVERLAPPED() -> _win32typing.PyOVERLAPPED: ... CALLBACK_CHUNK_FINISHED: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32gui.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32gui.pyi index 9d58f6c72979..7c30058dbc3c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32gui.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32gui.pyi @@ -475,33 +475,33 @@ def RegisterHotKey(hWnd: _win32typing.PyHANDLE | int | None, _id: int, Modifiers def UnregisterHotKey(hWnd: _win32typing.PyHANDLE | int | None, _id: int, /) -> None: ... def GetAncestor(hwnd: int, gaFlags: int, /) -> int: ... def GetTopWindow(hWnd: int | None, /) -> int: ... -def ChildWindowFromPointEx(*args): ... # incomplete -def CreateDialogIndirectParam(*args): ... # incomplete -def DestroyAcceleratorTable(*args): ... # incomplete -def Edit_GetLine(*args): ... # incomplete +def ChildWindowFromPointEx(hwndParent: int, point: tuple[Incomplete, Incomplete], flags: int, /): ... +def CreateDialogIndirectParam(hInstance, controlList, hWndParent, DialogFunc, InitParam: int = 0, /) -> int: ... +def DestroyAcceleratorTable(haccel, /): ... +def Edit_GetLine(hwnd, line, size=..., /): ... def GetModuleHandle(lpModuleName: str | None, /) -> int: ... -def GetWindowTextLength(*args): ... # incomplete -def HIWORD(*args): ... # incomplete -def ImageList_Add(*args): ... # incomplete -def ImageList_Create(*args): ... # incomplete -def ImageList_Destroy(*args): ... # incomplete -def ImageList_Draw(*args): ... # incomplete -def ImageList_DrawEx(*args): ... # incomplete -def ImageList_GetIcon(*args): ... # incomplete -def ImageList_GetImageCount(*args): ... # incomplete -def ImageList_LoadBitmap(*args): ... # incomplete -def ImageList_LoadImage(*args): ... # incomplete -def ImageList_Remove(*args): ... # incomplete -def ImageList_Replace(*args): ... # incomplete -def ImageList_ReplaceIcon(*args): ... # incomplete -def ImageList_SetBkColor(*args): ... # incomplete -def ImageList_SetOverlayImage(*args): ... # incomplete -def LOWORD(*args): ... # incomplete -def ListView_SortItems(*args): ... # incomplete -def ListView_SortItemsEx(*args): ... # incomplete -def ValidateRect(*args): ... # incomplete +def GetWindowTextLength(hwnd, /) -> int: ... +def HIWORD(val: int, /) -> int: ... +def ImageList_Add(hImageList, hbmImage, hbmMask, /) -> int: ... +def ImageList_Create(cx: int, cy: int, flags: int, cInitial: int, cGrow: int, /): ... +def ImageList_Destroy(hImageList, /): ... +def ImageList_Draw(hImageList, i: int, hdcDst, x: int, y: int, fStyle, /): ... +def ImageList_DrawEx(hImageList, i: int, hdcDst, x: int, y: int, dx: int, dy: int, rgbBk, rgbFg, fStyle, /): ... +def ImageList_GetIcon(hImageList, i: int, flag: int, /): ... +def ImageList_GetImageCount(hImageList, /) -> int: ... +def ImageList_LoadBitmap(hInst, name, cx: int, cGrow: int, crMask, /): ... +def ImageList_LoadImage(hInst, name, cx: int, cGrow: int, crMask, uType, uFlags, /): ... +def ImageList_Remove(hImageList, i, /): ... +def ImageList_Replace(hImageList, i, hicon, /): ... +def ImageList_ReplaceIcon(hImageList, i, hicon, /): ... +def ImageList_SetBkColor(hImageList, Color, /): ... +def ImageList_SetOverlayImage(hImageList, iImage, iOverlay, /): ... +def LOWORD(val: int, /) -> int: ... +def ListView_SortItems(hwnd, callback, param=None, /) -> None: ... +def ListView_SortItemsEx(hwnd, callback, param=None, /) -> None: ... +def ValidateRect(hWnd, Rect, /): ... def WNDCLASS() -> _win32typing.PyWNDCLASS: ... -def lpstr(*args): ... # incomplete +def lpstr(address, /) -> bytes: ... CLR_NONE: int ILC_COLOR: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32inet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32inet.pyi index 3ccc4d9796c6..77bd3645eed2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32inet.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32inet.pyi @@ -61,9 +61,9 @@ def SetUrlCacheEntryGroup(UrlName, Flags, GroupId) -> None: ... def GetUrlCacheGroupAttribute(GroupId, Attributes=...): ... def SetUrlCacheGroupAttribute(GroupId, Attributes, GroupInfo, Flags=...) -> None: ... def DeleteUrlCacheEntry(UrlName, /) -> None: ... -def WinHttpGetDefaultProxyConfiguration(*args): ... # incomplete -def WinHttpGetIEProxyConfigForCurrentUser(*args): ... # incomplete -def WinHttpGetProxyForUrl(*args): ... # incomplete -def WinHttpOpen(*args): ... # incomplete +def WinHttpGetDefaultProxyConfiguration(): ... +def WinHttpGetIEProxyConfigForCurrentUser() -> tuple[int, str, str, str]: ... +def WinHttpGetProxyForUrl(handle: _win32typing.PyHANDLE | int | None, url: str, options: tuple[int | str | None, ...], /): ... +def WinHttpOpen(lpszUserAgent: str, dwAccessType: int, lpszProxyName: str, lpszProxyBypass: str, dwFlags: int, /): ... UNICODE: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32net.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32net.pyi index 92e464520281..2a01d0e39135 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32net.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32net.pyi @@ -81,11 +81,11 @@ def NetServerComputerNameAdd(ServerName: str, EmulatedDomainName: str, EmulatedS def NetServerComputerNameDel(ServerName: str, EmulatedServerName: str, /) -> None: ... def NetValidateName(Server: str, Name: str, NameType, Account: str | None = ..., Password: str | None = ..., /) -> None: ... def NetValidatePasswordPolicy(Server: str, Qualifier, ValidationType, arg, /) -> None: ... -def NetLocalGroupAdd(*args): ... # incomplete -def NetLocalGroupDel(*args): ... # incomplete -def NetLocalGroupEnum(*args): ... # incomplete -def NetLocalGroupGetInfo(*args): ... # incomplete -def NetLocalGroupSetInfo(*args): ... # incomplete +def NetLocalGroupAdd(server: str, level: int, data, /) -> None: ... +def NetLocalGroupDel(server: str, groupname: str, data, /) -> None: ... +def NetLocalGroupEnum(server: str, level: int, resumeHandle=..., prefLen: int = ..., /): ... +def NetLocalGroupGetInfo(server: str, groupname: str, level: int, /): ... +def NetLocalGroupSetInfo(server: str, groupname: str, level: int, data, /) -> None: ... SERVICE_SERVER: str SERVICE_WORKSTATION: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32pdh.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32pdh.pyi index f6948b3c1bea..15f5c1b70834 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32pdh.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32pdh.pyi @@ -1,5 +1,6 @@ from _typeshed import Incomplete +import _win32typing from win32.lib.pywintypes import error as error def AddCounter(hQuery, path: str, userData: int = ..., /): ... @@ -36,7 +37,7 @@ def BrowseCounters( def ConnectMachine(machineName: str, /) -> str: ... def LookupPerfIndexByName(machineName: str, instanceName: str, /): ... def LookupPerfNameByIndex(machineName: str | None, index, /) -> str: ... -def GetFormattedCounterArray(*args): ... # incomplete +def GetFormattedCounterArray(handle: _win32typing.PyHANDLE | int | None, format: int, /) -> dict[Incomplete, Incomplete]: ... PDH_FMT_1000: int PDH_FMT_ANSI: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32process.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32process.pyi index 16e11cfbe6b0..4dc05a0d8378 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32process.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32process.pyi @@ -74,10 +74,10 @@ def GetProcessShutdownParameters() -> tuple[Incomplete, Incomplete]: ... def SetProcessShutdownParameters(Level, Flags, /) -> None: ... def GetGuiResources(Process: int, Flags, /): ... def IsWow64Process(Process: int | None = ..., /) -> bool: ... -def ReadProcessMemory(*args): ... # incomplete -def VirtualAllocEx(*args): ... # incomplete -def VirtualFreeEx(*args): ... # incomplete -def WriteProcessMemory(*args): ... # incomplete +def ReadProcessMemory(hProcess, address: int, size: int, /) -> bytes: ... +def VirtualAllocEx(hProcess, address: int, size: int, allocationType: int, flProtect: int, /): ... +def VirtualFreeEx(hProcess, address: int, size: int, freeType: int, /): ... +def WriteProcessMemory(hProcess, address, buf, /) -> int: ... ABOVE_NORMAL_PRIORITY_CLASS: int BELOW_NORMAL_PRIORITY_CLASS: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32ras.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32ras.pyi index 368ca438a19e..f27777dd2493 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32ras.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32ras.pyi @@ -14,11 +14,11 @@ def GetConnectStatus(hrasconn, /) -> tuple[Incomplete, Incomplete, str, str]: .. def GetEntryDialParams( fileName: str, entryName: str, / ) -> tuple[tuple[Incomplete, Incomplete, Incomplete, Incomplete, Incomplete, Incomplete], bool]: ... -def GetErrorString(error, /) -> str: ... # noqa: F811 +def GetErrorString(error, /) -> str: ... def HangUp(hras, /) -> None: ... def IsHandleValid(hras: int | None, /) -> bool: ... def SetEntryDialParams(fileName: str, RasDialParams, bSavePassword, /) -> None: ... -def RASDIALEXTENSIONS(*args): ... # incomplete +def RASDIALEXTENSIONS() -> _win32typing.RASDIALEXTENSIONS: ... RASCS_AllDevicesConnected: int RASCS_AuthAck: int @@ -49,7 +49,7 @@ RASCS_StartAuthentication: int RASCS_WaitForCallback: int RASCS_WaitForModemReset: int -def GetEapUserIdentity(*args): ... # incomplete +def GetEapUserIdentity(phoneBook: str | None, entry: str, flags: int, hwnd: _win32typing.PyHANDLE | int | None = None, /): ... RASEAPF_Logon: int RASEAPF_NonInteractive: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32security.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32security.pyi index eed2a902ad81..4f25c80e7c57 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32security.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32security.pyi @@ -416,13 +416,14 @@ UNPROTECTED_SACL_SECURITY_INFORMATION: int CredHandleType = _win32typing.PyCredHandle CtxtHandleType = _win32typing.PyCtxtHandle -def DsListDomainsInSite(*args): ... # incomplete -def DsListInfoForServer(*args): ... # incomplete -def DsListRoles(*args): ... # incomplete -def DsListServersForDomainInSite(*args): ... # incomplete -def DsListServersInSite(*args): ... # incomplete -def DsListSites(*args): ... # incomplete -def GetPolicyHandle(*args): ... # incomplete +def DsListDomainsInSite(hds, site: str, /): ... +def DsListInfoForServer(hds, server: str, /): ... +def DsListRoles(hds, /): ... +def DsListServersForDomainInSite(hds, domain: str, site: str, /): ... +def DsListServersInSite(hds, site: str, /): ... +def DsListSites(hds, /): ... + +GetPolicyHandle = LsaOpenPolicy MICROSOFT_KERBEROS_NAME_A: bytes MSV1_0_PACKAGE_NAME: bytes diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32trace.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32trace.pyi index 1e3fe7945cb6..0ab7e8c3b837 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32trace.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32/win32trace.pyi @@ -1,13 +1,13 @@ from win32.lib.pywintypes import error as error -def GetHandle(*args): ... # incomplete +def GetHandle() -> int: ... def GetTracer(): ... -def InitRead(*args): ... # incomplete -def InitWrite(*args): ... # incomplete -def TermRead(*args): ... # incomplete -def TermWrite(*args): ... # incomplete -def blockingread(*args): ... # incomplete -def flush(*args): ... # incomplete -def read(*args): ... # incomplete -def setprint(*args): ... # incomplete -def write(*args): ... # incomplete +def InitRead() -> None: ... +def InitWrite() -> None: ... +def TermRead() -> None: ... +def TermWrite() -> None: ... +def blockingread(milliSeconds: int = ..., /) -> str: ... +def flush() -> None: ... +def read() -> str: ... +def setprint() -> None: ... +def write(data: str, /) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/__init__.pyi index 987a842edbec..44f2aa61cd96 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/__init__.pyi @@ -5,36 +5,30 @@ from typing_extensions import TypeAlias import _win32typing from pythoncom import com_record +from win32.lib.pywintypes import IIDType from win32com.client import dynamic _Stringifiable: TypeAlias = object -def GetObject(Pathname: str | None = ..., Class: Incomplete | None = ..., clsctx: Incomplete | None = ...) -> CDispatch: ... -def GetActiveObject(Class, clsctx=...): ... -def Moniker(Pathname, clsctx=...): ... +def GetObject(Pathname: str | None = None, Class=None, clsctx=None) -> CDispatch: ... +def GetActiveObject(Class: str, clsctx=...): ... +def Moniker(Pathname: str, clsctx=...): ... def Dispatch( - dispatch: str | dynamic.PyIDispatchType | dynamic._GoodDispatchTypes | dynamic.PyIUnknownType, - userName: str | None = ..., - resultCLSID: _Stringifiable | None = ..., - typeinfo: _win32typing.PyITypeInfo | None = ..., + dispatch: str | dynamic.PyIDispatchType | IIDType | dynamic.PyIUnknownType, + userName: str | None = None, + resultCLSID: _Stringifiable | None = None, + typeinfo: _win32typing.PyITypeInfo | None = None, clsctx: int = ..., ) -> dynamic.CDispatch: ... -def DispatchEx( - clsid, - machine: Incomplete | None = ..., - userName: Incomplete | None = ..., - resultCLSID: Incomplete | None = ..., - typeinfo: Incomplete | None = ..., - clsctx: Incomplete | None = ..., -): ... +def DispatchEx(clsid, machine=None, userName=None, resultCLSID=None, typeinfo=None, clsctx=None): ... class CDispatch(dynamic.CDispatch): - def __dir__(self): ... + def __dir__(self) -> list[str]: ... -def CastTo(ob, target, typelib: Incomplete | None = ...): ... +def CastTo(ob, target, typelib=None): ... class Constants: - __dicts__: Incomplete + __dicts__: list[Incomplete] def __getattr__(self, a: str): ... constants: Final[Constants] @@ -45,22 +39,22 @@ class EventsProxy: def __getattr__(self, attr: str): ... def __setattr__(self, attr: str, val) -> None: ... -def DispatchWithEvents(clsid, user_event_class): ... +def DispatchWithEvents(clsid, user_event_class) -> EventsProxy: ... def WithEvents(disp, user_event_class): ... def getevents(clsid): ... def Record(name, object) -> com_record: ... def register_record_class(cls) -> None: ... class DispatchBaseClass: - def __init__(self, oobj: Incomplete | None = ...) -> None: ... - def __dir__(self): ... - def __eq__(self, other): ... - def __ne__(self, other): ... + def __init__(self, oobj=None) -> None: ... + def __dir__(self) -> list[str]: ... + def __eq__(self, other) -> bool: ... + def __ne__(self, other) -> bool: ... def __getattr__(self, attr: str): ... def __setattr__(self, attr: str, value) -> None: ... class CoClassBaseClass: - def __init__(self, oobj: Incomplete | None = ...) -> None: ... + def __init__(self, oobj=None) -> None: ... def __getattr__(self, attr: str): ... def __setattr__(self, attr: str, value) -> None: ... def __call__(self, *args, **kwargs): ... @@ -73,4 +67,9 @@ class CoClassBaseClass: class VARIANT: varianttype: Incomplete def __init__(self, vt, value) -> None: ... - value: Incomplete + @property + def value(self): ... + @value.setter + def value(self, newval) -> None: ... + @value.deleter + def value(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/build.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/build.pyi index cbbcd2e9a1f8..5eba28add3f4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/build.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/build.pyi @@ -1,36 +1,70 @@ from _typeshed import Incomplete +from collections.abc import Iterable +from typing import ClassVar, Final, Literal + +class NotSupportedException(Exception): ... + +DropIndirection: Final = "DropIndirection" +NoTranslateTypes: Final[list[int]] +NoTranslateMap: Final[set[int]] + +class MapEntry: + dispid: Incomplete + desc: Incomplete | None + names: Incomplete + doc: Incomplete + resultCLSID: Incomplete + resultDocumentation: Incomplete | None + wasProperty: Incomplete + hidden: bool | Literal[0, 1] + def __init__( + self, desc_or_id, names=None, doc=None, resultCLSID=..., resultDoc=None, hidden: bool | Literal[0, 1] = 0 + ) -> None: ... + def GetResultCLSID(self) -> Incomplete | None: ... + def GetResultCLSIDStr(self) -> str: ... + def GetResultName(self) -> Incomplete | None: ... class OleItem: - typename: str + typename: ClassVar[str] doc: Incomplete - python_name: Incomplete - bWritten: int - bIsDispatch: int - bIsSink: int - clsid: Incomplete - co_class: Incomplete - def __init__(self, doc: Incomplete | None = ...) -> None: ... + python_name: Incomplete | None + bWritten: bool | Literal[0, 1] + bIsDispatch: bool | Literal[0, 1] + bIsSink: bool | Literal[0, 1] + clsid: Incomplete | None + co_class: Incomplete | None + def __init__(self, doc=None) -> None: ... class DispatchItem(OleItem): - typename: str - propMap: Incomplete - propMapGet: Incomplete - propMapPut: Incomplete - mapFuncs: Incomplete - defaultDispatchName: Incomplete - hidden: int - def __init__( - self, typeinfo: Incomplete | None = ..., attr: Incomplete | None = ..., doc: Incomplete | None = ..., bForUser: int = ... - ) -> None: ... + typename: ClassVar[str] + propMap: dict[Incomplete, Incomplete] + propMapGet: dict[Incomplete, Incomplete] + propMapPut: dict[Incomplete, Incomplete] + mapFuncs: dict[Incomplete, Incomplete] + defaultDispatchName: Incomplete | None + hidden: bool | Literal[0, 1] + def __init__(self, typeinfo=None, attr=None, doc=None, bForUser: bool | Literal[0, 1] = 1) -> None: ... clsid: Incomplete - bIsDispatch: Incomplete - def Build(self, typeinfo, attr, bForUser: int = ...) -> None: ... - def CountInOutOptArgs(self, argTuple): ... - def MakeFuncMethod(self, entry, name, bMakeClass: int = ...): ... - def MakeDispatchFuncMethod(self, entry, name, bMakeClass: int = ...): ... - def MakeVarArgsFuncMethod(self, entry, name, bMakeClass: int = ...): ... + bIsDispatch: bool | Literal[0, 1] + def Build(self, typeinfo, attr, bForUser: bool | Literal[0, 1] = 1) -> None: ... + def CountInOutOptArgs(self, argTuple: Iterable[Incomplete]) -> tuple[int, int, int]: ... + def MakeFuncMethod(self, entry, name: str, bMakeClass: bool | Literal[0, 1] = 1) -> list[str]: ... + def MakeDispatchFuncMethod(self, entry, name: str, bMakeClass: bool | Literal[0, 1] = 1) -> list[str]: ... + def MakeVarArgsFuncMethod(self, entry, name: str, bMakeClass: bool | Literal[0, 1] = 1) -> list[str]: ... + +class VTableItem(DispatchItem): + vtableFuncs: list[tuple[Incomplete, Incomplete, Incomplete]] + def Build(self, typeinfo, attr, bForUser: bool | Literal[0, 1] = 1) -> None: ... class LazyDispatchItem(DispatchItem): - typename: str + typename: ClassVar[str] clsid: Incomplete def __init__(self, attr, doc) -> None: ... + +typeSubstMap: Final[dict[int, int]] +valid_identifier_chars: Final[str] + +def demunge_leading_underscores(className: str) -> str: ... +def MakePublicAttributeName(className: str, is_global: bool = False) -> str: ... +def MakeDefaultArgRepr(defArgVal) -> str | None: ... +def BuildCallList(fdesc, names, defNamedOptArg, defNamedNotOptArg, defUnnamedArg, defOutArg, is_comment: bool = False) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/dynamic.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/dynamic.pyi index 17b3cb620fff..7d910d2b40fa 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/dynamic.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/dynamic.pyi @@ -1,6 +1,5 @@ from _typeshed import Incomplete -from typing import Any, Protocol, TypeVar, overload -from typing_extensions import TypeAlias +from typing import Any, Final, Literal, Protocol, TypeVar, overload, type_check_only import _win32typing from win32.lib.pywintypes import IIDType @@ -9,60 +8,59 @@ from win32com.client import build _T_co = TypeVar("_T_co", covariant=True) _T = TypeVar("_T") +@type_check_only class _DispatchCreateClass(Protocol[_T_co]): @staticmethod def __call__( - IDispatch: str | PyIDispatchType | _GoodDispatchTypes | PyIUnknownType, + IDispatch: str | PyIDispatchType | IIDType | PyIUnknownType, olerepr: build.DispatchItem | build.LazyDispatchItem, - userName: str | None = ..., - lazydata: Incomplete | None = ..., + userName: str | None = None, + lazydata=None, ) -> _T_co: ... debugging: int debugging_attr: int -LCID: int -ERRORS_BAD_CONTEXT: Incomplete -ALL_INVOKE_TYPES: Incomplete +LCID: Final = 0x0 +ERRORS_BAD_CONTEXT: Final[list[int]] +ALL_INVOKE_TYPES: Final[list[int]] -def debug_print(*args) -> None: ... -def debug_attr_print(*args) -> None: ... +def debug_print(*args: object) -> None: ... +def debug_attr_print(*args: object) -> None: ... PyIDispatchType = _win32typing.PyIDispatch PyIUnknownType = _win32typing.PyIUnknown -_GoodDispatchTypes: TypeAlias = tuple[type[str], type[IIDType]] - @overload def Dispatch( - IDispatch: str | PyIDispatchType | _GoodDispatchTypes | PyIUnknownType, + IDispatch: str | PyIDispatchType | IIDType | PyIUnknownType, userName: str | None, createClass: _DispatchCreateClass[_T], - typeinfo: _win32typing.PyITypeInfo | None = ..., + typeinfo: _win32typing.PyITypeInfo | None = None, clsctx: int = ..., ) -> _T: ... @overload def Dispatch( - IDispatch: str | PyIDispatchType | _GoodDispatchTypes | PyIUnknownType, - userName: str | None = ..., + IDispatch: str | PyIDispatchType | IIDType | PyIUnknownType, + userName: str | None = None, createClass: None = None, - typeinfo: _win32typing.PyITypeInfo | None = ..., + typeinfo: _win32typing.PyITypeInfo | None = None, clsctx: int = ..., ) -> CDispatch: ... -def MakeOleRepr(IDispatch, typeinfo, typecomp): ... -def DumbDispatch(IDispatch, userName: Incomplete | None = ..., createClass: Incomplete | None = ..., clsctx=...): ... +def MakeOleRepr(IDispatch, typeinfo, typecomp) -> build.DispatchItem | build.LazyDispatchItem: ... +def DumbDispatch(IDispatch, userName=None, createClass=None, clsctx=...): ... class CDispatch: - def __init__(self, IDispatch, olerepr, userName: Incomplete | None = ..., lazydata: Incomplete | None = ...) -> None: ... + def __init__(self, IDispatch, olerepr, userName=None, lazydata=None) -> None: ... def __call__(self, *args): ... def __bool__(self) -> bool: ... - def __dir__(self): ... - def __eq__(self, other): ... - def __ne__(self, other): ... + def __dir__(self) -> list[str]: ... + def __eq__(self, other) -> bool: ... + def __ne__(self, other) -> bool: ... def __int__(self) -> int: ... def __len__(self) -> int: ... def __getitem__(self, index): ... def __setitem__(self, index, *args) -> None: ... - def __LazyMap__(self, attr): ... + def __LazyMap__(self, attr) -> Literal[0, 1] | None: ... def __AttrToID__(self, attr): ... ob: Incomplete # CDispatch objects are dynamically generated and too complex to type diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/gencache.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/gencache.pyi index 825af08d8701..e12756df8887 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/gencache.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/client/gencache.pyi @@ -1,5 +1,63 @@ +from _typeshed import Incomplete, Unused +from collections.abc import Generator +from contextlib import contextmanager +from types import ModuleType +from typing import Literal, NoReturn + +from win32.lib.pywintypes import IIDType from win32com.client import dynamic +bForDemandDefault: int +clsidToTypelib: dict[str, tuple[str, int, int, int]] +versionRedirectMap: dict[tuple[str, int, int, int], ModuleType | None] +is_readonly: bool +is_zip: bool +demandGeneratedTypeLibraries: dict[tuple[str, int, int, int], Incomplete] + +def __init__() -> None: ... + +pickleVersion: int + +@contextmanager +def ModuleMutex(module_name: str) -> Generator[None]: ... +def GetGeneratedFileName(clsid, lcid, major, minor) -> str: ... +def SplitGeneratedFileName(fname: str) -> tuple[str, ...]: ... +def GetGeneratePath() -> str: ... +def GetClassForProgID(progid: str) -> type | None: ... +def GetClassForCLSID(clsid) -> type | None: ... +def GetModuleForProgID(progid: str) -> ModuleType | None: ... +def GetModuleForCLSID(clsid) -> ModuleType | None: ... +def GetModuleForTypelib(typelibCLSID, lcid, major, minor) -> ModuleType: ... +def MakeModuleForTypelib( + typelibCLSID, + lcid, + major, + minor, + progressInstance=None, + bForDemand: bool | Literal[0, 1] = ..., + bBuildHidden: bool | Literal[0, 1] = 1, +) -> ModuleType: ... +def MakeModuleForTypelibInterface( + typelib_ob, progressInstance=None, bForDemand: bool | Literal[0, 1] = ..., bBuildHidden: bool | Literal[0, 1] = 1 +) -> ModuleType | None: ... +def EnsureModuleForTypelibInterface( + typelib_ob, progressInstance=None, bForDemand: bool | Literal[0, 1] = ..., bBuildHidden: bool | Literal[0, 1] = 1 +) -> ModuleType | None: ... +def ForgetAboutTypelibInterface(typelib_ob) -> None: ... +def EnsureModule( + typelibCLSID, + lcid, + major, + minor, + progressInstance=None, + bValidateFile: bool | Literal[0, 1] = ..., + bForDemand: bool | Literal[0, 1] = ..., + bBuildHidden: bool | Literal[0, 1] = 1, +) -> ModuleType | None: ... def EnsureDispatch( - prog_id: str | dynamic.PyIDispatchType | dynamic._GoodDispatchTypes | dynamic.PyIUnknownType, bForDemand: int = ... + prog_id: str | dynamic.PyIDispatchType | IIDType | dynamic.PyIUnknownType, bForDemand: bool | Literal[0, 1] = 1 ) -> dynamic.CDispatch: ... +def AddModuleToCache(typelibclsid, lcid, major, minor, verbose: Unused = 1, bFlushNow: bool | Literal[0, 1] = ...) -> None: ... +def GetGeneratedInfos() -> list[tuple[Incomplete, Incomplete, Incomplete, Incomplete]]: ... +def Rebuild(verbose: bool | Literal[0, 1] = 1) -> None: ... +def usage() -> NoReturn: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/olectl.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/olectl.pyi index 33c11076d847..bfd6283a5497 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/olectl.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/olectl.pyi @@ -1,54 +1,56 @@ -FACILITY_CONTROL: int +from typing import Final + +FACILITY_CONTROL: Final = 0xA def MAKE_SCODE(sev: int, fac: int, code: int) -> int: ... def STD_CTL_SCODE(n: int) -> int: ... -CTL_E_ILLEGALFUNCTIONCALL: int -CTL_E_OVERFLOW: int -CTL_E_OUTOFMEMORY: int -CTL_E_DIVISIONBYZERO: int -CTL_E_OUTOFSTRINGSPACE: int -CTL_E_OUTOFSTACKSPACE: int -CTL_E_BADFILENAMEORNUMBER: int -CTL_E_FILENOTFOUND: int -CTL_E_BADFILEMODE: int -CTL_E_FILEALREADYOPEN: int -CTL_E_DEVICEIOERROR: int -CTL_E_FILEALREADYEXISTS: int -CTL_E_BADRECORDLENGTH: int -CTL_E_DISKFULL: int -CTL_E_BADRECORDNUMBER: int -CTL_E_BADFILENAME: int -CTL_E_TOOMANYFILES: int -CTL_E_DEVICEUNAVAILABLE: int -CTL_E_PERMISSIONDENIED: int -CTL_E_DISKNOTREADY: int -CTL_E_PATHFILEACCESSERROR: int -CTL_E_PATHNOTFOUND: int -CTL_E_INVALIDPATTERNSTRING: int -CTL_E_INVALIDUSEOFNULL: int -CTL_E_INVALIDFILEFORMAT: int -CTL_E_INVALIDPROPERTYVALUE: int -CTL_E_INVALIDPROPERTYARRAYINDEX: int -CTL_E_SETNOTSUPPORTEDATRUNTIME: int -CTL_E_SETNOTSUPPORTED: int -CTL_E_NEEDPROPERTYARRAYINDEX: int -CTL_E_SETNOTPERMITTED: int -CTL_E_GETNOTSUPPORTEDATRUNTIME: int -CTL_E_GETNOTSUPPORTED: int -CTL_E_PROPERTYNOTFOUND: int -CTL_E_INVALIDCLIPBOARDFORMAT: int -CTL_E_INVALIDPICTURE: int -CTL_E_PRINTERERROR: int -CTL_E_CANTSAVEFILETOTEMP: int -CTL_E_SEARCHTEXTNOTFOUND: int -CTL_E_REPLACEMENTSTOOLONG: int -CONNECT_E_FIRST: int -CONNECT_E_LAST: int -CONNECT_S_FIRST: int -CONNECT_S_LAST: int -CONNECT_E_NOCONNECTION: int -CONNECT_E_ADVISELIMIT: int -CONNECT_E_CANNOTCONNECT: int -CONNECT_E_OVERRIDDEN: int -CLASS_E_NOTLICENSED: int +CTL_E_ILLEGALFUNCTIONCALL: Final = -2146828283 +CTL_E_OVERFLOW: Final = -2146828282 +CTL_E_OUTOFMEMORY: Final = -2146828281 +CTL_E_DIVISIONBYZERO: Final = -2146828277 +CTL_E_OUTOFSTRINGSPACE: Final = -2146828274 +CTL_E_OUTOFSTACKSPACE: Final = -2146828260 +CTL_E_BADFILENAMEORNUMBER: Final = -2146828236 +CTL_E_FILENOTFOUND: Final = -2146828235 +CTL_E_BADFILEMODE: Final = -2146828234 +CTL_E_FILEALREADYOPEN: Final = -2146828233 +CTL_E_DEVICEIOERROR: Final = -2146828231 +CTL_E_FILEALREADYEXISTS: Final = -2146828230 +CTL_E_BADRECORDLENGTH: Final = -2146828229 +CTL_E_DISKFULL: Final = -2146828227 +CTL_E_BADRECORDNUMBER: Final = -2146828225 +CTL_E_BADFILENAME: Final = -2146828224 +CTL_E_TOOMANYFILES: Final = -2146828221 +CTL_E_DEVICEUNAVAILABLE: Final = -2146828220 +CTL_E_PERMISSIONDENIED: Final = -2146828218 +CTL_E_DISKNOTREADY: Final = -2146828217 +CTL_E_PATHFILEACCESSERROR: Final = -2146828213 +CTL_E_PATHNOTFOUND: Final = -2146828212 +CTL_E_INVALIDPATTERNSTRING: Final = -2146828195 +CTL_E_INVALIDUSEOFNULL: Final = -2146828194 +CTL_E_INVALIDFILEFORMAT: Final = -2146827967 +CTL_E_INVALIDPROPERTYVALUE: Final = -2146827908 +CTL_E_INVALIDPROPERTYARRAYINDEX: Final = -2146827907 +CTL_E_SETNOTSUPPORTEDATRUNTIME: Final = -2146827906 +CTL_E_SETNOTSUPPORTED: Final = -2146827905 +CTL_E_NEEDPROPERTYARRAYINDEX: Final = -2146827903 +CTL_E_SETNOTPERMITTED: Final = -2146827901 +CTL_E_GETNOTSUPPORTEDATRUNTIME: Final = -2146827895 +CTL_E_GETNOTSUPPORTED: Final = -2146827894 +CTL_E_PROPERTYNOTFOUND: Final = -2146827866 +CTL_E_INVALIDCLIPBOARDFORMAT: Final = -2146827828 +CTL_E_INVALIDPICTURE: Final = -2146827807 +CTL_E_PRINTERERROR: Final = -2146827806 +CTL_E_CANTSAVEFILETOTEMP: Final = -2146827553 +CTL_E_SEARCHTEXTNOTFOUND: Final = -2146827544 +CTL_E_REPLACEMENTSTOOLONG: Final = -2146827542 +CONNECT_E_FIRST: Final = -2147220992 +CONNECT_E_LAST: Final = -2147220977 +CONNECT_S_FIRST: Final = 262656 +CONNECT_S_LAST: Final = 262671 +CONNECT_E_NOCONNECTION: Final = -2147220992 +CONNECT_E_ADVISELIMIT: Final = -2147220991 +CONNECT_E_CANNOTCONNECT: Final = -2147220990 +CONNECT_E_OVERRIDDEN: Final = -2147220989 +CLASS_E_NOTLICENSED: Final = -2147221230 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/connect.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/connect.pyi index 4c8a1878546e..d4f5e9994d9f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/connect.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/connect.pyi @@ -1,15 +1,22 @@ from _typeshed import Incomplete +from typing import Final -IConnectionPointContainer_methods: Incomplete -IConnectionPoint_methods: Incomplete +IConnectionPointContainer_methods: Final = ["EnumConnectionPoints", "FindConnectionPoint"] +IConnectionPoint_methods: Final = [ + "EnumConnections", + "Unadvise", + "Advise", + "GetConnectionPointContainer", + "GetConnectionInterface", +] class ConnectableServer: cookieNo: int - connections: Incomplete + connections: dict[int, Incomplete] def EnumConnections(self) -> None: ... def GetConnectionInterface(self) -> None: ... def GetConnectionPointContainer(self): ... - def Advise(self, pUnk): ... - def Unadvise(self, cookie) -> None: ... + def Advise(self, pUnk) -> int: ... + def Unadvise(self, cookie: int) -> None: ... def EnumConnectionPoints(self) -> None: ... - def FindConnectionPoint(self, iid): ... + def FindConnectionPoint(self, iid) -> Incomplete | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/exception.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/exception.pyi index 39e793a336ed..44427b52a099 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/exception.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/exception.pyi @@ -1,23 +1,21 @@ -from _typeshed import Incomplete - import pythoncom class COMException(pythoncom.com_error): - scode: Incomplete - description: Incomplete - source: Incomplete - helpfile: Incomplete - helpcontext: Incomplete + scode: int + description: str + source: str | None + helpfile: str | None + helpcontext: int | None def __init__( self, - description: Incomplete | None = ..., - scode: Incomplete | None = ..., - source: Incomplete | None = ..., - helpfile: Incomplete | None = ..., - helpContext: Incomplete | None = ..., - desc: Incomplete | None = ..., - hresult: Incomplete | None = ..., + description: str | None = None, + scode: int | None = None, + source: str | None = None, + helpfile: str | None = None, + helpContext: int | None = None, + desc: str | None = None, + hresult: int | None = None, ) -> None: ... -def IsCOMException(t: Incomplete | None = ...): ... -def IsCOMServerException(t: Incomplete | None = ...): ... +def IsCOMException(t: type[BaseException] | None = None) -> bool: ... +def IsCOMServerException(t: type[BaseException] | None = None) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/policy.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/policy.pyi index a6c079adc896..a14cfe8d8c03 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/policy.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/policy.pyi @@ -1,7 +1,11 @@ from _typeshed import Incomplete from abc import ABC, abstractmethod +from typing import Any, Final -S_OK: int +import _win32typing + +__author__: Final[str] +S_OK: Final = 0 IDispatchType: Incomplete IUnknownType: Incomplete regSpec: str @@ -9,7 +13,7 @@ regPolicy: str regDispatcher: str regAddnPath: str -def CreateInstance(clsid, reqIID): ... +def CreateInstance(clsid, reqIID: _win32typing.PyIID) -> _win32typing.PyIUnknown: ... class BasicWrapPolicy(ABC): def __init__(self, object) -> None: ... @@ -29,8 +33,11 @@ class DynamicPolicy(BasicWrapPolicy): DefaultPolicy = DesignatedWrapPolicy -def resolve_func(spec): ... -def call_func(spec, *args): ... +# Imports an arbitrary object by it's fully-qualified name. +def resolve_func(spec: str) -> Any: ... + +# Imports and calls an arbitrary callable by it's fully-qualified name. +def call_func(spec: str, *args: Any) -> Any: ... DISPATCH_METHOD: int DISPATCH_PROPERTYGET: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/util.pyi index eb1051f81dc7..fda3f8187ea8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/server/util.pyi @@ -1,39 +1,49 @@ from _typeshed import Incomplete +from collections.abc import Iterable +from typing import Literal import _win32typing -def wrap(ob, iid: Incomplete | None = ..., usePolicy: Incomplete | None = ..., useDispatcher: Incomplete | None = ...): ... +def wrap( + ob, iid=None, usePolicy: type[Incomplete] | None = None, useDispatcher: type[Incomplete] | bool | Literal[0, 1] | None = None +): ... def unwrap(ob): ... class ListEnumerator: - index: Incomplete - def __init__(self, data, index: int = ..., iid=...) -> None: ... - def Next(self, count): ... - def Skip(self, count) -> None: ... + index: int + def __init__(self, data, index: int = 0, iid=...) -> None: ... + def Next(self, count: int): ... + def Skip(self, count: int) -> None: ... def Reset(self) -> None: ... def Clone(self): ... class ListEnumeratorGateway(ListEnumerator): - def Next(self, count): ... + def Next(self, count: int) -> Iterable[Incomplete]: ... -def NewEnum(seq, cls=..., iid=..., usePolicy: Incomplete | None = ..., useDispatcher: Incomplete | None = ...): ... +def NewEnum( + seq, + cls=..., + iid=..., + usePolicy: type[Incomplete] | None = None, + useDispatcher: type[Incomplete] | bool | Literal[0, 1] | None = None, +): ... class Collection: data: Incomplete - def __init__(self, data: Incomplete | None = ..., readOnly: int = ...) -> None: ... + def __init__(self, data=None, readOnly: bool | Literal[0, 1] = 0) -> None: ... def Item(self, *args): ... def Count(self): ... def Add(self, value) -> None: ... def Remove(self, index) -> None: ... def Insert(self, index, value) -> None: ... -def NewCollection(seq, cls=...): ... +def NewCollection(seq, cls=...) -> _win32typing.PyIUnknown: ... class FileStream: file: Incomplete def __init__(self, file: _win32typing.Pymmapfile) -> None: ... def Read(self, amount): ... - def Write(self, data): ... + def Write(self, data) -> int: ... def Clone(self): ... - def CopyTo(self, dest, cb): ... + def CopyTo(self, dest, cb) -> tuple[int, int]: ... def Seek(self, offset: int, origin: int) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/storagecon.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/storagecon.pyi index 3242473ca1d3..717bba5ebcba 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/storagecon.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/storagecon.pyi @@ -1,113 +1,115 @@ -STGC_DEFAULT: int -STGC_OVERWRITE: int -STGC_ONLYIFCURRENT: int -STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE: int -STGC_CONSOLIDATE: int -STGTY_STORAGE: int -STGTY_STREAM: int -STGTY_LOCKBYTES: int -STGTY_PROPERTY: int -STREAM_SEEK_SET: int -STREAM_SEEK_CUR: int -STREAM_SEEK_END: int -LOCK_WRITE: int -LOCK_EXCLUSIVE: int -LOCK_ONLYONCE: int -CWCSTORAGENAME: int -STGM_DIRECT: int -STGM_TRANSACTED: int -STGM_SIMPLE: int -STGM_READ: int -STGM_WRITE: int -STGM_READWRITE: int -STGM_SHARE_DENY_NONE: int -STGM_SHARE_DENY_READ: int -STGM_SHARE_DENY_WRITE: int -STGM_SHARE_EXCLUSIVE: int -STGM_PRIORITY: int -STGM_DELETEONRELEASE: int -STGM_NOSCRATCH: int -STGM_CREATE: int -STGM_CONVERT: int -STGM_FAILIFTHERE: int -STGM_NOSNAPSHOT: int -ASYNC_MODE_COMPATIBILITY: int -ASYNC_MODE_DEFAULT: int -STGTY_REPEAT: int -STG_TOEND: int -STG_LAYOUT_SEQUENTIAL: int -STG_LAYOUT_INTERLEAVED: int -COM_RIGHTS_EXECUTE: int -COM_RIGHTS_EXECUTE_LOCAL: int -COM_RIGHTS_EXECUTE_REMOTE: int -COM_RIGHTS_ACTIVATE_LOCAL: int -COM_RIGHTS_ACTIVATE_REMOTE: int -STGFMT_DOCUMENT: int -STGFMT_STORAGE: int -STGFMT_NATIVE: int -STGFMT_FILE: int -STGFMT_ANY: int -STGFMT_DOCFILE: int -PID_DICTIONARY: int -PID_CODEPAGE: int -PID_FIRST_USABLE: int -PID_FIRST_NAME_DEFAULT: int -PID_LOCALE: int -PID_MODIFY_TIME: int -PID_SECURITY: int -PID_BEHAVIOR: int -PID_ILLEGAL: int -PID_MIN_READONLY: int -PID_MAX_READONLY: int -PIDDI_THUMBNAIL: int -PIDSI_TITLE: int -PIDSI_SUBJECT: int -PIDSI_AUTHOR: int -PIDSI_KEYWORDS: int -PIDSI_COMMENTS: int -PIDSI_TEMPLATE: int -PIDSI_LASTAUTHOR: int -PIDSI_REVNUMBER: int -PIDSI_EDITTIME: int -PIDSI_LASTPRINTED: int -PIDSI_CREATE_DTM: int -PIDSI_LASTSAVE_DTM: int -PIDSI_PAGECOUNT: int -PIDSI_WORDCOUNT: int -PIDSI_CHARCOUNT: int -PIDSI_THUMBNAIL: int -PIDSI_APPNAME: int -PIDSI_DOC_SECURITY: int -PIDDSI_CATEGORY: int -PIDDSI_PRESFORMAT: int -PIDDSI_BYTECOUNT: int -PIDDSI_LINECOUNT: int -PIDDSI_PARCOUNT: int -PIDDSI_SLIDECOUNT: int -PIDDSI_NOTECOUNT: int -PIDDSI_HIDDENCOUNT: int -PIDDSI_MMCLIPCOUNT: int -PIDDSI_SCALE: int -PIDDSI_HEADINGPAIR: int -PIDDSI_DOCPARTS: int -PIDDSI_MANAGER: int -PIDDSI_COMPANY: int -PIDDSI_LINKSDIRTY: int -PIDMSI_EDITOR: int -PIDMSI_SUPPLIER: int -PIDMSI_SOURCE: int -PIDMSI_SEQUENCE_NO: int -PIDMSI_PROJECT: int -PIDMSI_STATUS: int -PIDMSI_OWNER: int -PIDMSI_RATING: int -PIDMSI_PRODUCTION: int -PIDMSI_COPYRIGHT: int -PROPSETFLAG_DEFAULT: int -PROPSETFLAG_NONSIMPLE: int -PROPSETFLAG_ANSI: int -PROPSETFLAG_UNBUFFERED: int -PROPSETFLAG_CASE_SENSITIVE: int -STGMOVE_MOVE: int -STGMOVE_COPY: int -STGMOVE_SHALLOWCOPY: int +from typing import Final + +STGC_DEFAULT: Final = 0 +STGC_OVERWRITE: Final = 1 +STGC_ONLYIFCURRENT: Final = 2 +STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE: Final = 4 +STGC_CONSOLIDATE: Final = 8 +STGTY_STORAGE: Final = 1 +STGTY_STREAM: Final = 2 +STGTY_LOCKBYTES: Final = 3 +STGTY_PROPERTY: Final = 4 +STREAM_SEEK_SET: Final = 0 +STREAM_SEEK_CUR: Final = 1 +STREAM_SEEK_END: Final = 2 +LOCK_WRITE: Final = 1 +LOCK_EXCLUSIVE: Final = 2 +LOCK_ONLYONCE: Final = 4 +CWCSTORAGENAME: Final = 32 +STGM_DIRECT: Final = 0x00000000 +STGM_TRANSACTED: Final = 0x00010000 +STGM_SIMPLE: Final = 0x08000000 +STGM_READ: Final = 0x00000000 +STGM_WRITE: Final = 0x00000001 +STGM_READWRITE: Final = 0x00000002 +STGM_SHARE_DENY_NONE: Final = 0x00000040 +STGM_SHARE_DENY_READ: Final = 0x00000030 +STGM_SHARE_DENY_WRITE: Final = 0x00000020 +STGM_SHARE_EXCLUSIVE: Final = 0x00000010 +STGM_PRIORITY: Final = 0x00040000 +STGM_DELETEONRELEASE: Final = 0x04000000 +STGM_NOSCRATCH: Final = 0x00100000 +STGM_CREATE: Final = 0x00001000 +STGM_CONVERT: Final = 0x00020000 +STGM_FAILIFTHERE: Final = 0x00000000 +STGM_NOSNAPSHOT: Final = 0x00200000 +ASYNC_MODE_COMPATIBILITY: Final = 0x00000001 +ASYNC_MODE_DEFAULT: Final = 0x00000000 +STGTY_REPEAT: Final = 0x00000100 +STG_TOEND: Final = 0xFFFFFFFF +STG_LAYOUT_SEQUENTIAL: Final = 0x00000000 +STG_LAYOUT_INTERLEAVED: Final = 0x00000001 +COM_RIGHTS_EXECUTE: Final = 1 +COM_RIGHTS_EXECUTE_LOCAL: Final = 2 +COM_RIGHTS_EXECUTE_REMOTE: Final = 4 +COM_RIGHTS_ACTIVATE_LOCAL: Final = 8 +COM_RIGHTS_ACTIVATE_REMOTE: Final = 16 +STGFMT_DOCUMENT: Final = 0 +STGFMT_STORAGE: Final = 0 +STGFMT_NATIVE: Final = 1 +STGFMT_FILE: Final = 3 +STGFMT_ANY: Final = 4 +STGFMT_DOCFILE: Final = 5 +PID_DICTIONARY: Final = 0 +PID_CODEPAGE: Final = 1 +PID_FIRST_USABLE: Final = 2 +PID_FIRST_NAME_DEFAULT: Final = 4095 +PID_LOCALE: Final = -2147483648 +PID_MODIFY_TIME: Final = -2147483647 +PID_SECURITY: Final = -2147483646 +PID_BEHAVIOR: Final = -2147483645 +PID_ILLEGAL: Final = -1 +PID_MIN_READONLY: Final = -2147483648 +PID_MAX_READONLY: Final = -1073741825 +PIDDI_THUMBNAIL: Final = 0x00000002 +PIDSI_TITLE: Final = 2 +PIDSI_SUBJECT: Final = 3 +PIDSI_AUTHOR: Final = 4 +PIDSI_KEYWORDS: Final = 5 +PIDSI_COMMENTS: Final = 6 +PIDSI_TEMPLATE: Final = 7 +PIDSI_LASTAUTHOR: Final = 8 +PIDSI_REVNUMBER: Final = 9 +PIDSI_EDITTIME: Final = 10 +PIDSI_LASTPRINTED: Final = 11 +PIDSI_CREATE_DTM: Final = 12 +PIDSI_LASTSAVE_DTM: Final = 13 +PIDSI_PAGECOUNT: Final = 14 +PIDSI_WORDCOUNT: Final = 15 +PIDSI_CHARCOUNT: Final = 16 +PIDSI_THUMBNAIL: Final = 17 +PIDSI_APPNAME: Final = 18 +PIDSI_DOC_SECURITY: Final = 19 +PIDDSI_CATEGORY: Final = 2 +PIDDSI_PRESFORMAT: Final = 3 +PIDDSI_BYTECOUNT: Final = 4 +PIDDSI_LINECOUNT: Final = 5 +PIDDSI_PARCOUNT: Final = 6 +PIDDSI_SLIDECOUNT: Final = 7 +PIDDSI_NOTECOUNT: Final = 8 +PIDDSI_HIDDENCOUNT: Final = 9 +PIDDSI_MMCLIPCOUNT: Final = 10 +PIDDSI_SCALE: Final = 11 +PIDDSI_HEADINGPAIR: Final = 12 +PIDDSI_DOCPARTS: Final = 13 +PIDDSI_MANAGER: Final = 14 +PIDDSI_COMPANY: Final = 15 +PIDDSI_LINKSDIRTY: Final = 16 +PIDMSI_EDITOR: Final = 2 +PIDMSI_SUPPLIER: Final = 3 +PIDMSI_SOURCE: Final = 4 +PIDMSI_SEQUENCE_NO: Final = 5 +PIDMSI_PROJECT: Final = 6 +PIDMSI_STATUS: Final = 7 +PIDMSI_OWNER: Final = 8 +PIDMSI_RATING: Final = 9 +PIDMSI_PRODUCTION: Final = 10 +PIDMSI_COPYRIGHT: Final = 11 +PROPSETFLAG_DEFAULT: Final = 0 +PROPSETFLAG_NONSIMPLE: Final = 1 +PROPSETFLAG_ANSI: Final = 2 +PROPSETFLAG_UNBUFFERED: Final = 4 +PROPSETFLAG_CASE_SENSITIVE: Final = 8 +STGMOVE_MOVE: Final = 0 +STGMOVE_COPY: Final = 1 +STGMOVE_SHALLOWCOPY: Final = 2 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/universal.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/universal.pyi index fe0e626fc0d3..2e8058f9bcb2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/universal.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/universal.pyi @@ -1,5 +1,6 @@ from _typeshed import Incomplete -from collections.abc import Callable +from collections.abc import Callable, Iterable +from typing import Literal, SupportsIndex from typing_extensions import TypeAlias import pythoncom @@ -12,25 +13,33 @@ _WriteFromOutTupleType: TypeAlias = Callable[ [tuple[Incomplete, ...] | None, tuple[Incomplete, ...] | None, int], Incomplete | None ] -def RegisterInterfaces(typelibGUID, lcid, major, minor, interface_names: Incomplete | None = ...): ... +def RegisterInterfaces( + typelibGUID, lcid, major, minor, interface_names: Iterable[str] | None = None +) -> list[tuple[Incomplete, Incomplete, Incomplete]]: ... class Arg: name: Incomplete + vt: Incomplete + inOut: Incomplete + default: Incomplete + clsid: Incomplete size: Incomplete offset: int - def __init__(self, arg_info, name: Incomplete | None = ...) -> None: ... + def __init__(self, arg_info, name=None) -> None: ... class Method: dispid: Incomplete invkind: Incomplete name: Incomplete - args: Incomplete + args: list[Arg] cbArgs: Incomplete - def __init__(self, method_info, isEventSink: int = ...) -> None: ... + def __init__(self, method_info, isEventSink: bool | Literal[0, 1] = 0) -> None: ... class Definition: def __init__(self, iid, is_dispatch, method_defs) -> None: ... def iid(self): ... - def vtbl_argsizes(self): ... - def vtbl_argcounts(self): ... - def dispatch(self, ob, index, argPtr, ReadFromInTuple=..., WriteFromOutTuple: _WriteFromOutTupleType = ...): ... + def vtbl_argsizes(self) -> list[Incomplete]: ... + def vtbl_argcounts(self) -> list[int]: ... + def dispatch( + self, ob, index: SupportsIndex, argPtr, ReadFromInTuple=..., WriteFromOutTuple: _WriteFromOutTupleType = ... + ): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/util.pyi index 6c896a88618f..4b23324c4289 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32com/util.pyi @@ -1 +1 @@ -def IIDToInterfaceName(iid): ... +def IIDToInterfaceName(iid) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/adsi/adsi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/adsi/adsi.pyi index b5acc70cb365..2647f217cf2b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/adsi/adsi.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/adsi/adsi.pyi @@ -11,7 +11,7 @@ def ADsGetObject(path, iid: _win32typing.PyIID, /): ... def ADsBuildEnumerator(container: _win32typing.PyIADsContainer, /): ... def ADsEnumerateNext(enum, num: int = ..., /): ... def ADsGetLastError() -> tuple[Incomplete, Incomplete, Incomplete]: ... -def StringAsDS_SELECTION_LIST(*args): ... # incomplete +def StringAsDS_SELECTION_LIST(buf, /): ... DSOP_SCOPE_INIT_INFOs = _win32typing.PyDSOP_SCOPE_INIT_INFOs CLSID_ADsDSOObject: _win32typing.PyIID diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/axdebug.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/axdebug.pyi index 93651135c1bf..d4862d071ef4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/axdebug.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/axdebug.pyi @@ -2,9 +2,9 @@ # "ImportError: DLL load failed while importing axdebug: The specified module could not be found." import _win32typing -def GetStackAddress(*args): ... # incomplete -def GetThreadStateHandle(*args): ... # incomplete -def SetThreadStateTrace(*args): ... # incomplete +def GetStackAddress() -> int: ... +def GetThreadStateHandle() -> int: ... +def SetThreadStateTrace(handle: int, func, /) -> None: ... APPBREAKFLAG_DEBUGGER_BLOCK: int APPBREAKFLAG_DEBUGGER_HALT: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/ifilter/ifilter.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/ifilter/ifilter.pyi index 0a7738c2b68b..f1c1e76b6bd6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/ifilter/ifilter.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/ifilter/ifilter.pyi @@ -1,8 +1,8 @@ import _win32typing -def BindIFilterFromStorage(*args): ... # incomplete -def BindIFilterFromStream(*args): ... # incomplete -def LoadIFilter(*args): ... # incomplete +def BindIFilterFromStorage(stg, /): ... +def BindIFilterFromStream(stg, /): ... +def LoadIFilter(path: str, /): ... CHUNK_EOC: int CHUNK_EOP: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/mapi.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/mapi.pyi index f0f98a3a1d70..f6895c629079 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/mapi.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/mapi/mapi.pyi @@ -38,7 +38,7 @@ def HrSetOneProp(prop: _win32typing.PyIMAPIProp, propValue: _win32typing.PySProp def HrAllocAdviseSink(callback, context, /): ... def HrThisThreadAdviseSink(_object, /): ... def HrDispatchNotifications(*args): ... # incomplete -def MAPIUIDFromBinary(*args): ... # incomplete +def MAPIUIDFromBinary(sz: str | None, /): ... AB_NO_DIALOG: int ATTACH_BY_REF_ONLY: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/shell/shell.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/shell/shell.pyi index 8b63eda438ff..6949458603f9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/shell/shell.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/shell/shell.pyi @@ -103,12 +103,12 @@ def SHCreateStreamOnFileEx( def SetCurrentProcessExplicitAppUserModelID(AppID: str, /) -> None: ... def GetCurrentProcessExplicitAppUserModelID() -> str: ... def SHParseDisplayName(Name, Attributes, BindCtx: _win32typing.PyIBindCtx | None = ...) -> tuple[list[bytes], int]: ... -def SHCreateItemFromIDList(*args): ... # incomplete -def SHCreateShellItemArrayFromIDLists(*args): ... # incomplete -def SHGetIDListFromObject(*args): ... # incomplete -def SHGetNameFromIDList(*args): ... # incomplete -def SHGetPathFromIDList(*args): ... # incomplete -def SHGetPathFromIDListW(*args): ... # incomplete +def SHCreateItemFromIDList(pidl, riid=..., /): ... +def SHCreateShellItemArrayFromIDLists(pidls, /): ... +def SHGetIDListFromObject(unk, /): ... +def SHGetNameFromIDList(pidl, flags: int, /): ... +def SHGetPathFromIDList(pidl, /): ... +def SHGetPathFromIDListW(Pidl, /): ... BHID_AssociationArray: _win32typing.PyIID BHID_DataObject: _win32typing.PyIID @@ -435,4 +435,4 @@ VID_ThumbStrip: _win32typing.PyIID VID_Thumbnails: _win32typing.PyIID VID_Tile: _win32typing.PyIID -def SHGetKnownFolderPath(*args): ... # incomplete +def SHGetKnownFolderPath(fid, flags: int = 0, token=None, /): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyxdg/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyxdg/METADATA.toml index 6b436499ffd3..a0370c6a8b74 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyxdg/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyxdg/METADATA.toml @@ -1,2 +1,2 @@ version = "0.28.*" -upstream_repository = "https://github.com/takluyver/pyxdg" +upstream-repository = "https://github.com/takluyver/pyxdg" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/qrbill/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/qrbill/METADATA.toml index 033646f39631..468d224cb47d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/qrbill/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/qrbill/METADATA.toml @@ -1,3 +1,3 @@ version = "1.2.*" -upstream_repository = "https://github.com/claudep/swiss-qr-bill" -requires = ["types-qrcode"] +upstream-repository = "https://github.com/claudep/swiss-qr-bill" +dependencies = ["types-qrcode"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/qrcode/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/qrcode/METADATA.toml index d08ef719fb7a..f329321ac1f0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/qrcode/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/qrcode/METADATA.toml @@ -1,7 +1,7 @@ version = "8.2.*" -upstream_repository = "https://github.com/lincolnloop/python-qrcode" +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/packages/pyright-internal/typeshed-fallback/stubs/qrcode/qrcode/_types.pyi b/packages/pyright-internal/typeshed-fallback/stubs/qrcode/qrcode/_types.pyi index 2fb145fc4fc0..8baf3f940f1d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/qrcode/qrcode/_types.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/qrcode/qrcode/_types.pyi @@ -1,6 +1,6 @@ # Type aliases used in this stub package from _typeshed import SupportsWrite -from typing import Any, Protocol +from typing import Any, Protocol, type_check_only from typing_extensions import TypeAlias Box: TypeAlias = tuple[tuple[int, int], tuple[int, int]] @@ -11,5 +11,6 @@ Ink: TypeAlias = tuple[int, int, int] | tuple[int, int, int, int] ErrorCorrect: TypeAlias = int MaskPattern: TypeAlias = int +@type_check_only class Writeable(SupportsWrite[bytes], Protocol): def seek(self, offset: int, /) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/qrcode/qrcode/image/pure.pyi b/packages/pyright-internal/typeshed-fallback/stubs/qrcode/qrcode/image/pure.pyi index ec5df707f02f..8aff0c2f8fc3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/qrcode/qrcode/image/pure.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/qrcode/qrcode/image/pure.pyi @@ -17,7 +17,7 @@ class PyPNGImage(base.BaseImage): def get_image(self, **kwargs: Any) -> _Writer: ... def drawrect(self, row: int, col: int) -> None: ... def save(self, stream: SupportsWrite[bytes], kind: str | None = None) -> None: ... - def rows_iter(self) -> Generator[list[int], Any, None]: ... - def border_rows_iter(self) -> Generator[list[int], Any, None]: ... + def rows_iter(self) -> Generator[list[int], Any]: ... + def border_rows_iter(self) -> Generator[list[int], Any]: ... PymagingImage = PyPNGImage diff --git a/packages/pyright-internal/typeshed-fallback/stubs/qrcode/qrcode/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/qrcode/qrcode/util.pyi index df4832c5d11d..5bd10d10d48e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/qrcode/qrcode/util.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/qrcode/qrcode/util.pyi @@ -40,7 +40,7 @@ def mode_sizes_for_version(version: int) -> dict[_MODE, int]: ... def length_in_bits(mode: _MODE, version: int) -> int: ... def check_version(version: int) -> None: ... def lost_point(modules: list[list[bool | None]]) -> int: ... -def optimal_data_chunks(data: str | bytes, minimum: int = 4) -> Generator[QRData, None, None]: ... +def optimal_data_chunks(data: str | bytes, minimum: int = 4) -> Generator[QRData]: ... def to_bytestring(data: str | bytes) -> bytes: ... def optimal_mode(data: bytes) -> _SupportedMode: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ratelimit/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/ratelimit/METADATA.toml index d7e6677bef62..dbdb547943c9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ratelimit/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/ratelimit/METADATA.toml @@ -1,2 +1,2 @@ version = "2.2.*" -upstream_repository = "https://github.com/tomasbasham/ratelimit" +upstream-repository = "https://github.com/tomasbasham/ratelimit" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/regex/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/regex/METADATA.toml index 23bbebcf7e34..c8fde20b0ff0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/regex/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/regex/METADATA.toml @@ -1,2 +1,2 @@ -version = "2026.2.28" -upstream_repository = "https://github.com/mrabarnett/mrab-regex" +version = "2026.4.4" +upstream-repository = "https://github.com/mrabarnett/mrab-regex" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/reportlab/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/reportlab/METADATA.toml index 33ce4a87e357..d2708fba9e5f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/reportlab/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/reportlab/METADATA.toml @@ -1,7 +1,7 @@ version = "4.4.10" # GitHub mirror of https://hg.reportlab.com/hg-public/reportlab/file -upstream_repository = "https://github.com/MrBitBucket/reportlab-mirror" +upstream-repository = "https://github.com/MrBitBucket/reportlab-mirror" [tool.stubtest] -apt_dependencies = ["libcairo2-dev"] +apt-dependencies = ["libcairo2-dev"] extras = ["pycairo"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/reportlab/reportlab/lib/rl_safe_eval.pyi b/packages/pyright-internal/typeshed-fallback/stubs/reportlab/reportlab/lib/rl_safe_eval.pyi index 8ba0650d1fec..be8a719e2661 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/reportlab/reportlab/lib/rl_safe_eval.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/reportlab/reportlab/lib/rl_safe_eval.pyi @@ -197,7 +197,7 @@ class __RL_SAFE_ENV__: def __rl_range__(self, start, *args): ... def __rl_set__(self, it): ... def __rl_frozenset__(self, it=()): ... - def __rl_iter_unpack_sequence__(self, it, spec, _getiter_) -> Generator[Incomplete, None, None]: ... + def __rl_iter_unpack_sequence__(self, it, spec, _getiter_) -> Generator[Incomplete]: ... def __rl_unpack_sequence__(self, it, spec, _getiter_): ... def __rl_is_allowed_name__(self, name, crash: bool = True) -> bool: ... def __rl_getattr__(self, obj, a, *args): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/reportlab/reportlab/lib/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/reportlab/reportlab/lib/utils.pyi index 578ab1fc0e98..9a2371b931e5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/reportlab/reportlab/lib/utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/reportlab/reportlab/lib/utils.pyi @@ -66,7 +66,7 @@ def zipImported(ldr: zipimport.zipimporter | None = None) -> zipimport.zipimport class CIDict(dict[_KT, _VT]): def __init__(self, *args, **kwds) -> None: ... - def update(self, D: SupportsItems[_KT, _VT]) -> None: ... # type:ignore[override] + def update(self, D: SupportsItems[_KT, _VT]) -> None: ... # type: ignore[override] def markfilename(filename, creatorcode=None, filetype=None): ... @@ -198,7 +198,7 @@ class TimeStamp: def recursiveGetAttr(obj, name, g=None): ... def recursiveSetAttr(obj, name, value) -> None: ... def recursiveDelAttr(obj, name) -> None: ... -def yieldNoneSplits(L) -> Generator[Incomplete, None, None]: ... +def yieldNoneSplits(L) -> Generator[Incomplete]: ... class KlassStore: lim: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests-oauthlib/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/requests-oauthlib/METADATA.toml index 0696b26cb3d9..7f8247a2e87e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests-oauthlib/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/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"] +upstream-repository = "https://github.com/requests/requests-oauthlib" +dependencies = ["types-oauthlib", "types-requests"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/requests/METADATA.toml index 7ad078ed6816..cc7fdb72b5d7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/METADATA.toml @@ -1,8 +1,8 @@ -version = "~=2.32.4" -upstream_repository = "https://github.com/psf/requests" +version = "~=2.33.0" +upstream-repository = "https://github.com/psf/requests" # requires a version of urllib3 with a py.typed file -requires = ["urllib3>=2"] -extra_description = """\ +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 \ that must also have `urllib3<2` installed into it, \ diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/compat.pyi b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/compat.pyi index 1d6af41632f9..f7b722222007 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/compat.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/compat.pyi @@ -1,5 +1,8 @@ from builtins import bytes as bytes, str as str from collections import OrderedDict as OrderedDict + +# If simplejson is installed, JSONDecodeError is actually imported from there. +from json import JSONDecodeError as JSONDecodeError from typing import Literal from typing_extensions import TypeAlias from urllib.parse import ( diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/exceptions.pyi index 24bfd700578c..c76e78d4f52c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/exceptions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/exceptions.pyi @@ -1,8 +1,8 @@ -from json import JSONDecodeError as CompatJSONDecodeError from typing import Any from urllib3.exceptions import HTTPError as BaseHTTPError +from .compat import JSONDecodeError as CompatJSONDecodeError from .models import Request, Response from .sessions import PreparedRequest diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/utils.pyi index 3edd7c1038a0..fe6982f30024 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/utils.pyi @@ -36,7 +36,7 @@ def add_dict_to_cookiejar(cj, cookie_dict): ... def get_encodings_from_content(content): ... def get_encoding_from_headers(headers: Mapping[str, str]) -> str | None: ... def stream_decode_response_unicode(iterator, r): ... -def iter_slices(string: str, slice_length: int | None) -> Generator[str, None, None]: ... +def iter_slices(string: str, slice_length: int | None) -> Generator[str]: ... def get_unicode_from_response(r): ... UNRESERVED_SET: frozenset[str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/resampy/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/resampy/METADATA.toml new file mode 100644 index 000000000000..ed770025c32d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/resampy/METADATA.toml @@ -0,0 +1,4 @@ +version = "0.4.*" +upstream-repository = "https://github.com/bmcfee/resampy" +# Requires a version of numpy with a `py.typed` file +dependencies = ["numpy>=1.20"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/resampy/resampy/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/resampy/resampy/__init__.pyi new file mode 100644 index 000000000000..92d287f8a8fb --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/resampy/resampy/__init__.pyi @@ -0,0 +1,2 @@ +from . import filters as filters +from .core import * diff --git a/packages/pyright-internal/typeshed-fallback/stubs/resampy/resampy/core.pyi b/packages/pyright-internal/typeshed-fallback/stubs/resampy/resampy/core.pyi new file mode 100644 index 000000000000..1960e0c6005d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/resampy/resampy/core.pyi @@ -0,0 +1,36 @@ +from collections.abc import Callable +from typing import Any +from typing_extensions import TypeAlias, TypeVar + +import numpy as np + +__all__ = ["resample", "resample_nu"] + +# np.floating[Any] because precision is not important +_FloatArray = TypeVar("_FloatArray", bound=np.ndarray[tuple[int, ...], np.dtype[np.floating[Any]]]) +_FilterType: TypeAlias = str | Callable[[int], np.ndarray[tuple[int], np.dtype[np.float64]]] + +def resample( + x: _FloatArray, + sr_orig: float, + sr_new: float, + axis: int = -1, + filter: _FilterType = "kaiser_best", + parallel: bool = False, + *, + num_zeros: int = 64, + precision: int = 9, + rolloff: float = 0.945, +) -> _FloatArray: ... +def resample_nu( + x: _FloatArray, + sr_orig: float, + t_out: _FloatArray, + axis: int = -1, + filter: _FilterType = "kaiser_best", + parallel: bool = False, + *, + num_zeros: int = 64, + precision: int = 9, + rolloff: float = 0.945, +) -> _FloatArray: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/resampy/resampy/filters.pyi b/packages/pyright-internal/typeshed-fallback/stubs/resampy/resampy/filters.pyi new file mode 100644 index 000000000000..d46e5d0ce611 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/resampy/resampy/filters.pyi @@ -0,0 +1,26 @@ +from collections.abc import Callable +from typing_extensions import TypeAlias + +import numpy as np + +__all__ = ["get_filter", "clear_cache", "sinc_window"] + +# Dictionary to cache loaded filters +FILTER_CACHE: dict[str, tuple[np.ndarray[tuple[int], np.dtype[np.float64]], int, float]] + +# List of filter functions available +FILTER_FUNCTIONS: list[str] + +_FilterType: TypeAlias = str | Callable[[int], np.ndarray[tuple[int], np.dtype[np.float64]]] + +def sinc_window( + num_zeros: int = 64, + precision: int = 9, + window: Callable[[int], np.ndarray[tuple[int], np.dtype[np.float64]]] | None = None, + rolloff: float = 0.945, +) -> tuple[np.ndarray[tuple[int], np.dtype[np.float64]], int, float]: ... +def get_filter( + name_or_function: _FilterType, *, num_zeros: int = 64, precision: int = 9, rolloff: float = 0.945 +) -> tuple[np.ndarray[tuple[int], np.dtype[np.float64]], int, float]: ... +def load_filter(filter_name: str) -> tuple[np.ndarray[tuple[int], np.dtype[np.float64]], int, float]: ... +def clear_cache() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/resampy/resampy/version.pyi b/packages/pyright-internal/typeshed-fallback/stubs/resampy/resampy/version.pyi new file mode 100644 index 000000000000..24179934d795 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/resampy/resampy/version.pyi @@ -0,0 +1,4 @@ +from typing import Final + +short_version: Final[str] +version: Final[str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/retry/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/retry/METADATA.toml index a2623b57dbef..40237f386a7f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/retry/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/retry/METADATA.toml @@ -1,2 +1,2 @@ version = "0.9.*" -upstream_repository = "https://github.com/invl/retry" +upstream-repository = "https://github.com/invl/retry" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/rfc3339-validator/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/rfc3339-validator/METADATA.toml index f564e7971ec4..d2bb8f30a310 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/rfc3339-validator/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/rfc3339-validator/METADATA.toml @@ -1,2 +1,2 @@ version = "0.1.*" -upstream_repository = "https://github.com/naimetti/rfc3339-validator" +upstream-repository = "https://github.com/naimetti/rfc3339-validator" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/s2clientprotocol/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/s2clientprotocol/METADATA.toml index 6631acf0ad29..04ffb1ba31f9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/s2clientprotocol/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/s2clientprotocol/METADATA.toml @@ -2,6 +2,6 @@ # in scripts/sync_protobuf/s2clientprotocol.py and vice-versa. # When updating, also re-run the script version = "5.*" -upstream_repository = "https://github.com/Blizzard/s2client-proto" -requires = ["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)." +upstream-repository = "https://github.com/Blizzard/s2client-proto" +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/packages/pyright-internal/typeshed-fallback/stubs/seaborn/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/seaborn/METADATA.toml index 617bc4ef5ec8..58706ffb3aa3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/seaborn/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/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"] -upstream_repository = "https://github.com/mwaskom/seaborn" +dependencies = ["matplotlib>=3.8", "numpy>=1.20", "pandas-stubs"] +upstream-repository = "https://github.com/mwaskom/seaborn" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/seaborn/seaborn/axisgrid.pyi b/packages/pyright-internal/typeshed-fallback/stubs/seaborn/seaborn/axisgrid.pyi index 1f4072570aeb..18e8c320dc24 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/seaborn/seaborn/axisgrid.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/seaborn/seaborn/axisgrid.pyi @@ -236,7 +236,7 @@ class FacetGrid(Grid): subplot_kws: dict[str, Any] | None = None, gridspec_kws: dict[str, Any] | None = None, ) -> None: ... - def facet_data(self) -> Generator[tuple[tuple[int, int, int], DataFrame], None, None]: ... + def facet_data(self) -> Generator[tuple[tuple[int, int, int], DataFrame]]: ... def map(self, func: Callable[..., object], *args: str, **kwargs: Any) -> Self: ... def map_dataframe(self, func: Callable[..., object], *args: str, **kwargs: Any) -> Self: ... def facet_axis(self, row_i: int, col_j: int, modify_state: bool = True) -> Axes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/METADATA.toml index 1c1e95de18e3..94860d1f20bf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/METADATA.toml @@ -1,11 +1,11 @@ version = "82.0.*" -upstream_repository = "https://github.com/pypa/setuptools" -extra_description = """\ +upstream-repository = "https://github.com/pypa/setuptools" +extra-description = """\ Given that `pkg_resources` is typed since `setuptools >= 71.1`, \ 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"] +ci-platforms = ["linux", "win32"] +stubtest-dependencies = ["tomli"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/test.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/test.pyi index 8d7e6744c7fa..2f7b41e5d4d5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/test.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/test.pyi @@ -3,12 +3,10 @@ from typing_extensions import deprecated from .. import Command -@deprecated( - """\ +@deprecated("""\ The test command is disabled and references to it are deprecated. \ Please remove any references to `setuptools.command.test` in all supported versions of the affected package.\ -""" -) +""") class test(Command): description: ClassVar[str] user_options: ClassVar[list[tuple[str, str, str]]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/installer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/installer.pyi index b53a7f6fcc2e..8902dd66f711 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/installer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/installer.pyi @@ -2,13 +2,11 @@ from importlib import metadata from typing import Any from typing_extensions import deprecated -@deprecated( - """ +@deprecated(""" `setuptools.installer` and `fetch_build_eggs` are deprecated. Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`. - """ -) + """) def fetch_build_egg(dist, req) -> metadata.Distribution | metadata.PathDistribution: ... # Returns packaging.requirements.Requirement diff --git a/packages/pyright-internal/typeshed-fallback/stubs/shapely/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/shapely/METADATA.toml index 023f0b416b42..3d6e72d54ecf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/shapely/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/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"] -upstream_repository = "https://github.com/shapely/shapely" +dependencies = ["numpy>=1.20"] +upstream-repository = "https://github.com/shapely/shapely" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/simple-websocket/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/simple-websocket/METADATA.toml index 9b307e6bda7c..85219da88908 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/simple-websocket/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/simple-websocket/METADATA.toml @@ -1,3 +1,3 @@ version = "1.1.*" -upstream_repository = "https://github.com/miguelgrinberg/simple-websocket" -requires = ["wsproto"] +upstream-repository = "https://github.com/miguelgrinberg/simple-websocket" +dependencies = ["wsproto"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/simplejson/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/simplejson/METADATA.toml index dde6372bd8b3..63c9ff16b4b7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/simplejson/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/simplejson/METADATA.toml @@ -1,2 +1,2 @@ version = "3.20.*" -upstream_repository = "https://github.com/simplejson/simplejson" +upstream-repository = "https://github.com/simplejson/simplejson" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/singledispatch/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/singledispatch/METADATA.toml index 4c6341083d85..9bdcc7abbe8d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/singledispatch/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/singledispatch/METADATA.toml @@ -1,2 +1,2 @@ version = "4.1.*" -upstream_repository = "https://github.com/jaraco/singledispatch" +upstream-repository = "https://github.com/jaraco/singledispatch" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/six/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/six/METADATA.toml index 81454f85efcb..bf036333b2b7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/six/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/six/METADATA.toml @@ -1,2 +1,2 @@ version = "1.17.*" -upstream_repository = "https://github.com/benjaminp/six" +upstream-repository = "https://github.com/benjaminp/six" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/slumber/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/slumber/METADATA.toml index e408f238116c..917ca1eec715 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/slumber/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/slumber/METADATA.toml @@ -1,3 +1,3 @@ version = "0.7.*" -upstream_repository = "https://github.com/samgiles/slumber" -requires = ["types-requests"] +upstream-repository = "https://github.com/samgiles/slumber" +dependencies = ["types-requests"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/str2bool/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/str2bool/METADATA.toml index 9e1e7d9dc7d3..603a54f0026b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/str2bool/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/str2bool/METADATA.toml @@ -1,2 +1,2 @@ version = "1.1" -upstream_repository = "https://github.com/symonsoft/str2bool" +upstream-repository = "https://github.com/symonsoft/str2bool" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tabulate/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/tabulate/METADATA.toml index c90013533e7b..7deacccbf1f4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tabulate/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/tabulate/METADATA.toml @@ -1,2 +1,2 @@ -version = "0.9.*" -upstream_repository = "https://github.com/astanin/python-tabulate" +version = "0.10.*" +upstream-repository = "https://github.com/astanin/python-tabulate" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate/__init__.pyi index f258717ad56f..3c4aae67c2b5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate/__init__.pyi @@ -1,11 +1,10 @@ from collections.abc import Callable, Container, Iterable, Mapping, Sequence -from typing import Any, Final, NamedTuple +from typing import Any, Final, Literal, NamedTuple from typing_extensions import Self, TypeAlias -from .version import __version__ as __version__ - __all__ = ["tabulate", "tabulate_formats", "simple_separated_format"] +__version__: Final[str] # These constants are meant to be configurable # https://github.com/astanin/python-tabulate#text-formatting PRESERVE_WHITESPACE: bool @@ -55,10 +54,16 @@ def tabulate( missingval: str | Iterable[str] = "", showindex: str | bool | Iterable[Any] = "default", disable_numparse: bool | Iterable[int] = False, + colglobalalign: Literal["right", "center", "decimal", "left"] | None = None, colalign: Iterable[str | None] | None = None, + preserve_whitespace: bool = False, maxcolwidths: int | Iterable[int | None] | None = None, + headersglobalalign: Literal["right", "center", "left"] | None = None, + headersalign: Iterable[str | None] | None = None, rowalign: str | Iterable[str] | None = None, maxheadercolwidths: int | Iterable[int] | None = None, + break_long_words: bool = True, + break_on_hyphens: bool = True, ) -> str: ... class JupyterHTMLStr(str): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate/version.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate/version.pyi deleted file mode 100644 index 08615ffb79e6..000000000000 --- a/packages/pyright-internal/typeshed-fallback/stubs/tabulate/tabulate/version.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from typing import Final - -version: Final[str] -__version__: Final[str] -version_tuple: Final[tuple[int, int, int]] -__version_tuple__: Final[tuple[int, int, int]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tensorflow/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/tensorflow/METADATA.toml index a207ca05601a..33e3b3e45e24 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tensorflow/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/tensorflow/METADATA.toml @@ -1,16 +1,16 @@ # Using an exact number in the specifier for scripts/sync_protobuf/tensorflow.py # When updating, also re-run the script version = "~=2.18.0" -upstream_repository = "https://github.com/tensorflow/tensorflow" +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"] -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 +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 +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/packages/pyright-internal/typeshed-fallback/stubs/tensorflow/tensorflow/_aliases.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tensorflow/tensorflow/_aliases.pyi index 6bc6918a6b21..80e72ba87122 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tensorflow/tensorflow/_aliases.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tensorflow/tensorflow/_aliases.pyi @@ -2,7 +2,7 @@ # Everything in this module is private for stubs. There is no runtime equivalent. from collections.abc import Iterable, Mapping, Sequence -from typing import Any, Protocol, TypeVar +from typing import Any, Protocol, TypeVar, type_check_only from typing_extensions import TypeAlias import numpy as np @@ -20,9 +20,11 @@ RaggedTensorLike: TypeAlias = tf.Tensor | tf.RaggedTensor # _RaggedTensorLikeT = TypeVar("_RaggedTensorLikeT", tf.Tensor, tf.RaggedTensor) Gradients: TypeAlias = tf.Tensor | tf.IndexedSlices +@type_check_only class KerasSerializable1(Protocol): def get_config(self) -> dict[str, Any]: ... +@type_check_only class KerasSerializable2(Protocol): __name__: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tensorflow/tensorflow/config/experimental.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tensorflow/tensorflow/config/experimental.pyi index 1cb74feba722..aa9dcc53ed2e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tensorflow/tensorflow/config/experimental.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tensorflow/tensorflow/config/experimental.pyi @@ -1,8 +1,9 @@ import typing_extensions -from typing import TypedDict +from typing import TypedDict, type_check_only from tensorflow.config import PhysicalDevice +@type_check_only class _MemoryInfo(TypedDict): current: int peak: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/METADATA.toml new file mode 100644 index 000000000000..fe09240a6401 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/METADATA.toml @@ -0,0 +1,3 @@ +version = "1.5.1" +upstream-repository = "https://github.com/Kozea/tinycss2" +dependencies = ["types-webencodings"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/__init__.pyi new file mode 100644 index 000000000000..ea57523496f3 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/__init__.pyi @@ -0,0 +1,17 @@ +from typing import Final + +from .bytes import parse_stylesheet_bytes as parse_stylesheet_bytes +from .parser import ( + parse_blocks_contents as parse_blocks_contents, + parse_declaration_list as parse_declaration_list, + parse_one_component_value as parse_one_component_value, + parse_one_declaration as parse_one_declaration, + parse_one_rule as parse_one_rule, + parse_rule_list as parse_rule_list, + parse_stylesheet as parse_stylesheet, +) +from .serializer import serialize as serialize, serialize_identifier as serialize_identifier +from .tokenizer import parse_component_value_list as parse_component_value_list + +__version__: Final[str] +VERSION: Final[str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/ast.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/ast.pyi new file mode 100644 index 000000000000..3390a86fcb78 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/ast.pyi @@ -0,0 +1,160 @@ +from typing import Literal + +class Node: + source_line: int + source_column: int + type: str + + def __init__(self, source_line: int, source_column: int) -> None: ... + def serialize(self) -> str: ... + +class ParseError(Node): + type: Literal["error"] + kind: str + message: str + repr_format: str + def __init__(self, line: int, column: int, kind: str, message: str) -> None: ... + +class Comment(Node): + type: Literal["comment"] + value: str + repr_format: str + def __init__(self, line: int, column: int, value: str) -> None: ... + +class WhitespaceToken(Node): + type: Literal["whitespace"] + value: str + repr_format: str + def __init__(self, line: int, column: int, value: str) -> None: ... + +class LiteralToken(Node): + type: Literal["literal"] + value: str + repr_format: str + def __init__(self, line: int, column: int, value: str) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + +class IdentToken(Node): + type: Literal["ident"] + value: str + lower_value: str + repr_format: str + def __init__(self, line: int, column: int, value: str) -> None: ... + +class AtKeywordToken(Node): + type: Literal["at-keyword"] + value: str + lower_value: str + repr_format: str + def __init__(self, line: int, column: int, value: str) -> None: ... + +class HashToken(Node): + type: Literal["hash"] + value: str + is_identifier: bool + repr_format: str + def __init__(self, line: int, column: int, value: str, is_identifier: bool) -> None: ... + +class StringToken(Node): + type: Literal["string"] + value: str + representation: str + repr_format: str + def __init__(self, line: int, column: int, value: str, representation: str) -> None: ... + +class URLToken(Node): + type: Literal["url"] + value: str + representation: str + repr_format: str + def __init__(self, line: int, column: int, value: str, representation: str) -> None: ... + +class UnicodeRangeToken(Node): + type: Literal["unicode-range"] + start: int + end: int + repr_format: str + def __init__(self, line: int, column: int, start: int, end: int) -> None: ... + +class NumberToken(Node): + type: Literal["number"] + value: float + int_value: int | None + is_integer: bool + representation: str + repr_format: str + def __init__(self, line: int, column: int, value: float, int_value: int | None, representation: str) -> None: ... + +class PercentageToken(Node): + type: Literal["percentage"] + value: float + int_value: int | None + is_integer: bool + representation: str + repr_format: str + def __init__(self, line: int, column: int, value: float, int_value: int | None, representation: str) -> None: ... + +class DimensionToken(Node): + type: Literal["dimension"] + value: float + int_value: int | None + is_integer: bool + representation: str + unit: str + lower_unit: str + repr_format: str + def __init__(self, line: int, column: int, value: float, int_value: int | None, representation: str, unit: str) -> None: ... + +class ParenthesesBlock(Node): + type: Literal["() block"] + content: list[Node] + repr_format: str + def __init__(self, line: int, column: int, content: list[Node]) -> None: ... + +class SquareBracketsBlock(Node): + type: Literal["[] block"] + content: list[Node] + repr_format: str + def __init__(self, line: int, column: int, content: list[Node]) -> None: ... + +class CurlyBracketsBlock(Node): + type: Literal["{} block"] + content: list[Node] + repr_format: str + def __init__(self, line: int, column: int, content: list[Node]) -> None: ... + +class FunctionBlock(Node): + type: Literal["function"] + name: str + lower_name: str + arguments: list[Node] + repr_format: str + def __init__(self, line: int, column: int, name: str, arguments: list[Node]) -> None: ... + +class Declaration(Node): + type: Literal["declaration"] + name: str + lower_name: str + value: list[Node] + important: bool + repr_format: str + def __init__(self, line: int, column: int, name: str, lower_name: str, value: list[Node], important: bool) -> None: ... + +class QualifiedRule(Node): + type: Literal["qualified-rule"] + prelude: list[Node] + content: list[Node] + repr_format: str + def __init__(self, line: int, column: int, prelude: list[Node], content: list[Node]) -> None: ... + +class AtRule(Node): + type: Literal["at-rule"] + at_keyword: str + lower_at_keyword: str + prelude: list[Node] + content: list[Node] | None + repr_format: str + def __init__( + self, line: int, column: int, at_keyword: str, lower_at_keyword: str, prelude: list[Node], content: list[Node] | None + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/bytes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/bytes.pyi new file mode 100644 index 000000000000..24687b7f2711 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/bytes.pyi @@ -0,0 +1,14 @@ +from webencodings import Encoding + +from .ast import Node + +def decode_stylesheet_bytes( + css_bytes: bytes, protocol_encoding: str | None = None, environment_encoding: Encoding | None = None +) -> tuple[str, Encoding]: ... +def parse_stylesheet_bytes( + css_bytes: bytes, + protocol_encoding: str | None = None, + environment_encoding: Encoding | None = None, + skip_comments: bool = False, + skip_whitespace: bool = False, +) -> tuple[list[Node], Encoding]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/color3.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/color3.pyi new file mode 100644 index 000000000000..664acf304a11 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/color3.pyi @@ -0,0 +1,12 @@ +from collections.abc import Iterable +from typing import NamedTuple + +from .ast import Node + +class RGBA(NamedTuple): + red: float + green: float + blue: float + alpha: float + +def parse_color(input: str | Iterable[Node]) -> str | RGBA | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/color4.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/color4.pyi new file mode 100644 index 000000000000..d393e156e295 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/color4.pyi @@ -0,0 +1,19 @@ +from collections.abc import Iterable, Iterator +from typing import Literal + +from .ast import Node + +class Color: + COLOR_SPACES: set[str] | None + def __init__(self, space: str, coordinates: tuple[float | None, ...], alpha: float) -> None: ... + def __iter__(self) -> Iterator[float | None]: ... + def __getitem__(self, key: int) -> float: ... + def __hash__(self) -> int: ... + def __eq__(self, other: object) -> bool: ... + def to(self, space: str) -> Color: ... + +def parse_color(input: str | Iterable[Node]) -> Color | Literal["currentcolor"] | None: ... + +COLOR_SPACES: set[str] +D50: tuple[float, float, float] +D65: tuple[float, float, float] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/color5.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/color5.pyi new file mode 100644 index 000000000000..03246e07e6e9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/color5.pyi @@ -0,0 +1,17 @@ +from collections.abc import Iterable +from typing import Literal + +from . import color4 +from .ast import Node + +COLOR_SCHEMES: set[str] +COLOR_SPACES: set[str] +D50: tuple[float, float, float] +D65: tuple[float, float, float] + +class Color(color4.Color): + COLOR_SPACES: set[str] | None + +def parse_color( + input: str | Iterable[Node], color_schemes: Literal["normal"] | Iterable[str] | None = None +) -> color4.Color | Color | Literal["currentcolor"] | None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/nth.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/nth.pyi new file mode 100644 index 000000000000..6a0aa906cb70 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/nth.pyi @@ -0,0 +1,11 @@ +from collections.abc import Iterable +from re import Pattern + +from .ast import Node + +def parse_nth(input: str | Iterable[Node]) -> tuple[int, int] | None: ... +def parse_b(tokens: Iterable[Node], a: int) -> tuple[int, int] | None: ... +def parse_signless_b(tokens: Iterable[Node], a: int, b_sign: int) -> tuple[int, int] | None: ... +def parse_end(tokens: Iterable[Node], a: int, b: int) -> tuple[int, int] | None: ... + +N_DASH_DIGITS_RE: Pattern[str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/parser.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/parser.pyi new file mode 100644 index 000000000000..6b8ebae7dd64 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/parser.pyi @@ -0,0 +1,18 @@ +from collections.abc import Iterable +from typing import TypeAlias + +from .ast import AtRule, Comment, Declaration, Node, ParseError, QualifiedRule, WhitespaceToken + +_Rule: TypeAlias = QualifiedRule | AtRule | Comment | WhitespaceToken | ParseError + +def parse_one_component_value(input: str | Iterable[Node], skip_comments: bool = False) -> Node: ... +def parse_one_declaration(input: str | Iterable[Node], skip_comments: bool = False) -> Declaration | ParseError: ... +def parse_blocks_contents( + input: str | Iterable[Node], skip_comments: bool = False, skip_whitespace: bool = False +) -> list[Declaration | AtRule | QualifiedRule | Comment | WhitespaceToken | ParseError]: ... +def parse_declaration_list( + input: str | Iterable[Node], skip_comments: bool = False, skip_whitespace: bool = False +) -> list[Declaration | AtRule | Comment | WhitespaceToken | ParseError]: ... +def parse_one_rule(input: str | Iterable[Node], skip_comments: bool = False) -> QualifiedRule | AtRule | ParseError: ... +def parse_rule_list(input: str | Iterable[Node], skip_comments: bool = False, skip_whitespace: bool = False) -> list[_Rule]: ... +def parse_stylesheet(input: str | Iterable[Node], skip_comments: bool = False, skip_whitespace: bool = False) -> list[_Rule]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/serializer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/serializer.pyi new file mode 100644 index 000000000000..9ea5c7458855 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/serializer.pyi @@ -0,0 +1,11 @@ +from collections.abc import Iterable + +from .ast import Node + +def serialize(nodes: Iterable[Node]) -> str: ... +def serialize_identifier(value: str) -> str: ... +def serialize_name(value: str) -> str: ... +def serialize_string_value(value: str) -> str: ... +def serialize_url(value: str) -> str: ... + +BAD_PAIRS: set[tuple[str, str]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/tokenizer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/tokenizer.pyi new file mode 100644 index 000000000000..52e27c7480c6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/tinycss2/tinycss2/tokenizer.pyi @@ -0,0 +1,3 @@ +from .ast import Node + +def parse_component_value_list(css: str, skip_comments: bool = False) -> list[Node]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/toml/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/toml/METADATA.toml index 13a5562b3436..b0b71a816498 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/toml/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/toml/METADATA.toml @@ -1,2 +1,2 @@ version = "0.10.*" -upstream_repository = "https://github.com/uiri/toml" +upstream-repository = "https://github.com/uiri/toml" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/toposort/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/toposort/METADATA.toml index 598e8d0d5ae0..c987c6bbe14c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/toposort/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/toposort/METADATA.toml @@ -1,2 +1,2 @@ version = "1.10" -upstream_repository = "https://gitlab.com/ericvsmith/toposort" +upstream-repository = "https://gitlab.com/ericvsmith/toposort" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/METADATA.toml index 0c79774d89eb..3f13151c720f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/METADATA.toml @@ -1,10 +1,10 @@ version = "4.67.3" -upstream_repository = "https://github.com/tqdm/tqdm" -requires = ["types-requests"] +upstream-repository = "https://github.com/tqdm/tqdm" +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/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/__init__.pyi index 7023bed256ab..f190309890d9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/__init__.pyi @@ -11,5 +11,5 @@ class DummyTqdmFile(ObjectWrapper): def __del__(self) -> None: ... def tenumerate(iterable, start: int = 0, total=None, tqdm_class: type[Incomplete] = ..., **tqdm_kwargs): ... -def tzip(iter1, *iter2plus, **tqdm_kwargs) -> Generator[Incomplete, None, None]: ... -def tmap(function: Callable[..., Incomplete], *sequences, **tqdm_kwargs) -> Generator[Incomplete, None, None]: ... +def tzip(iter1, *iter2plus, **tqdm_kwargs) -> Generator[Incomplete]: ... +def tmap(function: Callable[..., Incomplete], *sequences, **tqdm_kwargs) -> Generator[Incomplete]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/itertools.pyi b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/itertools.pyi index 991181ffa8f9..f2f9943b0df8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/itertools.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/tqdm/tqdm/contrib/itertools.pyi @@ -3,4 +3,4 @@ from collections.abc import Generator, Iterable __all__ = ["product"] -def product(*iterables: Iterable[Incomplete], **tqdm_kwargs) -> Generator[Incomplete, None, None]: ... +def product(*iterables: Iterable[Incomplete], **tqdm_kwargs) -> Generator[Incomplete]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/translationstring/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/translationstring/METADATA.toml index 3c910d4fd43f..cfb8d9086587 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/translationstring/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/translationstring/METADATA.toml @@ -1,2 +1,2 @@ version = "1.4.*" -upstream_repository = "https://github.com/Pylons/translationstring" +upstream-repository = "https://github.com/Pylons/translationstring" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/ttkthemes/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/ttkthemes/METADATA.toml index de555ee078b4..5067b9d903ae 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/ttkthemes/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/ttkthemes/METADATA.toml @@ -1,2 +1,2 @@ version = "3.3.*" -upstream_repository = "https://github.com/TkinterEP/ttkthemes" +upstream-repository = "https://github.com/TkinterEP/ttkthemes" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/tzdata/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/tzdata/METADATA.toml index 5ae141af9f30..58f61b4c7dea 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/tzdata/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/tzdata/METADATA.toml @@ -1,2 +1,2 @@ -version = "2025.*" -upstream_repository = "https://github.com/python/tzdata" +version = "2026.*" +upstream-repository = "https://github.com/python/tzdata" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/uWSGI/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/uWSGI/METADATA.toml index 9324d956c585..143e5d9969d4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/uWSGI/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/uWSGI/METADATA.toml @@ -1,6 +1,6 @@ version = "2.0.*" -upstream_repository = "https://github.com/unbit/uwsgi" -extra_description = """\ +upstream-repository = "https://github.com/unbit/uwsgi" +extra-description = """\ Type hints for uWSGI's \ [Python API](https://uwsgi-docs.readthedocs.io/en/latest/PythonModule.html). \ Note that this API is available only when running Python code inside a uWSGI process \ @@ -12,4 +12,4 @@ extra_description = """\ # Run stubtest on MacOS as well, to check that the # uWSGI-specific parts of stubtest_third_party.py # also work there -ci_platforms = ["linux", "darwin"] +ci-platforms = ["linux", "darwin"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/uWSGI/uwsgidecorators.pyi b/packages/pyright-internal/typeshed-fallback/stubs/uWSGI/uwsgidecorators.pyi index 34186a62d919..d09dad66c820 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/uWSGI/uwsgidecorators.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/uWSGI/uwsgidecorators.pyi @@ -1,11 +1,12 @@ from collections.abc import Callable from typing import Any, Generic, Literal, TypeVar, overload -from typing_extensions import ParamSpec +from typing_extensions import ParamSpec, TypeVarTuple, Unpack from uwsgi import _RPCCallable _T = TypeVar("_T") _T2 = TypeVar("_T2") +_Ts = TypeVarTuple("_Ts") _SR = TypeVar("_SR", bound=Literal[0, -1, -2] | None) _SignalCallbackT = TypeVar("_SignalCallbackT", bound=Callable[[int], Any]) _RPCCallableT = TypeVar("_RPCCallableT", bound=_RPCCallable) @@ -166,13 +167,10 @@ class lock(Generic[_P, _T]): def __init__(self, f: Callable[_P, _T]) -> None: ... def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _T: ... -# FIXME: Technically this only allows positional arguments, but there is not really -# an adequate way yet to express this, once bound on ParamSpec does something -# we could probably enforce this -class thread(Generic[_P, _T]): - f: Callable[_P, _T] - def __init__(self, f: Callable[_P, _T]) -> None: ... - def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> Callable[_P, _T]: ... +class thread(Generic[Unpack[_Ts], _T]): + f: Callable[[Unpack[_Ts]], _T] + def __init__(self, f: Callable[[Unpack[_Ts]], _T]) -> None: ... + def __call__(self, *args: Unpack[_Ts]) -> Callable[[Unpack[_Ts]], _T]: ... class harakiri: s: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/unidiff/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/unidiff/METADATA.toml index 98f11c94dde3..972eb6704981 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/unidiff/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/unidiff/METADATA.toml @@ -1,2 +1,2 @@ version = "0.7.*" -upstream_repository = "https://github.com/matiasb/python-unidiff" +upstream-repository = "https://github.com/matiasb/python-unidiff" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/untangle/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/untangle/METADATA.toml index 7510b283e05d..5ce60ac0831b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/untangle/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/untangle/METADATA.toml @@ -1,2 +1,2 @@ version = "1.2.*" -upstream_repository = "https://github.com/stchris/untangle" +upstream-repository = "https://github.com/stchris/untangle" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/usersettings/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/usersettings/METADATA.toml index 2f8a7161b025..70ce550561af 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/usersettings/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/usersettings/METADATA.toml @@ -1,2 +1,2 @@ version = "1.1.*" -upstream_repository = "https://github.com/glvnst/usersettings" +upstream-repository = "https://github.com/glvnst/usersettings" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/vobject/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/vobject/METADATA.toml index aa38629db388..aeece27cafe4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/vobject/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/vobject/METADATA.toml @@ -1,2 +1,2 @@ version = "~=0.9.9" -upstream_repository = "https://github.com/py-vobject/vobject" +upstream-repository = "https://github.com/py-vobject/vobject" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/waitress/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/waitress/METADATA.toml index 9423798e9ae4..d3d07978021f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/waitress/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/waitress/METADATA.toml @@ -1,6 +1,6 @@ version = "~=3.0.1" -upstream_repository = "https://github.com/Pylons/waitress" +upstream-repository = "https://github.com/Pylons/waitress" [tool.stubtest] # linux and darwin are equivalent -ci_platforms = ["linux", "win32"] +ci-platforms = ["linux", "win32"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/rfc7230.pyi b/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/rfc7230.pyi index 1b02b6a4a3b4..d851821dc965 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/rfc7230.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/waitress/waitress/rfc7230.pyi @@ -1,7 +1,7 @@ from re import Pattern from typing import Final -BWS: Final = r"[ \t]{0,}?" +BWS: Final = "[ \t]{0,}?" CHUNK_EXT: Final[str] CHUNK_EXT_NAME: Final = r"[!#$%&'*+\-.^_`|~0-9A-Za-z]{1,}" CHUNK_EXT_RE: Final[Pattern[str]] @@ -15,14 +15,14 @@ HEXDIG: Final = r"[0-9a-fA-F]" OBS_TEXT: Final = r"\x80-\xff" ONLY_DIGIT_RE: Final[Pattern[str]] ONLY_HEXDIG_RE: Final[Pattern[str]] -OWS: Final = r"[ \t]{0,}?" -QDTEXT: Final = r"[\t !#-[\]-~\x80-\xff]" -QUOTED_PAIR: Final = r"\\([\t \x21-\x7e\x80-\xff])" +OWS: Final = "[ \t]{0,}?" +QDTEXT: Final = "[\t !#-[\\]-~\\x80-\\xff]" +QUOTED_PAIR: Final = "\\\\([\t \\x21-\\x7e\\x80-\\xff])" QUOTED_PAIR_RE: Final[Pattern[str]] QUOTED_STRING: Final[str] QUOTED_STRING_RE: Final[Pattern[str]] -RWS: Final = r"[ \t]{1,}?" +RWS: Final = "[ \t]{1,}?" TCHAR: Final = r"[!#$%&'*+\-.^_`|~0-9A-Za-z]" TOKEN: Final = r"[!#$%&'*+\-.^_`|~0-9A-Za-z]{1,}" VCHAR: Final = r"\x21-\x7e" -WS: Final = r"[ \t]" +WS: Final = "[ \t]" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/watchpoints/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/watchpoints/METADATA.toml index 0d08dbc0d9da..b0e6579c3ec2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/watchpoints/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/watchpoints/METADATA.toml @@ -1,2 +1,2 @@ version = "0.2.5" -upstream_repository = "https://github.com/gaogaotiantian/watchpoints" +upstream-repository = "https://github.com/gaogaotiantian/watchpoints" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/webencodings/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/webencodings/METADATA.toml index faf76668a57c..af406126c763 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/webencodings/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/webencodings/METADATA.toml @@ -1,2 +1,2 @@ version = "0.5.*" -upstream_repository = "https://github.com/gsnedders/python-webencodings" +upstream-repository = "https://github.com/gsnedders/python-webencodings" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/whatthepatch/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/whatthepatch/METADATA.toml index ff3378e56b04..709d41f7e8f7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/whatthepatch/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/whatthepatch/METADATA.toml @@ -1,2 +1,2 @@ version = "1.0.*" -upstream_repository = "https://github.com/cscorley/whatthepatch" +upstream-repository = "https://github.com/cscorley/whatthepatch" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/workalendar/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/workalendar/METADATA.toml index 0d4a5007a18c..cf5ba7a75cad 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/workalendar/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/workalendar/METADATA.toml @@ -1,2 +1,2 @@ version = "17.0.*" -upstream_repository = "https://github.com/workalendar/workalendar" +upstream-repository = "https://github.com/workalendar/workalendar" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/wurlitzer/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/wurlitzer/METADATA.toml index 90659aa7359b..5c5dec9f0006 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/wurlitzer/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/wurlitzer/METADATA.toml @@ -1,2 +1,2 @@ version = "3.1.*" -upstream_repository = "https://github.com/minrk/wurlitzer" +upstream-repository = "https://github.com/minrk/wurlitzer" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/www-authenticate/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/www-authenticate/METADATA.toml index 2e7e670d98b4..9acad68fd386 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/www-authenticate/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/www-authenticate/METADATA.toml @@ -1,2 +1,2 @@ version = "0.9.*" -upstream_repository = "https://github.com/alexdutton/www-authenticate" +upstream-repository = "https://github.com/alexdutton/www-authenticate" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/xdgenvpy/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/xdgenvpy/METADATA.toml index a2aa0bf1a91d..2553022b313e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/xdgenvpy/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/xdgenvpy/METADATA.toml @@ -1,2 +1,2 @@ version = "3.0.*" -upstream_repository = "https://gitlab.com/deliberist-group/xdgenvpy" +upstream-repository = "https://gitlab.com/deliberist-group/xdgenvpy" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/xlrd/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/xlrd/METADATA.toml index d82f4f2f46c6..c9f958c49828 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/xlrd/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/xlrd/METADATA.toml @@ -1,2 +1,2 @@ version = "2.0.*" -upstream_repository = "https://github.com/python-excel/xlrd" +upstream-repository = "https://github.com/python-excel/xlrd" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/xmldiff/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/xmldiff/METADATA.toml index 0d59b5fa34e8..b9262f38d947 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/xmldiff/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/xmldiff/METADATA.toml @@ -1,2 +1,2 @@ version = "2.7.*" -upstream_repository = "https://github.com/Shoobx/xmldiff" +upstream-repository = "https://github.com/Shoobx/xmldiff" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/xmltodict/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/xmltodict/METADATA.toml index 06d1474b7665..9a5679f06323 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/xmltodict/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/xmltodict/METADATA.toml @@ -1,2 +1,2 @@ version = "~= 1.0.1" -upstream_repository = "https://github.com/martinblech/xmltodict" +upstream-repository = "https://github.com/martinblech/xmltodict" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/yt-dlp/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/yt-dlp/METADATA.toml index e70c776ca3bd..8b49165a231f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/yt-dlp/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/yt-dlp/METADATA.toml @@ -1,3 +1,3 @@ -version = "2026.3.3" -upstream_repository = "https://github.com/yt-dlp/yt-dlp" -requires = ["websockets"] +version = "2026.3.17" +upstream-repository = "https://github.com/yt-dlp/yt-dlp" +dependencies = ["websockets"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/zstd/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/zstd/METADATA.toml index e94dd94536c6..fbc3a5a5f5c2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/zstd/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/zstd/METADATA.toml @@ -1,2 +1,2 @@ version = "~=1.5.7.3" -upstream_repository = "https://github.com/sergey-dryabzhinsky/python-zstd" +upstream-repository = "https://github.com/sergey-dryabzhinsky/python-zstd" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/zxcvbn/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/zxcvbn/METADATA.toml index 8ff1a4e9773c..2df5810cba47 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/zxcvbn/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/zxcvbn/METADATA.toml @@ -1,2 +1,2 @@ version = "4.5.*" -upstream_repository = "https://github.com/dwolfhub/zxcvbn-python" +upstream-repository = "https://github.com/dwolfhub/zxcvbn-python"