From 8a10d69df1b7eb9d0d9e1df47908eae8eda243a8 Mon Sep 17 00:00:00 2001 From: PyCharm Automation Bot Date: Mon, 24 Nov 2025 11:05:11 +0000 Subject: [PATCH] PY-85814 Update typeshed version to 8c7256c8fdcac67f08db1c22db0776fde6a25349 GitOrigin-RevId: e23250b130ea94d28deaebff9348372ff6cd8a00 --- .../typeshed/.github/workflows/tests.yml | 10 +- python/helpers/typeshed/pyproject.toml | 20 +- python/helpers/typeshed/pyrightconfig.json | 2 - .../pyrightconfig.scripts_and_tests.json | 1 - .../typeshed/pyrightconfig.stricter.json | 5 +- .../typeshed/pyrightconfig.testcases.json | 1 - .../helpers/typeshed/requirements-tests.txt | 4 +- python/helpers/typeshed/scripts/stubsabot.py | 8 +- .../@tests/stubtest_allowlists/common.txt | 5 +- .../@tests/stubtest_allowlists/darwin.txt | 11 +- .../stubtest_allowlists/linux-py310.txt | 8 + .../stubtest_allowlists/linux-py311.txt | 8 + .../stubtest_allowlists/linux-py312.txt | 8 + .../stubtest_allowlists/linux-py313.txt | 6 + .../stubtest_allowlists/linux-py314.txt | 6 + .../@tests/stubtest_allowlists/linux.txt | 3 - .../@tests/stubtest_allowlists/py314.txt | 3 + .../@tests/stubtest_allowlists/win32.txt | 8 + .../@tests/test_cases/builtins/check_type.py | 4 + .../@tests/test_cases/check_compression.py | 58 +++ .../stdlib/@tests/test_cases/check_types.py | 16 +- .../helpers/typeshed/stdlib/_compression.pyi | 15 +- .../typeshed/stdlib/asyncio/protocols.pyi | 4 +- .../typeshed/stdlib/asyncio/runners.pyi | 7 +- .../typeshed/stdlib/asyncio/trsock.pyi | 2 +- python/helpers/typeshed/stdlib/builtins.pyi | 23 +- python/helpers/typeshed/stdlib/calendar.pyi | 4 +- .../stdlib/compression/_common/_streams.pyi | 15 +- python/helpers/typeshed/stdlib/contextlib.pyi | 21 +- python/helpers/typeshed/stdlib/enum.pyi | 1 + .../helpers/typeshed/stdlib/html/parser.pyi | 3 +- .../helpers/typeshed/stdlib/http/client.pyi | 1 + python/helpers/typeshed/stdlib/imaplib.pyi | 1 + .../typeshed/stdlib/importlib/util.pyi | 16 +- python/helpers/typeshed/stdlib/ipaddress.pyi | 2 +- python/helpers/typeshed/stdlib/locale.pyi | 4 + .../helpers/typeshed/stdlib/os/__init__.pyi | 30 +- python/helpers/typeshed/stdlib/parser.pyi | 8 +- python/helpers/typeshed/stdlib/select.pyi | 12 +- python/helpers/typeshed/stdlib/ssl.pyi | 3 + python/helpers/typeshed/stdlib/stat.pyi | 109 ++++- python/helpers/typeshed/stdlib/subprocess.pyi | 1 - .../helpers/typeshed/stdlib/sys/__init__.pyi | 27 +- .../typeshed/stdlib/sys/_monitoring.pyi | 8 +- python/helpers/typeshed/stdlib/sysconfig.pyi | 8 +- python/helpers/typeshed/stdlib/threading.pyi | 9 +- .../typeshed/stdlib/tkinter/constants.pyi | 12 +- python/helpers/typeshed/stdlib/types.pyi | 4 +- python/helpers/typeshed/stdlib/typing.pyi | 16 +- .../helpers/typeshed/stdlib/unittest/util.pyi | 21 +- .../typeshed/stdlib/urllib/request.pyi | 7 + python/helpers/typeshed/stdlib/uuid.pyi | 11 +- python/helpers/typeshed/stdlib/winreg.pyi | 6 +- python/helpers/typeshed/stdlib/zlib.pyi | 4 +- .../typeshed/stubs/Deprecated/METADATA.toml | 2 +- .../stubs/Deprecated/deprecated/__init__.pyi | 11 +- .../stubs/Deprecated/deprecated/params.pyi | 20 + .../ExifRead/@tests/stubtest_allowlist.txt | 2 - .../typeshed/stubs/ExifRead/METADATA.toml | 3 - .../stubs/ExifRead/exifread/__init__.pyi | 17 - .../stubs/ExifRead/exifread/_types.pyi | 15 - .../stubs/ExifRead/exifread/classes.pyi | 47 --- .../stubs/ExifRead/exifread/exceptions.pyi | 2 - .../stubs/ExifRead/exifread/exif_log.pyi | 24 -- .../typeshed/stubs/ExifRead/exifread/heic.pyi | 56 --- .../typeshed/stubs/ExifRead/exifread/jpeg.pyi | 7 - .../stubs/ExifRead/exifread/tags/__init__.pyi | 15 - .../stubs/ExifRead/exifread/tags/exif.pyi | 7 - .../exifread/tags/makernote/apple.pyi | 3 - .../exifread/tags/makernote/canon.pyi | 26 -- .../exifread/tags/makernote/casio.pyi | 3 - .../exifread/tags/makernote/fujifilm.pyi | 3 - .../exifread/tags/makernote/nikon.pyi | 6 - .../exifread/tags/makernote/olympus.pyi | 6 - .../stubs/ExifRead/exifread/utils.pyi | 22 - .../typeshed/stubs/Markdown/METADATA.toml | 2 +- .../stubs/Markdown/markdown/htmlparser.pyi | 2 + .../stubs/Pygments/pygments/console.pyi | 8 +- .../stubs/Pygments/pygments/filter.pyi | 6 +- .../Pygments/pygments/filters/__init__.pyi | 28 +- .../stubs/Pygments/pygments/formatter.pyi | 19 +- .../Pygments/pygments/formatters/__init__.pyi | 4 +- .../Pygments/pygments/formatters/_mapping.pyi | 4 +- .../Pygments/pygments/formatters/bbcode.pyi | 9 +- .../Pygments/pygments/formatters/html.pyi | 53 +-- .../Pygments/pygments/formatters/img.pyi | 65 +-- .../Pygments/pygments/formatters/irc.pyi | 13 +- .../Pygments/pygments/formatters/latex.pyi | 41 +- .../Pygments/pygments/formatters/other.pyi | 17 +- .../pygments/formatters/pangomarkup.pyi | 9 +- .../Pygments/pygments/formatters/rtf.pyi | 11 +- .../Pygments/pygments/formatters/svg.pyi | 29 +- .../Pygments/pygments/formatters/terminal.pyi | 13 +- .../pygments/formatters/terminal256.pyi | 35 +- .../Pygments/pygments/lexers/__init__.pyi | 13 +- .../stubs/Pygments/pygments/plugin.pyi | 10 +- .../stubs/Pygments/pygments/regexopt.pyi | 6 +- .../stubs/Pygments/pygments/scanner.pyi | 12 +- .../stubs/Pygments/pygments/unistring.pyi | 4 +- .../typeshed/stubs/Pygments/pygments/util.pyi | 10 +- .../antlr4/BufferedTokenStream.pyi | 29 +- .../antlr4/CommonTokenFactory.pyi | 22 +- .../antlr4/CommonTokenStream.pyi | 4 +- .../antlr4/FileStream.pyi | 6 +- .../antlr4/InputStream.pyi | 24 +- .../antlr4-python3-runtime/antlr4/Lexer.pyi | 72 ++-- .../antlr4-python3-runtime/antlr4/Parser.pyi | 81 ++-- .../antlr4/ParserInterpreter.pyi | 26 +- .../antlr4/ParserRuleContext.pyi | 53 +-- .../antlr4/Recognizer.pyi | 43 +- .../antlr4/RuleContext.pyi | 42 +- .../antlr4-python3-runtime/antlr4/Token.pyi | 51 +-- .../antlr4/tree/Tree.pyi | 56 +-- .../@tests/stubtest_allowlist.txt | 3 + .../typeshed/stubs/aws-xray-sdk/METADATA.toml | 2 +- .../aws_xray_sdk/core/async_context.pyi | 20 +- .../aws_xray_sdk/core/async_recorder.pyi | 37 +- .../aws_xray_sdk/core/context.pyi | 14 +- .../aws_xray_sdk/core/daemon_config.pyi | 16 +- .../core/emitters/udp_emitter.pyi | 4 +- .../aws_xray_sdk/core/lambda_launcher.pyi | 20 +- .../aws_xray_sdk/core/models/entity.pyi | 2 +- .../core/models/facade_segment.pyi | 2 +- .../aws_xray_sdk/core/models/http.pyi | 18 +- .../aws_xray_sdk/core/models/segment.pyi | 2 +- .../aws_xray_sdk/core/models/subsegment.pyi | 5 +- .../aws_xray_sdk/core/models/throwable.pyi | 14 +- .../aws_xray_sdk/core/patcher.pyi | 5 +- .../aws_xray_sdk/core/plugins/ec2_plugin.pyi | 6 +- .../aws_xray_sdk/core/plugins/ecs_plugin.pyi | 4 +- .../core/plugins/elasticbeanstalk_plugin.pyi | 6 +- .../aws_xray_sdk/core/recorder.pyi | 34 +- .../aws_xray_sdk/core/sampling/rule_cache.pyi | 2 +- .../aws_xray_sdk/core/sampling/sampler.pyi | 4 +- .../core/sampling/sampling_rule.pyi | 36 +- .../core/sampling/target_poller.pyi | 6 +- .../aws_xray_sdk/ext/psycopg/__init__.pyi | 3 + .../aws_xray_sdk/ext/psycopg/patch.pyi | 1 + .../aws-xray-sdk/aws_xray_sdk/ext/util.pyi | 2 +- .../typeshed/stubs/bleach/METADATA.toml | 2 +- .../stubs/bleach/bleach/html5lib_shim.pyi | 2 +- .../stubs/bleach/bleach/linkifier.pyi | 2 +- .../stubs/bleach/bleach/sanitizer.pyi | 4 +- .../typeshed/stubs/braintree/METADATA.toml | 2 +- .../stubs/braintree/braintree/address.pyi | 12 +- .../braintree/braintree/address_gateway.pyi | 5 +- .../braintree/braintree/client_token.pyi | 6 +- .../braintree/client_token_gateway.pyi | 8 +- .../stubs/braintree/braintree/error_codes.pyi | 12 +- .../braintree/braintree/payment_method.pyi | 31 +- .../braintree/payment_method_gateway.pyi | 32 +- .../braintree/braintree/subscription.pyi | 15 +- .../braintree/subscription_details.pyi | 6 +- .../braintree/subscription_gateway.pyi | 17 +- .../stubs/braintree/braintree/transaction.pyi | 8 +- .../braintree/transaction_gateway.pyi | 7 +- .../typeshed/stubs/colorful/METADATA.toml | 2 + .../colorful}/__init__.pyi | 0 .../typeshed/stubs/colorful/colorful/ansi.pyi | 14 + .../stubs/colorful/colorful/colors.pyi | 6 + .../typeshed/stubs/colorful/colorful/core.pyi | 102 +++++ .../stubs/colorful/colorful/styles.pyi | 4 + .../stubs/colorful/colorful/terminal.pyi | 16 + .../stubs/colorful/colorful/utils.pyi | 2 + .../typeshed/stubs/decorator/decorator.pyi | 4 +- .../typeshed/stubs/docutils/METADATA.toml | 2 +- .../docutils/parsers/rst/directives/body.pyi | 10 + .../typeshed/stubs/et_xmlfile/METADATA.toml | 2 + .../stubs/et_xmlfile/et_xmlfile/__init__.pyi | 9 + .../et_xmlfile/incremental_tree.pyi | 170 ++++++++ .../stubs/et_xmlfile/et_xmlfile/xmlfile.pyi | 37 ++ .../typeshed/stubs/fanstatic/METADATA.toml | 2 +- .../@tests/stubtest_allowlist.txt | 2 +- .../stubs/flake8-bugbear/METADATA.toml | 2 +- .../typeshed/stubs/flake8-bugbear/bugbear.pyi | 112 ++--- .../stubs/flake8-builtins/METADATA.toml | 2 +- .../typeshed/stubs/fpdf2/fpdf/drawing.pyi | 226 ++++++---- .../typeshed/stubs/fpdf2/fpdf/text_region.pyi | 2 +- .../@tests/stubtest_allowlist_win32.txt | 1 + .../typeshed/stubs/gevent/METADATA.toml | 2 +- .../stubs/gevent/gevent/libuv/watcher.pyi | 1 + .../typeshed/stubs/gevent/gevent/os.pyi | 1 + .../typeshed/stubs/gevent/gevent/signal.pyi | 3 +- .../google/cloud/ndb/_cache.pyi | 19 +- .../google/cloud/ndb/_datastore_query.pyi | 3 +- .../google/cloud/ndb/_eventloop.pyi | 21 +- .../google/cloud/ndb/blobstore.pyi | 12 +- .../google/cloud/ndb/context.pyi | 42 +- .../google/cloud/ndb/exceptions.pyi | 4 +- .../google/cloud/ndb/global_cache.pyi | 27 +- .../google-cloud-ndb/google/cloud/ndb/key.pyi | 5 +- .../google/cloud/ndb/metadata.pyi | 3 +- .../google/cloud/ndb/polymodel.pyi | 4 +- .../google/cloud/ndb/query.pyi | 53 ++- .../google/cloud/ndb/stats.pyi | 74 ++-- .../google/cloud/ndb/tasklets.pyi | 14 +- .../google/cloud/ndb/utils.pyi | 8 +- .../stubs/gunicorn/gunicorn/arbiter.pyi | 4 +- .../typeshed/stubs/gunicorn/gunicorn/sock.pyi | 2 + .../html5lib/@tests/stubtest_allowlist.txt | 6 + .../typeshed/stubs/html5lib/METADATA.toml | 1 + .../stubs/html5lib/html5lib/_ihatexml.pyi | 44 +- .../stubs/html5lib/html5lib/_inputstream.pyi | 150 +++---- .../stubs/html5lib/html5lib/_tokenizer.pyi | 138 ++++--- .../stubs/html5lib/html5lib/_utils.pyi | 29 +- .../stubs/html5lib/html5lib/constants.pyi | 4 +- .../filters/alphabeticalattributes.pyi | 5 +- .../stubs/html5lib/html5lib/filters/base.pyi | 15 +- .../html5lib/filters/inject_meta_charset.pyi | 8 +- .../stubs/html5lib/html5lib/filters/lint.pyi | 8 +- .../html5lib/filters/optionaltags.pyi | 3 +- .../html5lib/html5lib/filters/sanitizer.pyi | 12 +- .../html5lib/html5lib/filters/whitespace.pyi | 4 +- .../stubs/html5lib/html5lib/html5parser.pyi | 4 +- .../stubs/html5lib/html5lib/serializer.pyi | 94 ++++- .../html5lib/html5lib/treeadapters/sax.pyi | 3 - .../helpers/typeshed/stubs/hvac/METADATA.toml | 2 +- .../hvac/hvac/api/auth_methods/__init__.pyi | 7 +- .../stubs/hvac/hvac/api/auth_methods/aws.pyi | 4 +- .../hvac/hvac/api/auth_methods/azure.pyi | 5 +- .../stubs/hvac/hvac/api/auth_methods/gcp.pyi | 5 +- .../hvac/hvac/api/auth_methods/kubernetes.pyi | 1 + .../hvac/hvac/api/auth_methods/legacy_mfa.pyi | 6 +- .../hvac/api/secrets_engines/__init__.pyi | 7 +- .../hvac/api/secrets_engines/identity.pyi | 4 +- .../hvac/hvac/api/secrets_engines/kv.pyi | 6 +- .../hvac/hvac/api/system_backend/__init__.pyi | 7 +- .../system_backend/system_backend_mixin.pyi | 4 +- .../hvac/hvac/api/system_backend/wrapping.pyi | 5 +- .../hvac/hvac/api/vault_api_category.pyi | 5 +- .../typeshed/stubs/icalendar/METADATA.toml | 2 +- .../jwcrypto/@tests/stubtest_allowlist.txt | 3 + .../typeshed/stubs/ldap3/ldap3/__init__.pyi | 10 +- .../stubs/ldap3/ldap3/abstract/__init__.pyi | 6 +- .../stubs/ldap3/ldap3/abstract/attrDef.pyi | 26 +- .../stubs/ldap3/ldap3/abstract/attribute.pyi | 18 +- .../stubs/ldap3/ldap3/abstract/cursor.pyi | 55 +-- .../stubs/ldap3/ldap3/abstract/entry.pyi | 22 +- .../stubs/ldap3/ldap3/core/exceptions.pyi | 16 +- .../stubs/ldap3/ldap3/core/pooling.pyi | 30 +- .../typeshed/stubs/ldap3/ldap3/core/rdns.pyi | 14 +- .../stubs/ldap3/ldap3/core/results.pyi | 6 +- .../stubs/ldap3/ldap3/core/server.pyi | 29 +- .../stubs/ldap3/ldap3/core/timezone.pyi | 6 +- .../typeshed/stubs/ldap3/ldap3/core/tls.pyi | 26 +- .../typeshed/stubs/ldap3/ldap3/core/usage.pyi | 12 +- .../stubs/ldap3/ldap3/extend/__init__.pyi | 8 +- .../ldap3/ldap3/extend/microsoft/dirSync.pyi | 24 +- .../extend/microsoft/persistentSearch.pyi | 14 +- .../extend/standard/PersistentSearch.pyi | 26 +- .../stubs/ldap3/ldap3/operation/modify.pyi | 4 +- .../stubs/ldap3/ldap3/operation/search.pyi | 10 +- .../ldap3/protocol/formatters/formatters.pyi | 4 +- .../ldap3/protocol/formatters/standard.pyi | 4 +- .../stubs/ldap3/ldap3/protocol/oid.pyi | 4 +- .../stubs/ldap3/ldap3/protocol/rfc2849.pyi | 4 +- .../stubs/ldap3/ldap3/protocol/rfc4512.pyi | 118 +++--- .../ldap3/ldap3/strategy/asyncStream.pyi | 14 +- .../ldap3/ldap3/strategy/asynchronous.pyi | 12 +- .../stubs/ldap3/ldap3/strategy/base.pyi | 14 +- .../ldap3/ldap3/strategy/ldifProducer.pyi | 8 +- .../stubs/ldap3/ldap3/strategy/mockAsync.pyi | 4 +- .../stubs/ldap3/ldap3/strategy/mockBase.pyi | 18 +- .../stubs/ldap3/ldap3/strategy/mockSync.pyi | 4 +- .../ldap3/ldap3/strategy/restartable.pyi | 8 +- .../stubs/ldap3/ldap3/strategy/reusable.pyi | 40 +- .../stubs/ldap3/ldap3/strategy/sync.pyi | 6 +- .../stubs/ldap3/ldap3/utils/config.pyi | 4 +- .../stubs/ldap3/ldap3/utils/hashed.pyi | 6 +- .../typeshed/stubs/ldap3/ldap3/utils/log.pyi | 6 +- .../typeshed/stubs/ldap3/ldap3/utils/ntlm.pyi | 82 ++-- .../typeshed/stubs/ldap3/ldap3/utils/repr.pyi | 4 +- .../helpers/typeshed/stubs/lupa/METADATA.toml | 2 +- .../stubs/netaddr/netaddr/ip/__init__.pyi | 5 +- .../stubs/netaddr/netaddr/ip/iana.pyi | 16 +- .../algorithms/approximation/treewidth.pyi | 18 +- .../networkx/algorithms/planarity.pyi | 17 +- .../networkx/networkx/classes/digraph.pyi | 20 +- .../stubs/networkx/networkx/classes/graph.pyi | 15 +- .../networkx/classes/multidigraph.pyi | 19 +- .../networkx/networkx/classes/multigraph.pyi | 31 +- .../readwrite/json_graph/node_link.pyi | 2 +- .../@tests/stubtest_allowlist.txt | 3 - .../typeshed/stubs/parsimonious/METADATA.toml | 2 +- .../parsimonious/parsimonious/exceptions.pyi | 8 +- .../typeshed/stubs/peewee/METADATA.toml | 2 +- .../protobuf/internal/well_known_types.pyi | 4 +- .../protobuf/google/protobuf/message.pyi | 2 +- .../@tests/stubtest_allowlist_darwin.txt | 4 + .../@tests/stubtest_allowlist_win32.txt | 1 - .../typeshed/stubs/psutil/METADATA.toml | 2 +- .../typeshed/stubs/psutil/psutil/__init__.pyi | 9 +- .../typeshed/stubs/psutil/psutil/_common.pyi | 173 ++++---- .../typeshed/stubs/psutil/psutil/_psbsd.pyi | 117 +++--- .../typeshed/stubs/psutil/psutil/_pslinux.pyi | 112 ++--- .../typeshed/stubs/psutil/psutil/_psosx.pyi | 201 ++++----- .../typeshed/stubs/psutil/psutil/_psposix.pyi | 28 +- .../stubs/psutil/psutil/_psutil_linux.pyi | 19 +- .../stubs/psutil/psutil/_psutil_osx.pyi | 111 ++--- .../stubs/psutil/psutil/_psutil_posix.pyi | 56 +-- .../stubs/psutil/psutil/_psutil_windows.pyi | 191 +++++---- .../stubs/psutil/psutil/_pswindows.pyi | 391 ++++++++++-------- .../helpers/typeshed/stubs/pycurl/pycurl.pyi | 8 +- .../typeshed/stubs/python-crontab/crontab.pyi | 8 +- .../dateutil/parser/_parser.pyi | 13 +- .../stubs/python-dateutil/dateutil/rrule.pyi | 53 +-- .../python-dateutil/dateutil/tz/_common.pyi | 11 +- .../stubs/python-dateutil/dateutil/tz/tz.pyi | 40 +- .../stubs/python-dateutil/dateutil/tz/win.pyi | 9 +- .../dateutil/zoneinfo/__init__.pyi | 3 +- .../dateutil/zoneinfo/rebuild.pyi | 6 +- .../stubs/python-jenkins/jenkins/__init__.pyi | 19 +- .../helpers/typeshed/stubs/pytz/pytz/lazy.pyi | 4 +- .../typeshed/stubs/pyxdg/xdg/RecentFiles.pyi | 12 +- .../typeshed/stubs/qrbill/METADATA.toml | 2 +- .../typeshed/stubs/qrbill/qrbill/bill.pyi | 10 + .../typeshed/stubs/regex/METADATA.toml | 2 +- .../typeshed/stubs/reportlab/METADATA.toml | 2 +- .../reportlab/reportlab/lib/testutils.pyi | 52 +-- .../reportlab/platypus/flowables.pyi | 2 +- .../stubs/simple-websocket/METADATA.toml | 3 + .../simple_websocket/__init__.pyi | 3 + .../simple_websocket/aiows.pyi | 130 ++++++ .../simple_websocket/asgi.pyi | 44 ++ .../simple_websocket/errors.pyi | 12 + .../simple-websocket/simple_websocket/ws.pyi | 136 ++++++ .../ttkthemes/@tests/stubtest_allowlist.txt | 5 + .../typeshed/stubs/ttkthemes/METADATA.toml | 2 +- .../ttkthemes/ttkthemes/themed_style.pyi | 2 +- .../stubs/ttkthemes/ttkthemes/themed_tk.pyi | 23 +- .../tzdata/@tests/stubtest_allowlist.txt | 2 + .../typeshed/stubs/tzdata/METADATA.toml | 2 + .../typeshed/stubs/tzdata/tzdata/__init__.pyi | 4 + .../@tests/stubtest_allowlist.txt | 2 + .../typeshed/stubs/webencodings/METADATA.toml | 2 + .../webencodings/webencodings/__init__.pyi | 33 ++ .../webencodings/webencodings/labels.pyi | 3 + .../webencodings/webencodings/mklabels.pyi | 5 + .../webencodings/x_user_defined.pyi | 21 + .../yt-dlp/@tests/stubtest_allowlist.txt | 2 + .../typeshed/stubs/yt-dlp/METADATA.toml | 2 +- .../typeshed/stubs/yt-dlp/yt_dlp/__init__.pyi | 2 + .../typeshed/stubs/yt-dlp/yt_dlp/globals.pyi | 13 +- .../stubs/yt-dlp/yt_dlp/utils/_jsruntime.pyi | 38 ++ .../stubs/yt-dlp/yt_dlp/utils/_legacy.pyi | 70 +--- python/helpers/typeshed/tests/mypy_test.py | 2 +- 346 files changed, 4232 insertions(+), 2804 deletions(-) create mode 100644 python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py314.txt create mode 100644 python/helpers/typeshed/stdlib/@tests/test_cases/builtins/check_type.py create mode 100644 python/helpers/typeshed/stdlib/@tests/test_cases/check_compression.py create mode 100644 python/helpers/typeshed/stubs/Deprecated/deprecated/params.pyi delete mode 100644 python/helpers/typeshed/stubs/ExifRead/@tests/stubtest_allowlist.txt delete mode 100644 python/helpers/typeshed/stubs/ExifRead/METADATA.toml delete mode 100644 python/helpers/typeshed/stubs/ExifRead/exifread/__init__.pyi delete mode 100644 python/helpers/typeshed/stubs/ExifRead/exifread/_types.pyi delete mode 100644 python/helpers/typeshed/stubs/ExifRead/exifread/classes.pyi delete mode 100644 python/helpers/typeshed/stubs/ExifRead/exifread/exceptions.pyi delete mode 100644 python/helpers/typeshed/stubs/ExifRead/exifread/exif_log.pyi delete mode 100644 python/helpers/typeshed/stubs/ExifRead/exifread/heic.pyi delete mode 100644 python/helpers/typeshed/stubs/ExifRead/exifread/jpeg.pyi delete mode 100644 python/helpers/typeshed/stubs/ExifRead/exifread/tags/__init__.pyi delete mode 100644 python/helpers/typeshed/stubs/ExifRead/exifread/tags/exif.pyi delete mode 100644 python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/apple.pyi delete mode 100644 python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/canon.pyi delete mode 100644 python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/casio.pyi delete mode 100644 python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/fujifilm.pyi delete mode 100644 python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/nikon.pyi delete mode 100644 python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/olympus.pyi delete mode 100644 python/helpers/typeshed/stubs/ExifRead/exifread/utils.pyi create mode 100644 python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/ext/psycopg/__init__.pyi create mode 100644 python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/ext/psycopg/patch.pyi create mode 100644 python/helpers/typeshed/stubs/colorful/METADATA.toml rename python/helpers/typeshed/stubs/{ExifRead/exifread/tags/makernote => colorful/colorful}/__init__.pyi (100%) create mode 100644 python/helpers/typeshed/stubs/colorful/colorful/ansi.pyi create mode 100644 python/helpers/typeshed/stubs/colorful/colorful/colors.pyi create mode 100644 python/helpers/typeshed/stubs/colorful/colorful/core.pyi create mode 100644 python/helpers/typeshed/stubs/colorful/colorful/styles.pyi create mode 100644 python/helpers/typeshed/stubs/colorful/colorful/terminal.pyi create mode 100644 python/helpers/typeshed/stubs/colorful/colorful/utils.pyi create mode 100644 python/helpers/typeshed/stubs/et_xmlfile/METADATA.toml create mode 100644 python/helpers/typeshed/stubs/et_xmlfile/et_xmlfile/__init__.pyi create mode 100644 python/helpers/typeshed/stubs/et_xmlfile/et_xmlfile/incremental_tree.pyi create mode 100644 python/helpers/typeshed/stubs/et_xmlfile/et_xmlfile/xmlfile.pyi create mode 100644 python/helpers/typeshed/stubs/html5lib/@tests/stubtest_allowlist.txt create mode 100644 python/helpers/typeshed/stubs/simple-websocket/METADATA.toml create mode 100644 python/helpers/typeshed/stubs/simple-websocket/simple_websocket/__init__.pyi create mode 100644 python/helpers/typeshed/stubs/simple-websocket/simple_websocket/aiows.pyi create mode 100644 python/helpers/typeshed/stubs/simple-websocket/simple_websocket/asgi.pyi create mode 100644 python/helpers/typeshed/stubs/simple-websocket/simple_websocket/errors.pyi create mode 100644 python/helpers/typeshed/stubs/simple-websocket/simple_websocket/ws.pyi create mode 100644 python/helpers/typeshed/stubs/ttkthemes/@tests/stubtest_allowlist.txt create mode 100644 python/helpers/typeshed/stubs/tzdata/@tests/stubtest_allowlist.txt create mode 100644 python/helpers/typeshed/stubs/tzdata/METADATA.toml create mode 100644 python/helpers/typeshed/stubs/tzdata/tzdata/__init__.pyi create mode 100644 python/helpers/typeshed/stubs/webencodings/@tests/stubtest_allowlist.txt create mode 100644 python/helpers/typeshed/stubs/webencodings/METADATA.toml create mode 100644 python/helpers/typeshed/stubs/webencodings/webencodings/__init__.pyi create mode 100644 python/helpers/typeshed/stubs/webencodings/webencodings/labels.pyi create mode 100644 python/helpers/typeshed/stubs/webencodings/webencodings/mklabels.pyi create mode 100644 python/helpers/typeshed/stubs/webencodings/webencodings/x_user_defined.pyi create mode 100644 python/helpers/typeshed/stubs/yt-dlp/yt_dlp/utils/_jsruntime.pyi diff --git a/python/helpers/typeshed/.github/workflows/tests.yml b/python/helpers/typeshed/.github/workflows/tests.yml index cf08d2d0cc87..79998b1f94ab 100644 --- a/python/helpers/typeshed/.github/workflows/tests.yml +++ b/python/helpers/typeshed/.github/workflows/tests.yml @@ -62,11 +62,7 @@ jobs: sudo apt-get update -q && sudo apt-get install -qy $PACKAGES fi - name: Run mypy_test.py - run: | - # python-version can sometimes be pinned to a specific version or to "-dev", but - # mypy understands only X.Y version numbers. - MYPY_PY_VERSION=$(echo ${{ matrix.python-version }} | cut -d - -f 1 | cut -d . -f 1-2) - python ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${MYPY_PY_VERSION} + run: python ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${{ matrix.python-version }} regression-tests: name: "mypy: Run test cases" @@ -75,9 +71,7 @@ jobs: - uses: actions/checkout@v5 - uses: actions/setup-python@v6 with: - # Use py311 for now, as py312 seems to be around 30s slower in CI - # TODO: figure out why that is (#11590) - python-version: "3.11" + python-version: "3.14" - uses: astral-sh/setup-uv@v6 with: version-file: "requirements-tests.txt" diff --git a/python/helpers/typeshed/pyproject.toml b/python/helpers/typeshed/pyproject.toml index 4cf4f95fbcc5..d121b0d4e3b9 100644 --- a/python/helpers/typeshed/pyproject.toml +++ b/python/helpers/typeshed/pyproject.toml @@ -26,6 +26,7 @@ exclude = [ ] [tool.ruff.lint] +future-annotations = true # Disable all rules on test cases by default: # test cases often deliberately contain code # that might not be considered idiomatic or modern. @@ -69,15 +70,22 @@ select = [ # Only include flake8-annotations rules that are autofixable. Otherwise leave this to mypy+pyright "ANN2", # Most refurb rules are in preview and can be opinionated, - # consider them individually as they come out of preview (last check: 0.8.4) + # consider them individually as they come out of preview (last check: 0.13.1) "FURB105", # Unnecessary empty string passed to `print` + "FURB116", # Replace `{function_name}` call with `{display}` + "FURB122", # Use of `{}.write` in a for loop "FURB129", # Instead of calling `readlines()`, iterate over file object directly + "FURB132", # Use `{suggestion}` instead of `check` and `remove` "FURB136", # Replace `if` expression with `{min_max}` call + "FURB157", # Verbose expression in `Decimal` constructor + "FURB162", # Unnecessary timezone replacement with zero offset + "FURB166", # Use of `int` with explicit `base={base}` after removing prefix "FURB167", # Use of regular expression alias `re.{}` "FURB168", # Prefer `is` operator over `isinstance` to check if an object is `None` "FURB169", # Compare the identities of `{object}` and None instead of their respective types "FURB177", # Prefer `Path.cwd()` over `Path().resolve()` for current-directory lookups "FURB187", # Use of assignment of `reversed` on list `{name}` + "FURB188", # Prefer `str.removeprefix()` over conditionally replacing with slice. # Used for lint.flake8-import-conventions.aliases "ICN001", # `{name}` should be imported as `{asname}` # PYI: only enable rules that have autofixes and that we always want to fix (even manually), @@ -89,6 +97,7 @@ select = [ "PYI014", # Only simple default values allowed for arguments "PYI015", # Only simple default values allowed for assignments "PYI016", # Duplicate union member `{}` + "PYI018", # Private `{type_var_like_kind}` `{type_var_like_name}` is never used "PYI019", # Methods like `{method_name}` should return `Self` instead of a custom `TypeVar` "PYI020", # Quoted annotations should not be included in stubs "PYI025", # Use `from collections.abc import Set as AbstractSet` to avoid confusion with the `set` builtin @@ -99,7 +108,8 @@ select = [ "PYI044", # `from __future__ import annotations` has no effect in stub files, since type checkers automatically treat stubs as having those semantics "PYI055", # Multiple `type[T]` usages in a union. Combine them into one, e.g., `type[{union_str}]`. "PYI058", # Use `{return_type}` as the return value for simple `{method}` methods - # "PYI061", # TODO: Enable when out of preview + # "PYI059", # TODO: Add when dropping Python 3.9 support + "PYI061", # Use `None` rather than `Literal[None]` "PYI062", # Duplicate literal member `{}` "PYI064", # `Final[Literal[{literal}]]` can be replaced with a bare Final # flake8-simplify, excluding rules that can reduce performance or readability due to long line formatting @@ -124,6 +134,7 @@ select = [ "SIM223", # Use `{expr}` instead of `{replaced}` "SIM300", # Yoda condition detected "SIM401", # Use `{contents}` instead of an if block + "SIM905", # Consider using a list literal instead of `str.{}` "SIM910", # Use `{expected}` instead of `{actual}` (dict-get-with-none-default) "SIM911", # Use `{expected}` instead of `{actual}` (zip-dict-keys-and-values) # Don't include TC rules that create a TYPE_CHECKING block or stringifies annotations @@ -159,7 +170,7 @@ ignore = [ # see https://github.com/astral-sh/ruff/issues/6465 "E721", # Do not compare types, use `isinstance()` # Highly opinionated, and it's often necessary to violate it - "PLC0415", # `import` should be at the top-level of a file + "PLC0415", # `import` should be at the top-level of a file # Leave the size and complexity of tests to human interpretation "PLR09", # Too many ... # Too many magic number "2" that are preferable inline. https://github.com/astral-sh/ruff/issues/10009 @@ -175,7 +186,6 @@ ignore = [ "TD003", # Missing issue link for this TODO # Mostly from scripts and tests, it's ok to have messages passed directly to exceptions "TRY003", # Avoid specifying long messages outside the exception class - "PLC0205", # Sometimes __slots__ really is a string at runtime ### # False-positives, but already checked by type-checkers ### @@ -206,6 +216,8 @@ ignore = [ # Most pep8-naming rules don't apply for third-party stubs like typeshed. # N811 to N814 could apply, but we often use them to disambiguate a name whilst making it look like a more common one "N8", # pep8-naming + # Sometimes __slots__ really is a string at runtime + "PLC0205", # Class `__slots__` should be a non-string iterable # Stubs are allowed to use private variables (pyright's reportPrivateUsage is also disabled) "PLC2701", # Private name import from external module # Names in stubs should match implementation diff --git a/python/helpers/typeshed/pyrightconfig.json b/python/helpers/typeshed/pyrightconfig.json index 5e63976c9eab..74ddb65b85f6 100644 --- a/python/helpers/typeshed/pyrightconfig.json +++ b/python/helpers/typeshed/pyrightconfig.json @@ -28,8 +28,6 @@ // No effect in stubs "reportMissingSuperCall": "none", "reportUninitializedInstanceVariable": "none", - // stdlib stubs trigger reportShadowedImports - "reportShadowedImports": "none", // Stubs are allowed to use private variables "reportPrivateUsage": "none", // Stubs don't need the actual modules to be installed diff --git a/python/helpers/typeshed/pyrightconfig.scripts_and_tests.json b/python/helpers/typeshed/pyrightconfig.scripts_and_tests.json index 68bcd2688ad2..f9b093547281 100644 --- a/python/helpers/typeshed/pyrightconfig.scripts_and_tests.json +++ b/python/helpers/typeshed/pyrightconfig.scripts_and_tests.json @@ -14,7 +14,6 @@ "reportImplicitStringConcatenation": "none", // Extra strict settings "reportMissingModuleSource": "error", - "reportShadowedImports": "error", "reportCallInDefaultInitializer": "error", "reportPropertyTypeMismatch": "error", "reportUninitializedInstanceVariable": "error", diff --git a/python/helpers/typeshed/pyrightconfig.stricter.json b/python/helpers/typeshed/pyrightconfig.stricter.json index e1ac57dc5fcf..63b7c08047e8 100644 --- a/python/helpers/typeshed/pyrightconfig.stricter.json +++ b/python/helpers/typeshed/pyrightconfig.stricter.json @@ -30,6 +30,7 @@ "stubs/boltons", "stubs/braintree", "stubs/cffi", + "stubs/colorful", "stubs/dateparser", "stubs/defusedxml", "stubs/docker", @@ -79,7 +80,6 @@ "stubs/PyMySQL", "stubs/python-dateutil", "stubs/python-jose", - "stubs/pytz/pytz/lazy.pyi", "stubs/pywin32", "stubs/PyYAML", "stubs/reportlab", @@ -88,6 +88,7 @@ "stubs/seaborn", "stubs/setuptools/setuptools", "stubs/shapely", + "stubs/simple-websocket", "stubs/tensorflow", "stubs/tqdm", "stubs/vobject", @@ -107,8 +108,6 @@ // No effect in stubs "reportMissingSuperCall": "none", "reportUninitializedInstanceVariable": "none", - // stdlib stubs trigger reportShadowedImports - "reportShadowedImports": "none", // Stubs are allowed to use private variables "reportPrivateUsage": "none", // Stubs don't need the actual modules to be installed diff --git a/python/helpers/typeshed/pyrightconfig.testcases.json b/python/helpers/typeshed/pyrightconfig.testcases.json index a957cc694f18..ab1cb86b9900 100644 --- a/python/helpers/typeshed/pyrightconfig.testcases.json +++ b/python/helpers/typeshed/pyrightconfig.testcases.json @@ -6,7 +6,6 @@ ], "typeCheckingMode": "strict", // Extra strict settings - "reportShadowedImports": "error", // Don't accidentally name a file something that shadows stdlib "reportImplicitStringConcatenation": "error", "reportUninitializedInstanceVariable": "error", "reportUnnecessaryTypeIgnoreComment": "error", diff --git a/python/helpers/typeshed/requirements-tests.txt b/python/helpers/typeshed/requirements-tests.txt index bd5b945147ff..7d918970eba7 100644 --- a/python/helpers/typeshed/requirements-tests.txt +++ b/python/helpers/typeshed/requirements-tests.txt @@ -1,7 +1,7 @@ # Type checkers that we test our stubs against. These should always # be pinned to a specific version to make failure reproducible. mypy==1.18.2 -pyright==1.1.406 +pyright==1.1.407 # Libraries used by our various scripts. aiohttp==3.12.15 @@ -19,7 +19,7 @@ termcolor>=2.3 tomli==2.2.1; python_version < "3.11" tomlkit==0.13.3 typing_extensions>=4.15.0rc1 -uv==0.9.5 +uv==0.9.6 # Utilities for typeshed infrastructure scripts. ts_utils @ file:lib diff --git a/python/helpers/typeshed/scripts/stubsabot.py b/python/helpers/typeshed/scripts/stubsabot.py index 60b905fbfb2b..07b66fa21b4f 100644 --- a/python/helpers/typeshed/scripts/stubsabot.py +++ b/python/helpers/typeshed/scripts/stubsabot.py @@ -161,7 +161,7 @@ class Obsolete: @dataclass class Remove: distribution: str - reason: str + reason: Literal["ships py.typed file", "unmaintained"] links: dict[str, str] def __str__(self) -> str: @@ -171,7 +171,7 @@ class Remove: @dataclass class NoUpdate: distribution: str - reason: str + reason: Literal["obsolete", "no longer updated", "up to date"] def __str__(self) -> str: return f"{colored('skipping', 'green')} ({self.reason})" @@ -642,7 +642,7 @@ async def determine_action_no_error_handling( "Typeshed release": f"{pypi_info.pypi_root}", "Typeshed stubs": f"https://github.com/{TYPESHED_OWNER}/typeshed/tree/main/stubs/{stub_info.distribution}", } - return Remove(stub_info.distribution, reason="older than 6 months", links=links) + return Remove(stub_info.distribution, reason="ships py.typed file", links=links) else: return NoUpdate(stub_info.distribution, "obsolete") if stub_info.no_longer_updated: @@ -654,7 +654,7 @@ async def determine_action_no_error_handling( "Typeshed release": f"{pypi_info.pypi_root}", "Typeshed stubs": f"https://github.com/{TYPESHED_OWNER}/typeshed/tree/main/stubs/{stub_info.distribution}", } - return Remove(stub_info.distribution, reason="no longer updated", links=links) + return Remove(stub_info.distribution, reason="unmaintained", links=links) else: return NoUpdate(stub_info.distribution, "no longer updated") diff --git a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/common.txt b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/common.txt index b697bbb6dee4..d8956df6b327 100644 --- a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/common.txt +++ b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/common.txt @@ -170,6 +170,10 @@ sys.ps1 # Available in interactive mode sys.ps2 # Available in interactive mode sys.tracebacklimit # Must be set first +# This is only present if Python was built with zlib-ng. +(zlib\.ZLIBNG_VERSION)? +(compression\.zlib\.ZLIBNG_VERSION)? + # ========================================================== # Other allowlist entries that cannot or should not be fixed @@ -233,7 +237,6 @@ asyncio.locks.Condition.release builtins.memoryview.__contains__ # C type that implements __getitem__ builtins.reveal_locals # Builtins that type checkers pretends exist builtins.reveal_type # Builtins that type checkers pretends exist -builtins.type.__dict__ # read-only but not actually a property; stubtest thinks it's a mutable attribute. # The following CodecInfo properties are added in __new__ codecs.CodecInfo.decode diff --git a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/darwin.txt b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/darwin.txt index b82f42156ad0..4b8d1d041499 100644 --- a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/darwin.txt +++ b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/darwin.txt @@ -10,6 +10,14 @@ (fcntl.F_SETLEASE)? # GNU extension +# ======= +# <= 3.14 +# ======= + +# Added in Python 3.9.25, 3.10.20, 3.11.15, 3.12.13, 3.13.10, 3.14.1 (parameter `scripting`) +html.parser.HTMLParser.__init__ + + # ========================================== # Modules that do not exist on MacOS systems # ========================================== @@ -45,9 +53,6 @@ multiprocessing.popen_spawn_win32 # exists on Darwin but fails to import readline.append_history_file # Only available if compiled with GNU readline, not editline select.poll # Actually a function; we have a class so it can be used as a type -# Some of these exist on non-windows, but they are useless and this is not intended -stat.FILE_ATTRIBUTE_[A-Z_]+ - tkinter.Tk.createfilehandler # Methods that come from __getattr__() at runtime tkinter.Tk.deletefilehandler # Methods that come from __getattr__() at runtime diff --git a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py310.txt b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py310.txt index a4083aa22ed7..559c5d4ce8bf 100644 --- a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py310.txt +++ b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py310.txt @@ -1,3 +1,11 @@ +# ======= +# <= 3.14 +# ======= + +# Added in Python 3.10.20 (parameter `scripting`) +html.parser.HTMLParser.__init__ + + # ============================================================= # Allowlist entries that cannot or should not be fixed; <= 3.12 # ============================================================= diff --git a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py311.txt b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py311.txt index a4083aa22ed7..ce9d5d89f298 100644 --- a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py311.txt +++ b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py311.txt @@ -1,3 +1,11 @@ +# ======= +# <= 3.14 +# ======= + +# Added in Python 3.11.15 (parameter `scripting`) +html.parser.HTMLParser.__init__ + + # ============================================================= # Allowlist entries that cannot or should not be fixed; <= 3.12 # ============================================================= diff --git a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py312.txt b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py312.txt index a4083aa22ed7..602a661fbc95 100644 --- a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py312.txt +++ b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py312.txt @@ -1,3 +1,11 @@ +# ======= +# <= 3.14 +# ======= + +# Added in Python 3.12.13 (parameter `scripting`) +html.parser.HTMLParser.__init__ + + # ============================================================= # Allowlist entries that cannot or should not be fixed; <= 3.12 # ============================================================= diff --git a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py313.txt b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py313.txt index e69de29bb2d1..672b0cf50e09 100644 --- a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py313.txt +++ b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py313.txt @@ -0,0 +1,6 @@ +# ======= +# <= 3.14 +# ======= + +# Added in Python 3.13.10 (parameter `scripting`) +html.parser.HTMLParser.__init__ diff --git a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py314.txt b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py314.txt new file mode 100644 index 000000000000..2e5d4a88255d --- /dev/null +++ b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux-py314.txt @@ -0,0 +1,6 @@ +# ======= +# <= 3.14 +# ======= + +# Added in Python 3.14.1 (parameter `scripting`) +html.parser.HTMLParser.__init__ diff --git a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux.txt b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux.txt index 8d7176ce37a4..b8656a9b038f 100644 --- a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux.txt +++ b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/linux.txt @@ -54,9 +54,6 @@ _?socket.SOL_IPX _?socket.SOL_NETROM _?socket.SOL_ROSE -# Some of these exist on non-windows, but they are useless and this is not intended -stat.FILE_ATTRIBUTE_[A-Z_]+ - # This is available on Linux, but it's documented as for kernel debugging and # not present on GitHub Actions runners. termios.TIOCTTYGSTRUCT diff --git a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/py314.txt b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/py314.txt index 0fcdcbb84d97..76d0408730dd 100644 --- a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/py314.txt @@ -40,6 +40,9 @@ concurrent.interpreters._queues.UNBOUND_REMOVE importlib.util.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility +# Condition functions are exported in __init__ +threading.Condition.locked +multiprocessing.dummy.Condition.locked # ==================================== # Pre-existing errors from Python 3.13 diff --git a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/win32.txt b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/win32.txt index 66695e1d87d3..1ac5529e7ebe 100644 --- a/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/win32.txt +++ b/python/helpers/typeshed/stdlib/@tests/stubtest_allowlists/win32.txt @@ -9,6 +9,14 @@ _winapi.OpenFileMapping _winapi.VirtualQuerySize +# ======= +# <= 3.14 +# ======= + +# Added in Python 3.9.25, 3.10.20, 3.11.15, 3.12.13, 3.13.10, 3.14.1 (parameter `scripting`) +html.parser.HTMLParser.__init__ + + # ============================================ # Modules that do not exist on Windows systems # ============================================ diff --git a/python/helpers/typeshed/stdlib/@tests/test_cases/builtins/check_type.py b/python/helpers/typeshed/stdlib/@tests/test_cases/builtins/check_type.py new file mode 100644 index 000000000000..1eafcf482fb6 --- /dev/null +++ b/python/helpers/typeshed/stdlib/@tests/test_cases/builtins/check_type.py @@ -0,0 +1,4 @@ +class Meta(type): ... + + +call = Meta.__dict__["__call__"] diff --git a/python/helpers/typeshed/stdlib/@tests/test_cases/check_compression.py b/python/helpers/typeshed/stdlib/@tests/test_cases/check_compression.py new file mode 100644 index 000000000000..7fc106f125c7 --- /dev/null +++ b/python/helpers/typeshed/stdlib/@tests/test_cases/check_compression.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +import io +import sys +from _typeshed import ReadableBuffer +from bz2 import BZ2Decompressor +from lzma import LZMADecompressor +from typing import cast +from typing_extensions import assert_type +from zlib import decompressobj + +if sys.version_info >= (3, 14): + from compression._common._streams import DecompressReader, _Decompressor, _Reader + from compression.zstd import ZstdDecompressor +else: + from _compression import DecompressReader, _Decompressor, _Reader + +### +# Tests for DecompressReader/_Decompressor +### + + +class CustomDecompressor: + def decompress(self, data: ReadableBuffer, max_length: int = -1) -> bytes: + return b"" + + @property + def unused_data(self) -> bytes: + return b"" + + @property + def eof(self) -> bool: + return False + + @property + def needs_input(self) -> bool: + return False + + +def accept_decompressor(d: _Decompressor) -> None: + d.decompress(b"random bytes", 0) + assert_type(d.eof, bool) + assert_type(d.unused_data, bytes) + + +fp = cast(_Reader, io.BytesIO(b"hello world")) +DecompressReader(fp, decompressobj) +DecompressReader(fp, BZ2Decompressor) +DecompressReader(fp, LZMADecompressor) +DecompressReader(fp, CustomDecompressor) +accept_decompressor(decompressobj()) +accept_decompressor(BZ2Decompressor()) +accept_decompressor(LZMADecompressor()) +accept_decompressor(CustomDecompressor()) + +if sys.version_info >= (3, 14): + DecompressReader(fp, ZstdDecompressor) + accept_decompressor(ZstdDecompressor()) diff --git a/python/helpers/typeshed/stdlib/@tests/test_cases/check_types.py b/python/helpers/typeshed/stdlib/@tests/test_cases/check_types.py index 847c38c387ac..884557c74b88 100644 --- a/python/helpers/typeshed/stdlib/@tests/test_cases/check_types.py +++ b/python/helpers/typeshed/stdlib/@tests/test_cases/check_types.py @@ -62,7 +62,21 @@ class DCAtest: self._value = None -if sys.version_info > (3, 10): +# check that NotImplemented is treated as an "Any" +x: int = NotImplemented + +if sys.version_info >= (3, 10): + # test NotImplementedType usage + assert_type(NotImplemented, types.NotImplementedType) + assert_type(types.NotImplementedType(), types.NotImplementedType) + # test EllipsisType usage + assert_type(Ellipsis, types.EllipsisType) + assert_type(types.EllipsisType(), types.EllipsisType) + # test NoneType usage (disabled, passes with pyright, but mypy errors + # assert_type(None, types.NoneType) + # assert_type(types.NoneType(), types.NoneType) + +if sys.version_info >= (3, 11): union_type = int | list[_T] # ideally this would be `_SpecialForm` (Union) diff --git a/python/helpers/typeshed/stdlib/_compression.pyi b/python/helpers/typeshed/stdlib/_compression.pyi index aa67df2ab478..6015bcb13f1c 100644 --- a/python/helpers/typeshed/stdlib/_compression.pyi +++ b/python/helpers/typeshed/stdlib/_compression.pyi @@ -1,6 +1,6 @@ # _compression is replaced by compression._common._streams on Python 3.14+ (PEP-784) -from _typeshed import Incomplete, WriteableBuffer +from _typeshed import ReadableBuffer, WriteableBuffer from collections.abc import Callable from io import DEFAULT_BUFFER_SIZE, BufferedIOBase, RawIOBase from typing import Any, Protocol, type_check_only @@ -13,13 +13,24 @@ class _Reader(Protocol): def seekable(self) -> bool: ... def seek(self, n: int, /) -> Any: ... +@type_check_only +class _Decompressor(Protocol): + def decompress(self, data: ReadableBuffer, /, max_length: int = ...) -> bytes: ... + @property + def unused_data(self) -> bytes: ... + @property + def eof(self) -> bool: ... + # `zlib._Decompress` does not have next property, but `DecompressReader` calls it: + # @property + # def needs_input(self) -> bool: ... + class BaseStream(BufferedIOBase): ... class DecompressReader(RawIOBase): def __init__( self, fp: _Reader, - decomp_factory: Callable[..., Incomplete], + decomp_factory: Callable[..., _Decompressor], trailing_error: type[Exception] | tuple[type[Exception], ...] = (), **decomp_args: Any, # These are passed to decomp_factory. ) -> None: ... diff --git a/python/helpers/typeshed/stdlib/asyncio/protocols.pyi b/python/helpers/typeshed/stdlib/asyncio/protocols.pyi index 2c52ad4be410..3a8965f03e29 100644 --- a/python/helpers/typeshed/stdlib/asyncio/protocols.pyi +++ b/python/helpers/typeshed/stdlib/asyncio/protocols.pyi @@ -14,7 +14,7 @@ class BaseProtocol: class Protocol(BaseProtocol): # Need annotation or mypy will complain about 'Cannot determine type of "__slots__" in base class' - __slots__: tuple[()] = () + __slots__: tuple[str, ...] = () def data_received(self, data: bytes) -> None: ... def eof_received(self) -> bool | None: ... @@ -35,7 +35,7 @@ class DatagramProtocol(BaseProtocol): def error_received(self, exc: Exception) -> None: ... class SubprocessProtocol(BaseProtocol): - __slots__: tuple[()] = () + __slots__: tuple[str, ...] = () def pipe_data_received(self, fd: int, data: bytes) -> None: ... def pipe_connection_lost(self, fd: int, exc: Exception | None) -> None: ... def process_exited(self) -> None: ... diff --git a/python/helpers/typeshed/stdlib/asyncio/runners.pyi b/python/helpers/typeshed/stdlib/asyncio/runners.pyi index 919e6521f8a1..a100c9bcec6d 100644 --- a/python/helpers/typeshed/stdlib/asyncio/runners.pyi +++ b/python/helpers/typeshed/stdlib/asyncio/runners.pyi @@ -1,6 +1,6 @@ import sys from _typeshed import Unused -from collections.abc import Callable, Coroutine +from collections.abc import Awaitable, Callable, Coroutine from contextvars import Context from typing import Any, TypeVar, final from typing_extensions import Self @@ -22,7 +22,10 @@ if sys.version_info >= (3, 11): def __exit__(self, exc_type: Unused, exc_val: Unused, exc_tb: Unused) -> None: ... def close(self) -> None: ... def get_loop(self) -> AbstractEventLoop: ... - def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = None) -> _T: ... + if sys.version_info >= (3, 14): + def run(self, coro: Awaitable[_T], *, context: Context | None = None) -> _T: ... + else: + def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = None) -> _T: ... if sys.version_info >= (3, 12): def run( diff --git a/python/helpers/typeshed/stdlib/asyncio/trsock.pyi b/python/helpers/typeshed/stdlib/asyncio/trsock.pyi index 492f1e42adf2..d3e95559ebef 100644 --- a/python/helpers/typeshed/stdlib/asyncio/trsock.pyi +++ b/python/helpers/typeshed/stdlib/asyncio/trsock.pyi @@ -62,7 +62,7 @@ class TransportSocket: def listen(self, backlog: int = ..., /) -> None: ... @deprecated("Removed in Python 3.11") def makefile(self) -> BinaryIO: ... - @deprecated("Rmoved in Python 3.11") + @deprecated("Removed in Python 3.11") def sendfile(self, file: BinaryIO, offset: int = 0, count: int | None = None) -> int: ... @deprecated("Removed in Python 3.11") def close(self) -> None: ... diff --git a/python/helpers/typeshed/stdlib/builtins.pyi b/python/helpers/typeshed/stdlib/builtins.pyi index 1bc46493338c..38be452e8d49 100644 --- a/python/helpers/typeshed/stdlib/builtins.pyi +++ b/python/helpers/typeshed/stdlib/builtins.pyi @@ -42,6 +42,7 @@ from typing import ( # noqa: Y022,UP035 Any, BinaryIO, ClassVar, + Final, Generic, Mapping, MutableMapping, @@ -189,8 +190,9 @@ class type: __bases__: tuple[type, ...] @property def __basicsize__(self) -> int: ... - @property - def __dict__(self) -> types.MappingProxyType[str, Any]: ... # type: ignore[override] + # type.__dict__ is read-only at runtime, but that can't be expressed currently. + # See https://github.com/python/typeshed/issues/11033 for a discussion. + __dict__: Final[types.MappingProxyType[str, Any]] # type: ignore[assignment] @property def __dictoffset__(self) -> int: ... @property @@ -1365,13 +1367,6 @@ class property: def __set__(self, instance: Any, value: Any, /) -> None: ... def __delete__(self, instance: Any, /) -> None: ... -@final -@type_check_only -class _NotImplementedType(Any): - __call__: None - -NotImplemented: _NotImplementedType - def abs(x: SupportsAbs[_T], /) -> _T: ... def all(iterable: Iterable[object], /) -> bool: ... def any(iterable: Iterable[object], /) -> bool: ... @@ -2030,14 +2025,14 @@ def __import__( def __build_class__(func: Callable[[], CellType | Any], name: str, /, *bases: Any, metaclass: Any = ..., **kwds: Any) -> Any: ... if sys.version_info >= (3, 10): - from types import EllipsisType + from types import EllipsisType, NotImplementedType # Backwards compatibility hack for folks who relied on the ellipsis type # existing in typeshed in Python 3.9 and earlier. ellipsis = EllipsisType Ellipsis: EllipsisType - + NotImplemented: NotImplementedType else: # Actually the type of Ellipsis is , but since it's # not exposed anywhere under that name, we make it private here. @@ -2047,6 +2042,12 @@ else: Ellipsis: ellipsis + @final + @type_check_only + class _NotImplementedType(Any): ... + + NotImplemented: _NotImplementedType + @disjoint_base class BaseException: args: tuple[Any, ...] diff --git a/python/helpers/typeshed/stdlib/calendar.pyi b/python/helpers/typeshed/stdlib/calendar.pyi index d00f0d5d2bce..0d3a0a7490a3 100644 --- a/python/helpers/typeshed/stdlib/calendar.pyi +++ b/python/helpers/typeshed/stdlib/calendar.pyi @@ -56,10 +56,12 @@ if sys.version_info >= (3, 12): _LocaleType: TypeAlias = tuple[str | None, str | None] -class IllegalMonthError(ValueError): +class IllegalMonthError(ValueError, IndexError): + month: int def __init__(self, month: int) -> None: ... class IllegalWeekdayError(ValueError): + weekday: int def __init__(self, weekday: int) -> None: ... def isleap(year: int) -> bool: ... diff --git a/python/helpers/typeshed/stdlib/compression/_common/_streams.pyi b/python/helpers/typeshed/stdlib/compression/_common/_streams.pyi index b8463973ec67..96aec24d1c2d 100644 --- a/python/helpers/typeshed/stdlib/compression/_common/_streams.pyi +++ b/python/helpers/typeshed/stdlib/compression/_common/_streams.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete, WriteableBuffer +from _typeshed import ReadableBuffer, WriteableBuffer from collections.abc import Callable from io import DEFAULT_BUFFER_SIZE, BufferedIOBase, RawIOBase from typing import Any, Protocol, type_check_only @@ -11,13 +11,24 @@ class _Reader(Protocol): def seekable(self) -> bool: ... def seek(self, n: int, /) -> Any: ... +@type_check_only +class _Decompressor(Protocol): + def decompress(self, data: ReadableBuffer, /, max_length: int = ...) -> bytes: ... + @property + def unused_data(self) -> bytes: ... + @property + def eof(self) -> bool: ... + # `zlib._Decompress` does not have next property, but `DecompressReader` calls it: + # @property + # def needs_input(self) -> bool: ... + class BaseStream(BufferedIOBase): ... class DecompressReader(RawIOBase): def __init__( self, fp: _Reader, - decomp_factory: Callable[..., Incomplete], # Consider backporting changes to _compression + decomp_factory: Callable[..., _Decompressor], # Consider backporting changes to _compression trailing_error: type[Exception] | tuple[type[Exception], ...] = (), **decomp_args: Any, # These are passed to decomp_factory. ) -> None: ... diff --git a/python/helpers/typeshed/stdlib/contextlib.pyi b/python/helpers/typeshed/stdlib/contextlib.pyi index 383a1b7f334b..221102ee2395 100644 --- a/python/helpers/typeshed/stdlib/contextlib.pyi +++ b/python/helpers/typeshed/stdlib/contextlib.pyi @@ -4,7 +4,7 @@ from _typeshed import FileDescriptorOrPath, Unused from abc import ABC, abstractmethod from collections.abc import AsyncGenerator, AsyncIterator, Awaitable, Callable, Generator, Iterator from types import TracebackType -from typing import IO, Any, Generic, Protocol, TypeVar, overload, runtime_checkable, type_check_only +from typing import Any, Generic, Protocol, TypeVar, overload, runtime_checkable, type_check_only from typing_extensions import ParamSpec, Self, TypeAlias __all__ = [ @@ -30,7 +30,6 @@ if sys.version_info >= (3, 11): _T = TypeVar("_T") _T_co = TypeVar("_T_co", covariant=True) -_T_io = TypeVar("_T_io", bound=IO[str] | None) _ExitT_co = TypeVar("_ExitT_co", covariant=True, bound=bool | None, default=bool | None) _F = TypeVar("_F", bound=Callable[..., Any]) _G_co = TypeVar("_G_co", bound=Generator[Any, Any, Any] | AsyncGenerator[Any, Any], covariant=True) @@ -141,14 +140,24 @@ class suppress(AbstractContextManager[None, bool]): self, exctype: type[BaseException] | None, excinst: BaseException | None, exctb: TracebackType | None ) -> bool: ... -class _RedirectStream(AbstractContextManager[_T_io, None]): - def __init__(self, new_target: _T_io) -> None: ... +# This is trying to describe what is needed for (most?) uses +# of `redirect_stdout` and `redirect_stderr`. +# https://github.com/python/typeshed/issues/14903 +@type_check_only +class _SupportsRedirect(Protocol): + def write(self, s: str, /) -> int: ... + def flush(self) -> None: ... + +_SupportsRedirectT = TypeVar("_SupportsRedirectT", bound=_SupportsRedirect | None) + +class _RedirectStream(AbstractContextManager[_SupportsRedirectT, None]): + def __init__(self, new_target: _SupportsRedirectT) -> None: ... def __exit__( self, exctype: type[BaseException] | None, excinst: BaseException | None, exctb: TracebackType | None ) -> None: ... -class redirect_stdout(_RedirectStream[_T_io]): ... -class redirect_stderr(_RedirectStream[_T_io]): ... +class redirect_stdout(_RedirectStream[_SupportsRedirectT]): ... +class redirect_stderr(_RedirectStream[_SupportsRedirectT]): ... class _BaseExitStack(Generic[_ExitT_co]): def enter_context(self, cm: AbstractContextManager[_T, _ExitT_co]) -> _T: ... diff --git a/python/helpers/typeshed/stdlib/enum.pyi b/python/helpers/typeshed/stdlib/enum.pyi index 4ac860f5e611..c131c9392393 100644 --- a/python/helpers/typeshed/stdlib/enum.pyi +++ b/python/helpers/typeshed/stdlib/enum.pyi @@ -309,6 +309,7 @@ if sys.version_info >= (3, 11): def global_enum(cls: _EnumerationT, update_str: bool = False) -> _EnumerationT: ... def global_enum_repr(self: Enum) -> str: ... def global_flag_repr(self: Flag) -> str: ... + def show_flag_values(value: int) -> list[int]: ... if sys.version_info >= (3, 12): # The body of the class is the same, but the base classes are different. diff --git a/python/helpers/typeshed/stdlib/html/parser.pyi b/python/helpers/typeshed/stdlib/html/parser.pyi index 7edd39e8c703..08dc7b936922 100644 --- a/python/helpers/typeshed/stdlib/html/parser.pyi +++ b/python/helpers/typeshed/stdlib/html/parser.pyi @@ -9,7 +9,8 @@ class HTMLParser(ParserBase): # Added in Python 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.6 RCDATA_CONTENT_ELEMENTS: Final[tuple[str, ...]] - def __init__(self, *, convert_charrefs: bool = True) -> None: ... + # `scripting` parameter added in Python 3.9.25, 3.10.20, 3.11.15, 3.12.13, 3.13.10, 3.14.1 + def __init__(self, *, convert_charrefs: bool = True, scripting: bool = False) -> None: ... def feed(self, data: str) -> None: ... def close(self) -> None: ... def get_starttag_text(self) -> str | None: ... diff --git a/python/helpers/typeshed/stdlib/http/client.pyi b/python/helpers/typeshed/stdlib/http/client.pyi index d259e84e6f2a..1568567d5854 100644 --- a/python/helpers/typeshed/stdlib/http/client.pyi +++ b/python/helpers/typeshed/stdlib/http/client.pyi @@ -166,6 +166,7 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO): # type: ignore[misc] # incomp def begin(self) -> None: ... class HTTPConnection: + blocksize: int auto_open: int # undocumented debuglevel: int default_port: int # undocumented diff --git a/python/helpers/typeshed/stdlib/imaplib.pyi b/python/helpers/typeshed/stdlib/imaplib.pyi index 536985a592b7..39fd466529bb 100644 --- a/python/helpers/typeshed/stdlib/imaplib.pyi +++ b/python/helpers/typeshed/stdlib/imaplib.pyi @@ -26,6 +26,7 @@ class IMAP4: class error(Exception): ... class abort(error): ... class readonly(abort): ... + utf8_enabled: bool mustquote: Pattern[str] debug: int state: str diff --git a/python/helpers/typeshed/stdlib/importlib/util.pyi b/python/helpers/typeshed/stdlib/importlib/util.pyi index 05c4d0d1edb3..577d3a667eca 100644 --- a/python/helpers/typeshed/stdlib/importlib/util.pyi +++ b/python/helpers/typeshed/stdlib/importlib/util.pyi @@ -12,7 +12,9 @@ from importlib._bootstrap_external import ( spec_from_file_location as spec_from_file_location, ) from importlib.abc import Loader -from typing_extensions import ParamSpec, deprecated +from types import TracebackType +from typing import Literal +from typing_extensions import ParamSpec, Self, deprecated _P = ParamSpec("_P") @@ -44,6 +46,18 @@ class LazyLoader(Loader): def source_hash(source_bytes: ReadableBuffer) -> bytes: ... +if sys.version_info >= (3, 12): + class _incompatible_extension_module_restrictions: + def __init__(self, *, disable_check: bool) -> None: ... + disable_check: bool + old: Literal[-1, 0, 1] # exists only while entered + def __enter__(self) -> Self: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... + @property + def override(self) -> Literal[-1, 1]: ... # undocumented + if sys.version_info >= (3, 14): __all__ = [ "LazyLoader", diff --git a/python/helpers/typeshed/stdlib/ipaddress.pyi b/python/helpers/typeshed/stdlib/ipaddress.pyi index e2f3defa2dea..d09804cb9342 100644 --- a/python/helpers/typeshed/stdlib/ipaddress.pyi +++ b/python/helpers/typeshed/stdlib/ipaddress.pyi @@ -73,7 +73,7 @@ class _BaseNetwork(_IPAddressBase, Generic[_A]): @property def broadcast_address(self) -> _A: ... def compare_networks(self, other: Self) -> int: ... - def hosts(self) -> Iterator[_A] | list[_A]: ... + def hosts(self) -> Iterator[_A]: ... @property def is_global(self) -> bool: ... @property diff --git a/python/helpers/typeshed/stdlib/locale.pyi b/python/helpers/typeshed/stdlib/locale.pyi index fae9f849b637..80c39a532dc8 100644 --- a/python/helpers/typeshed/stdlib/locale.pyi +++ b/python/helpers/typeshed/stdlib/locale.pyi @@ -153,6 +153,10 @@ if sys.version_info < (3, 12): def format_string(f: _str, val: Any, grouping: bool = False, monetary: bool = False) -> _str: ... def currency(val: float | Decimal, symbol: bool = True, grouping: bool = False, international: bool = False) -> _str: ... def delocalize(string: _str) -> _str: ... + +if sys.version_info >= (3, 10): + def localize(string: _str, grouping: bool = False, monetary: bool = False) -> _str: ... + def atof(string: _str, func: Callable[[_str], float] = ...) -> float: ... def atoi(string: _str) -> int: ... def str(val: float) -> _str: ... diff --git a/python/helpers/typeshed/stdlib/os/__init__.pyi b/python/helpers/typeshed/stdlib/os/__init__.pyi index 71c79dfac399..bb0a57153948 100644 --- a/python/helpers/typeshed/stdlib/os/__init__.pyi +++ b/python/helpers/typeshed/stdlib/os/__init__.pyi @@ -41,10 +41,22 @@ from typing import ( runtime_checkable, type_check_only, ) -from typing_extensions import Self, TypeAlias, Unpack, deprecated +from typing_extensions import LiteralString, Self, TypeAlias, Unpack, deprecated from . import path as _path +# Re-export common definitions from os.path to reduce duplication +from .path import ( + altsep as altsep, + curdir as curdir, + defpath as defpath, + devnull as devnull, + extsep as extsep, + pardir as pardir, + pathsep as pathsep, + sep as sep, +) + __all__ = [ "F_OK", "O_APPEND", @@ -674,19 +686,8 @@ if sys.platform != "win32": ST_NOSUID: Final[int] ST_RDONLY: Final[int] -curdir: str -pardir: str -sep: str -if sys.platform == "win32": - altsep: str -else: - altsep: str | None -extsep: str -pathsep: str -defpath: str linesep: Literal["\n", "\r\n"] -devnull: str -name: str +name: LiteralString F_OK: Final = 0 R_OK: Final = 4 @@ -729,6 +730,9 @@ environ: _Environ[str] if sys.platform != "win32": environb: _Environ[bytes] +if sys.version_info >= (3, 14): + def reload_environ() -> None: ... + if sys.version_info >= (3, 11) or sys.platform != "win32": EX_OK: Final[int] diff --git a/python/helpers/typeshed/stdlib/parser.pyi b/python/helpers/typeshed/stdlib/parser.pyi index 26140c76248a..9b287fcc6529 100644 --- a/python/helpers/typeshed/stdlib/parser.pyi +++ b/python/helpers/typeshed/stdlib/parser.pyi @@ -7,8 +7,8 @@ def expr(source: str) -> STType: ... def suite(source: str) -> STType: ... def sequence2st(sequence: Sequence[Any]) -> STType: ... def tuple2st(sequence: Sequence[Any]) -> STType: ... -def st2list(st: STType, line_info: bool = ..., col_info: bool = ...) -> list[Any]: ... -def st2tuple(st: STType, line_info: bool = ..., col_info: bool = ...) -> tuple[Any, ...]: ... +def st2list(st: STType, line_info: bool = False, col_info: bool = False) -> list[Any]: ... +def st2tuple(st: STType, line_info: bool = False, col_info: bool = False) -> tuple[Any, ...]: ... def compilest(st: STType, filename: StrOrBytesPath = ...) -> CodeType: ... def isexpr(st: STType) -> bool: ... def issuite(st: STType) -> bool: ... @@ -21,5 +21,5 @@ class STType: def compile(self, filename: StrOrBytesPath = ...) -> CodeType: ... def isexpr(self) -> bool: ... def issuite(self) -> bool: ... - def tolist(self, line_info: bool = ..., col_info: bool = ...) -> list[Any]: ... - def totuple(self, line_info: bool = ..., col_info: bool = ...) -> tuple[Any, ...]: ... + def tolist(self, line_info: bool = False, col_info: bool = False) -> list[Any]: ... + def totuple(self, line_info: bool = False, col_info: bool = False) -> tuple[Any, ...]: ... diff --git a/python/helpers/typeshed/stdlib/select.pyi b/python/helpers/typeshed/stdlib/select.pyi index 587bc75376ef..43a9e4274b23 100644 --- a/python/helpers/typeshed/stdlib/select.pyi +++ b/python/helpers/typeshed/stdlib/select.pyi @@ -2,8 +2,8 @@ import sys from _typeshed import FileDescriptorLike from collections.abc import Iterable from types import TracebackType -from typing import Any, ClassVar, Final, final -from typing_extensions import Self +from typing import Any, ClassVar, Final, TypeVar, final +from typing_extensions import Never, Self if sys.platform != "win32": PIPE_BUF: Final[int] @@ -31,9 +31,13 @@ if sys.platform != "win32": def unregister(self, fd: FileDescriptorLike, /) -> None: ... def poll(self, timeout: float | None = None, /) -> list[tuple[int, int]]: ... +_R = TypeVar("_R", default=Never) +_W = TypeVar("_W", default=Never) +_X = TypeVar("_X", default=Never) + def select( - rlist: Iterable[Any], wlist: Iterable[Any], xlist: Iterable[Any], timeout: float | None = None, / -) -> tuple[list[Any], list[Any], list[Any]]: ... + rlist: Iterable[_R], wlist: Iterable[_W], xlist: Iterable[_X], timeout: float | None = None, / +) -> tuple[list[_R], list[_W], list[_X]]: ... error = OSError diff --git a/python/helpers/typeshed/stdlib/ssl.pyi b/python/helpers/typeshed/stdlib/ssl.pyi index faa98cb39920..aa94fc84255e 100644 --- a/python/helpers/typeshed/stdlib/ssl.pyi +++ b/python/helpers/typeshed/stdlib/ssl.pyi @@ -33,6 +33,9 @@ from typing_extensions import Never, Self, TypeAlias, deprecated if sys.version_info >= (3, 13): from _ssl import HAS_PSK as HAS_PSK +if sys.version_info >= (3, 14): + from _ssl import HAS_PHA as HAS_PHA + if sys.version_info < (3, 12): from _ssl import RAND_pseudo_bytes as RAND_pseudo_bytes diff --git a/python/helpers/typeshed/stdlib/stat.pyi b/python/helpers/typeshed/stdlib/stat.pyi index face28ab0cbb..6c26080e0665 100644 --- a/python/helpers/typeshed/stdlib/stat.pyi +++ b/python/helpers/typeshed/stdlib/stat.pyi @@ -1,7 +1,114 @@ import sys -from _stat import * +from _stat import ( + S_ENFMT as S_ENFMT, + S_IEXEC as S_IEXEC, + S_IFBLK as S_IFBLK, + S_IFCHR as S_IFCHR, + S_IFDIR as S_IFDIR, + S_IFDOOR as S_IFDOOR, + S_IFIFO as S_IFIFO, + S_IFLNK as S_IFLNK, + S_IFMT as S_IFMT, + S_IFPORT as S_IFPORT, + S_IFREG as S_IFREG, + S_IFSOCK as S_IFSOCK, + S_IFWHT as S_IFWHT, + S_IMODE as S_IMODE, + S_IREAD as S_IREAD, + S_IRGRP as S_IRGRP, + S_IROTH as S_IROTH, + S_IRUSR as S_IRUSR, + S_IRWXG as S_IRWXG, + S_IRWXO as S_IRWXO, + S_IRWXU as S_IRWXU, + S_ISBLK as S_ISBLK, + S_ISCHR as S_ISCHR, + S_ISDIR as S_ISDIR, + S_ISDOOR as S_ISDOOR, + S_ISFIFO as S_ISFIFO, + S_ISGID as S_ISGID, + S_ISLNK as S_ISLNK, + S_ISPORT as S_ISPORT, + S_ISREG as S_ISREG, + S_ISSOCK as S_ISSOCK, + S_ISUID as S_ISUID, + S_ISVTX as S_ISVTX, + S_ISWHT as S_ISWHT, + S_IWGRP as S_IWGRP, + S_IWOTH as S_IWOTH, + S_IWRITE as S_IWRITE, + S_IWUSR as S_IWUSR, + S_IXGRP as S_IXGRP, + S_IXOTH as S_IXOTH, + S_IXUSR as S_IXUSR, + SF_APPEND as SF_APPEND, + SF_ARCHIVED as SF_ARCHIVED, + SF_IMMUTABLE as SF_IMMUTABLE, + SF_NOUNLINK as SF_NOUNLINK, + SF_SNAPSHOT as SF_SNAPSHOT, + ST_ATIME as ST_ATIME, + ST_CTIME as ST_CTIME, + ST_DEV as ST_DEV, + ST_GID as ST_GID, + ST_INO as ST_INO, + ST_MODE as ST_MODE, + ST_MTIME as ST_MTIME, + ST_NLINK as ST_NLINK, + ST_SIZE as ST_SIZE, + ST_UID as ST_UID, + UF_APPEND as UF_APPEND, + UF_COMPRESSED as UF_COMPRESSED, + UF_HIDDEN as UF_HIDDEN, + UF_IMMUTABLE as UF_IMMUTABLE, + UF_NODUMP as UF_NODUMP, + UF_NOUNLINK as UF_NOUNLINK, + UF_OPAQUE as UF_OPAQUE, + filemode as filemode, +) from typing import Final +if sys.platform == "win32": + from _stat import ( + IO_REPARSE_TAG_APPEXECLINK as IO_REPARSE_TAG_APPEXECLINK, + IO_REPARSE_TAG_MOUNT_POINT as IO_REPARSE_TAG_MOUNT_POINT, + IO_REPARSE_TAG_SYMLINK as IO_REPARSE_TAG_SYMLINK, + ) + +if sys.version_info >= (3, 13): + from _stat import ( + SF_DATALESS as SF_DATALESS, + SF_FIRMLINK as SF_FIRMLINK, + SF_SETTABLE as SF_SETTABLE, + UF_DATAVAULT as UF_DATAVAULT, + UF_SETTABLE as UF_SETTABLE, + UF_TRACKED as UF_TRACKED, + ) + + if sys.platform == "darwin": + from _stat import SF_SUPPORTED as SF_SUPPORTED, SF_SYNTHETIC as SF_SYNTHETIC + +# _stat.c defines FILE_ATTRIBUTE_* constants conditionally, +# making them available only at runtime on Windows. +# stat.py unconditionally redefines the same FILE_ATTRIBUTE_* constants +# on all platforms. +FILE_ATTRIBUTE_ARCHIVE: Final = 32 +FILE_ATTRIBUTE_COMPRESSED: Final = 2048 +FILE_ATTRIBUTE_DEVICE: Final = 64 +FILE_ATTRIBUTE_DIRECTORY: Final = 16 +FILE_ATTRIBUTE_ENCRYPTED: Final = 16384 +FILE_ATTRIBUTE_HIDDEN: Final = 2 +FILE_ATTRIBUTE_INTEGRITY_STREAM: Final = 32768 +FILE_ATTRIBUTE_NORMAL: Final = 128 +FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: Final = 8192 +FILE_ATTRIBUTE_NO_SCRUB_DATA: Final = 131072 +FILE_ATTRIBUTE_OFFLINE: Final = 4096 +FILE_ATTRIBUTE_READONLY: Final = 1 +FILE_ATTRIBUTE_REPARSE_POINT: Final = 1024 +FILE_ATTRIBUTE_SPARSE_FILE: Final = 512 +FILE_ATTRIBUTE_SYSTEM: Final = 4 +FILE_ATTRIBUTE_TEMPORARY: Final = 256 +FILE_ATTRIBUTE_VIRTUAL: Final = 65536 + if sys.version_info >= (3, 13): # https://github.com/python/cpython/issues/114081#issuecomment-2119017790 SF_RESTRICTED: Final = 0x00080000 diff --git a/python/helpers/typeshed/stdlib/subprocess.pyi b/python/helpers/typeshed/stdlib/subprocess.pyi index e1e25bcb50cb..d465c64d4213 100644 --- a/python/helpers/typeshed/stdlib/subprocess.pyi +++ b/python/helpers/typeshed/stdlib/subprocess.pyi @@ -497,7 +497,6 @@ elif sys.version_info >= (3, 10): ) -> CompletedProcess[Any]: ... else: - # 3.9 adds arguments "user", "group", "extra_groups" and "umask" @overload def run( args: _CMD, diff --git a/python/helpers/typeshed/stdlib/sys/__init__.pyi b/python/helpers/typeshed/stdlib/sys/__init__.pyi index 7807b0eab01f..6abef85dfb7f 100644 --- a/python/helpers/typeshed/stdlib/sys/__init__.pyi +++ b/python/helpers/typeshed/stdlib/sys/__init__.pyi @@ -5,7 +5,7 @@ from builtins import object as _object from collections.abc import AsyncGenerator, Callable, Sequence from io import TextIOWrapper from types import FrameType, ModuleType, TracebackType -from typing import Any, Final, Literal, NoReturn, Protocol, TextIO, TypeVar, final, type_check_only +from typing import Any, Final, Literal, NoReturn, Protocol, TextIO, TypeVar, final, overload, type_check_only from typing_extensions import LiteralString, TypeAlias, deprecated _T = TypeVar("_T") @@ -354,6 +354,13 @@ else: def _current_frames() -> dict[int, FrameType]: ... def _getframe(depth: int = 0, /) -> FrameType: ... +# documented -- see https://docs.python.org/3/library/sys.html#sys._current_exceptions +if sys.version_info >= (3, 12): + def _current_exceptions() -> dict[int, BaseException | None]: ... + +else: + def _current_exceptions() -> dict[int, OptExcInfo]: ... + if sys.version_info >= (3, 12): def _getframemodulename(depth: int = 0) -> str | None: ... @@ -366,14 +373,18 @@ if sys.version_info >= (3, 11): def exception() -> BaseException | None: ... def exit(status: _ExitCode = None, /) -> NoReturn: ... + +if sys.platform == "android": # noqa: Y008 + def getandroidapilevel() -> int: ... + def getallocatedblocks() -> int: ... -def getdefaultencoding() -> str: ... +def getdefaultencoding() -> Literal["utf-8"]: ... if sys.platform != "win32": def getdlopenflags() -> int: ... -def getfilesystemencoding() -> str: ... -def getfilesystemencodeerrors() -> str: ... +def getfilesystemencoding() -> LiteralString: ... +def getfilesystemencodeerrors() -> LiteralString: ... def getrefcount(object: Any, /) -> int: ... def getrecursionlimit() -> int: ... def getsizeof(obj: object, default: int = ...) -> int: ... @@ -411,7 +422,12 @@ if sys.platform == "win32": def getwindowsversion() -> _WinVersion: ... -def intern(string: str, /) -> str: ... +@overload +def intern(string: LiteralString, /) -> LiteralString: ... +@overload +def intern(string: str, /) -> str: ... # type: ignore[misc] + +__interactivehook__: Callable[[], object] if sys.version_info >= (3, 13): def _is_gil_enabled() -> bool: ... @@ -501,3 +517,4 @@ if sys.version_info >= (3, 12): if sys.version_info >= (3, 14): def is_remote_debug_enabled() -> bool: ... def remote_exec(pid: int, script: StrOrBytesPath) -> None: ... + def _is_immortal(op: object, /) -> bool: ... diff --git a/python/helpers/typeshed/stdlib/sys/_monitoring.pyi b/python/helpers/typeshed/stdlib/sys/_monitoring.pyi index 5d231c7a93b3..db799e6f32f8 100644 --- a/python/helpers/typeshed/stdlib/sys/_monitoring.pyi +++ b/python/helpers/typeshed/stdlib/sys/_monitoring.pyi @@ -17,6 +17,10 @@ PROFILER_ID: Final = 2 OPTIMIZER_ID: Final = 5 def use_tool_id(tool_id: int, name: str, /) -> None: ... + +if sys.version_info >= (3, 14): + def clear_tool_id(tool_id: int, /) -> None: ... + def free_tool_id(tool_id: int, /) -> None: ... def get_tool(tool_id: int, /) -> str | None: ... @@ -43,10 +47,10 @@ class _events: STOP_ITERATION: Final[int] if sys.version_info >= (3, 14): BRANCH_LEFT: Final[int] - BRANCH_TAKEN: Final[int] + BRANCH_RIGHT: Final[int] @property - @deprecated("Deprecated since Python 3.14. Use `BRANCH_LEFT` or `BRANCH_TAKEN` instead.") + @deprecated("Deprecated since Python 3.14. Use `BRANCH_LEFT` or `BRANCH_RIGHT` instead.") def BRANCH(self) -> int: ... else: diff --git a/python/helpers/typeshed/stdlib/sysconfig.pyi b/python/helpers/typeshed/stdlib/sysconfig.pyi index 807a979050e8..c6419222df97 100644 --- a/python/helpers/typeshed/stdlib/sysconfig.pyi +++ b/python/helpers/typeshed/stdlib/sysconfig.pyi @@ -1,6 +1,6 @@ import sys from typing import IO, Any, Literal, overload -from typing_extensions import deprecated +from typing_extensions import LiteralString, deprecated __all__ = [ "get_config_h_filename", @@ -28,8 +28,10 @@ def get_config_vars(arg: str, /, *args: str) -> list[Any]: ... def get_scheme_names() -> tuple[str, ...]: ... if sys.version_info >= (3, 10): - def get_default_scheme() -> str: ... - def get_preferred_scheme(key: Literal["prefix", "home", "user"]) -> str: ... + def get_default_scheme() -> LiteralString: ... + def get_preferred_scheme(key: Literal["prefix", "home", "user"]) -> LiteralString: ... + # Documented -- see https://docs.python.org/3/library/sysconfig.html#sysconfig._get_preferred_schemes + def _get_preferred_schemes() -> dict[Literal["prefix", "home", "user"], LiteralString]: ... def get_path_names() -> tuple[str, ...]: ... def get_path(name: str, scheme: str = ..., vars: dict[str, Any] | None = None, expand: bool = True) -> str: ... diff --git a/python/helpers/typeshed/stdlib/threading.pyi b/python/helpers/typeshed/stdlib/threading.pyi index 28fa5267a997..8a2b68dcd1cf 100644 --- a/python/helpers/typeshed/stdlib/threading.pyi +++ b/python/helpers/typeshed/stdlib/threading.pyi @@ -1,6 +1,6 @@ import _thread import sys -from _thread import _excepthook, _ExceptHookArgs, get_native_id as get_native_id +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 @@ -144,6 +144,9 @@ class Condition: ) -> None: ... def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ... def release(self) -> None: ... + if sys.version_info >= (3, 14): + def locked(self) -> bool: ... + def wait(self, timeout: float | None = None) -> bool: ... def wait_for(self, predicate: Callable[[], _T], timeout: float | None = None) -> _T: ... def notify(self, n: int = 1) -> None: ... @@ -169,7 +172,9 @@ class Event: def clear(self) -> None: ... def wait(self, timeout: float | None = None) -> bool: ... -excepthook = _excepthook +excepthook: Callable[[_ExceptHookArgs], object] +if sys.version_info >= (3, 10): + __excepthook__: Callable[[_ExceptHookArgs], object] ExceptHookArgs = _ExceptHookArgs class Timer(Thread): diff --git a/python/helpers/typeshed/stdlib/tkinter/constants.pyi b/python/helpers/typeshed/stdlib/tkinter/constants.pyi index fbfe8b49b997..eb1ef446cf22 100644 --- a/python/helpers/typeshed/stdlib/tkinter/constants.pyi +++ b/python/helpers/typeshed/stdlib/tkinter/constants.pyi @@ -1,12 +1,12 @@ from typing import Final # These are not actually bools. See #4669 -NO: Final[bool] -YES: Final[bool] -TRUE: Final[bool] -FALSE: Final[bool] -ON: Final[bool] -OFF: Final[bool] +YES: Final = True +NO: Final = False +TRUE: Final = True +FALSE: Final = False +ON: Final = True +OFF: Final = False N: Final = "n" S: Final = "s" W: Final = "w" diff --git a/python/helpers/typeshed/stdlib/types.pyi b/python/helpers/typeshed/stdlib/types.pyi index 649e463ff71f..0293e5cb0b4b 100644 --- a/python/helpers/typeshed/stdlib/types.pyi +++ b/python/helpers/typeshed/stdlib/types.pyi @@ -717,9 +717,9 @@ if sys.version_info >= (3, 10): @final class EllipsisType: ... - from builtins import _NotImplementedType + @final + class NotImplementedType(Any): ... - NotImplementedType = _NotImplementedType @final class UnionType: @property diff --git a/python/helpers/typeshed/stdlib/typing.pyi b/python/helpers/typeshed/stdlib/typing.pyi index 2ca65dad4562..953c132aea4f 100644 --- a/python/helpers/typeshed/stdlib/typing.pyi +++ b/python/helpers/typeshed/stdlib/typing.pyi @@ -222,10 +222,6 @@ class TypeVar: @property def evaluate_default(self) -> EvaluateFunc | None: ... -# Used for an undocumented mypy feature. Does not exist at runtime. -# Obsolete, use _typeshed._type_checker_internals.promote instead. -_promote = object() - # N.B. Keep this definition in sync with typing_extensions._SpecialForm @final class _SpecialForm(_Final): @@ -412,7 +408,13 @@ _TC = TypeVar("_TC", bound=type[object]) def overload(func: _F) -> _F: ... def no_type_check(arg: _F) -> _F: ... -def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ... + +if sys.version_info >= (3, 13): + @deprecated("Deprecated since Python 3.13; removed in Python 3.15.") + def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ... + +else: + def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ... # This itself is only available during type checking def type_check_only(func_or_cls: _FT) -> _FT: ... @@ -1004,9 +1006,7 @@ class NamedTuple(tuple[Any, ...]): @overload def __init__(self, typename: str, fields: Iterable[tuple[str, Any]], /) -> None: ... @overload - @typing_extensions.deprecated( - "Creating a typing.NamedTuple using keyword arguments is deprecated and support will be removed in Python 3.15" - ) + @deprecated("Creating a typing.NamedTuple using keyword arguments is deprecated and support will be removed in Python 3.15") def __init__(self, typename: str, fields: None = None, /, **kwargs: Any) -> None: ... @classmethod def _make(cls, iterable: Iterable[Any]) -> typing_extensions.Self: ... diff --git a/python/helpers/typeshed/stdlib/unittest/util.pyi b/python/helpers/typeshed/stdlib/unittest/util.pyi index 31c830e8268a..763c1478f5e6 100644 --- a/python/helpers/typeshed/stdlib/unittest/util.pyi +++ b/python/helpers/typeshed/stdlib/unittest/util.pyi @@ -1,9 +1,26 @@ from collections.abc import MutableSequence, Sequence -from typing import Any, Final, TypeVar +from typing import Any, Final, Literal, Protocol, TypeVar, type_check_only from typing_extensions import TypeAlias +@type_check_only +class _SupportsDunderLT(Protocol): + def __lt__(self, other: Any, /) -> bool: ... + +@type_check_only +class _SupportsDunderGT(Protocol): + def __gt__(self, other: Any, /) -> bool: ... + +@type_check_only +class _SupportsDunderLE(Protocol): + def __le__(self, other: Any, /) -> bool: ... + +@type_check_only +class _SupportsDunderGE(Protocol): + def __ge__(self, other: Any, /) -> bool: ... + _T = TypeVar("_T") _Mismatch: TypeAlias = tuple[_T, _T, int] +_SupportsComparison: TypeAlias = _SupportsDunderLE | _SupportsDunderGE | _SupportsDunderGT | _SupportsDunderLT _MAX_LENGTH: Final = 80 _PLACEHOLDER_LEN: Final = 12 @@ -18,6 +35,6 @@ def safe_repr(obj: object, short: bool = False) -> str: ... def strclass(cls: type) -> str: ... def sorted_list_difference(expected: Sequence[_T], actual: Sequence[_T]) -> tuple[list[_T], list[_T]]: ... def unorderable_list_difference(expected: MutableSequence[_T], actual: MutableSequence[_T]) -> tuple[list[_T], list[_T]]: ... -def three_way_cmp(x: Any, y: Any) -> int: ... +def three_way_cmp(x: _SupportsComparison, y: _SupportsComparison) -> Literal[-1, 0, 1]: ... def _count_diff_all_purpose(actual: Sequence[_T], expected: Sequence[_T]) -> list[_Mismatch[_T]]: ... def _count_diff_hashable(actual: Sequence[_T], expected: Sequence[_T]) -> list[_Mismatch[_T]]: ... diff --git a/python/helpers/typeshed/stdlib/urllib/request.pyi b/python/helpers/typeshed/stdlib/urllib/request.pyi index 876b9d3f165c..a00e7406ee1e 100644 --- a/python/helpers/typeshed/stdlib/urllib/request.pyi +++ b/python/helpers/typeshed/stdlib/urllib/request.pyi @@ -49,7 +49,14 @@ if sys.version_info < (3, 14): __all__ += ["URLopener", "FancyURLopener"] _T = TypeVar("_T") + +# The actual type is `addinfourl | HTTPResponse`, but users would need to use `typing.cast` or `isinstance` to narrow the type, +# so we use `Any` instead. +# See +# - https://github.com/python/typeshed/pull/15042 +# - https://github.com/python/typing/issues/566 _UrlopenRet: TypeAlias = Any + _DataType: TypeAlias = ReadableBuffer | SupportsRead[bytes] | Iterable[bytes] | None if sys.version_info >= (3, 13): diff --git a/python/helpers/typeshed/stdlib/uuid.pyi b/python/helpers/typeshed/stdlib/uuid.pyi index 303fb10eaf53..055f4def311c 100644 --- a/python/helpers/typeshed/stdlib/uuid.pyi +++ b/python/helpers/typeshed/stdlib/uuid.pyi @@ -1,7 +1,8 @@ import builtins import sys +from _typeshed import Unused from enum import Enum -from typing import Final +from typing import Final, NoReturn from typing_extensions import LiteralString, TypeAlias _FieldsType: TypeAlias = tuple[int, int, int, int, int, int] @@ -13,6 +14,9 @@ class SafeUUID(Enum): class UUID: __slots__ = ("int", "is_safe", "__weakref__") + is_safe: Final[SafeUUID] + int: Final[builtins.int] + def __init__( self, hex: str | None = None, @@ -25,8 +29,6 @@ class UUID: is_safe: SafeUUID = SafeUUID.unknown, ) -> None: ... @property - def is_safe(self) -> SafeUUID: ... - @property def bytes(self) -> builtins.bytes: ... @property def bytes_le(self) -> builtins.bytes: ... @@ -41,8 +43,6 @@ class UUID: @property def hex(self) -> str: ... @property - def int(self) -> builtins.int: ... - @property def node(self) -> builtins.int: ... @property def time(self) -> builtins.int: ... @@ -65,6 +65,7 @@ class UUID: def __gt__(self, other: UUID) -> bool: ... def __ge__(self, other: UUID) -> bool: ... def __hash__(self) -> builtins.int: ... + def __setattr__(self, name: Unused, value: Unused) -> NoReturn: ... def getnode() -> int: ... def uuid1(node: int | None = None, clock_seq: int | None = None) -> UUID: ... diff --git a/python/helpers/typeshed/stdlib/winreg.pyi b/python/helpers/typeshed/stdlib/winreg.pyi index 53457112ee96..a654bbcdfb61 100644 --- a/python/helpers/typeshed/stdlib/winreg.pyi +++ b/python/helpers/typeshed/stdlib/winreg.pyi @@ -18,13 +18,13 @@ if sys.platform == "win32": def ExpandEnvironmentStrings(string: str, /) -> str: ... def FlushKey(key: _KeyType, /) -> None: ... def LoadKey(key: _KeyType, sub_key: str, file_name: str, /) -> None: ... - def OpenKey(key: _KeyType, sub_key: str, reserved: int = 0, access: int = 131097) -> HKEYType: ... - def OpenKeyEx(key: _KeyType, sub_key: str, reserved: int = 0, access: int = 131097) -> HKEYType: ... + def OpenKey(key: _KeyType, sub_key: str | None, reserved: int = 0, access: int = 131097) -> HKEYType: ... + def OpenKeyEx(key: _KeyType, sub_key: str | None, reserved: int = 0, access: int = 131097) -> HKEYType: ... def QueryInfoKey(key: _KeyType, /) -> tuple[int, int, int]: ... def QueryValue(key: _KeyType, sub_key: str | None, /) -> str: ... def QueryValueEx(key: _KeyType, name: str, /) -> tuple[Any, int]: ... def SaveKey(key: _KeyType, file_name: str, /) -> None: ... - def SetValue(key: _KeyType, sub_key: str, type: int, value: str, /) -> None: ... + def SetValue(key: _KeyType, sub_key: str | None, type: int, value: str, /) -> None: ... @overload # type=REG_DWORD|REG_QWORD def SetValueEx( key: _KeyType, value_name: str | None, reserved: Unused, type: Literal[4, 5], value: int | None, / diff --git a/python/helpers/typeshed/stdlib/zlib.pyi b/python/helpers/typeshed/stdlib/zlib.pyi index 4e410fdd18ad..d5998cab90fe 100644 --- a/python/helpers/typeshed/stdlib/zlib.pyi +++ b/python/helpers/typeshed/stdlib/zlib.pyi @@ -26,8 +26,8 @@ Z_RLE: Final = 3 Z_SYNC_FLUSH: Final = 2 Z_TREES: Final = 6 -if sys.version_info >= (3, 14) and sys.platform == "win32": - # Available when zlib was built with zlib-ng, usually only on Windows +if sys.version_info >= (3, 14): + # Available when zlib was built with zlib-ng ZLIBNG_VERSION: Final[str] class error(Exception): ... diff --git a/python/helpers/typeshed/stubs/Deprecated/METADATA.toml b/python/helpers/typeshed/stubs/Deprecated/METADATA.toml index 3a87312127ac..d56539265994 100644 --- a/python/helpers/typeshed/stubs/Deprecated/METADATA.toml +++ b/python/helpers/typeshed/stubs/Deprecated/METADATA.toml @@ -1,3 +1,3 @@ -version = "~=1.2.15" +version = "~=1.3.1" upstream_repository = "https://github.com/tantale/deprecated" requires = [] diff --git a/python/helpers/typeshed/stubs/Deprecated/deprecated/__init__.pyi b/python/helpers/typeshed/stubs/Deprecated/deprecated/__init__.pyi index c7b200a4e090..3d4b2bfd8a92 100644 --- a/python/helpers/typeshed/stubs/Deprecated/deprecated/__init__.pyi +++ b/python/helpers/typeshed/stubs/Deprecated/deprecated/__init__.pyi @@ -1,4 +1,9 @@ -from .classic import deprecated as deprecated +from typing import Final -__credits__: str -__date__: str +from .classic import deprecated as deprecated +from .params import deprecated_params as deprecated_params + +__version__: Final[str] +__author__: Final[str] +__date__: Final[str] +__credits__: Final[str] diff --git a/python/helpers/typeshed/stubs/Deprecated/deprecated/params.pyi b/python/helpers/typeshed/stubs/Deprecated/deprecated/params.pyi new file mode 100644 index 000000000000..b1955646d4fb --- /dev/null +++ b/python/helpers/typeshed/stubs/Deprecated/deprecated/params.pyi @@ -0,0 +1,20 @@ +from collections.abc import Callable, Iterable +from inspect import Signature +from typing import Any, TypeVar +from typing_extensions import ParamSpec + +_P = ParamSpec("_P") +_R = TypeVar("_R") + +class DeprecatedParams: + messages: dict[str, str] + category: type[Warning] + def __init__(self, param: str | dict[str, str], reason: str = "", category: type[Warning] = ...) -> None: ... + def populate_messages(self, param: str | dict[str, str], reason: str = "") -> None: ... + def check_params( + self, signature: Signature, *args: Any, **kwargs: Any # args and kwargs passing to Signature.bind method + ) -> list[str]: ... + def warn_messages(self, messages: Iterable[str]) -> None: ... + def __call__(self, f: Callable[_P, _R]) -> Callable[_P, _R]: ... + +deprecated_params = DeprecatedParams diff --git a/python/helpers/typeshed/stubs/ExifRead/@tests/stubtest_allowlist.txt b/python/helpers/typeshed/stubs/ExifRead/@tests/stubtest_allowlist.txt deleted file mode 100644 index 57820b2cc0ff..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/@tests/stubtest_allowlist.txt +++ /dev/null @@ -1,2 +0,0 @@ -# Stub-only module. -exifread._types diff --git a/python/helpers/typeshed/stubs/ExifRead/METADATA.toml b/python/helpers/typeshed/stubs/ExifRead/METADATA.toml deleted file mode 100644 index b65bbc46611c..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/METADATA.toml +++ /dev/null @@ -1,3 +0,0 @@ -version = "3.0.*" -upstream_repository = "https://github.com/ianare/exif-py" -obsolete_since = "3.1.0" # Released on 2025-04-25 diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/__init__.pyi b/python/helpers/typeshed/stubs/ExifRead/exifread/__init__.pyi deleted file mode 100644 index eede72dcd5d8..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/exifread/__init__.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from logging import Logger -from typing import Any - -from ._types import Reader - -__version__: str -logger: Logger - -def process_file( - fh: Reader, - stop_tag: str = "UNDEF", - details: bool = True, - strict: bool = False, - debug: bool = False, - truncate_tags: bool = True, - auto_seek: bool = True, -) -> dict[str, Any]: ... diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/_types.pyi b/python/helpers/typeshed/stubs/ExifRead/exifread/_types.pyi deleted file mode 100644 index 2c2e84770669..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/exifread/_types.pyi +++ /dev/null @@ -1,15 +0,0 @@ -# Stubs-only module with type aliases for ExifRead. - -from collections.abc import Iterator -from typing import Any, Literal, Protocol -from typing_extensions import TypeAlias - -# The second item of the value tuple - if it exists - can be a variety of types, -# including a callable or another dict. -TagDict: TypeAlias = dict[int, tuple[str] | tuple[str, Any]] - -class Reader(Protocol): - def __iter__(self) -> Iterator[bytes]: ... - def read(self, size: int, /) -> bytes: ... - def tell(self) -> int: ... - def seek(self, offset: int, whence: Literal[0, 1] = ..., /) -> object: ... diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/classes.pyi b/python/helpers/typeshed/stubs/ExifRead/exifread/classes.pyi deleted file mode 100644 index 2d7611b63d57..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/exifread/classes.pyi +++ /dev/null @@ -1,47 +0,0 @@ -from logging import Logger -from typing import Any, Literal - -from ._types import Reader, TagDict - -logger: Logger - -class IfdTag: - printable: str - tag: int - field_type: int - field_offset: int - field_length: int - values: Any # either string, bytes or list of data items - def __init__(self, printable: str, tag: int, field_type: int, values: Any, field_offset: int, field_length: int) -> None: ... - -class ExifHeader: - file_handle: Reader - endian: Literal["I", "M"] - offset: int - fake_exif: bool - strict: bool - debug: bool - detailed: bool - truncate_tags: bool - tags: dict[str, Any] - def __init__( - self, - file_handle: Reader, - endian: Literal["I", "M"], - offset: int, - fake_exif: bool, - strict: bool, - debug: bool = False, - detailed: bool = True, - truncate_tags: bool = True, - ) -> None: ... - def s2n(self, offset: int, length: int, signed: bool = False) -> int: ... - def n2b(self, offset: int, length: int) -> bytes: ... - def list_ifd(self) -> list[int]: ... - def dump_ifd( - self, ifd: int, ifd_name: str, tag_dict: TagDict | None = None, relative: int = 0, stop_tag: str = "UNDEF" - ) -> None: ... - def extract_tiff_thumbnail(self, thumb_ifd: int) -> None: ... - def extract_jpeg_thumbnail(self) -> None: ... - def decode_maker_note(self) -> None: ... - def parse_xmp(self, xmp_bytes: bytes) -> None: ... diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/exceptions.pyi b/python/helpers/typeshed/stubs/ExifRead/exifread/exceptions.pyi deleted file mode 100644 index 47b39e3095c0..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/exifread/exceptions.pyi +++ /dev/null @@ -1,2 +0,0 @@ -class InvalidExif(Exception): ... -class ExifNotFound(Exception): ... diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/exif_log.pyi b/python/helpers/typeshed/stubs/ExifRead/exifread/exif_log.pyi deleted file mode 100644 index f7cbc25218ab..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/exifread/exif_log.pyi +++ /dev/null @@ -1,24 +0,0 @@ -import logging -from typing import TextIO - -TEXT_NORMAL: int -TEXT_BOLD: int -TEXT_RED: int -TEXT_GREEN: int -TEXT_YELLOW: int -TEXT_BLUE: int -TEXT_MAGENTA: int -TEXT_CYAN: int - -def get_logger() -> logging.Logger: ... -def setup_logger(debug: bool, color: bool) -> None: ... - -class Formatter(logging.Formatter): - color: bool - debug: bool - def __init__(self, debug: bool = False, color: bool = False) -> None: ... - -class Handler(logging.StreamHandler[TextIO]): - color: bool - debug: bool - def __init__(self, log_level: logging._Level, debug: bool = False, color: bool = False) -> None: ... diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/heic.pyi b/python/helpers/typeshed/stubs/ExifRead/exifread/heic.pyi deleted file mode 100644 index 7fd0e1f839e3..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/exifread/heic.pyi +++ /dev/null @@ -1,56 +0,0 @@ -from collections.abc import Callable -from logging import Logger - -from ._types import Reader - -logger: Logger - -class WrongBox(Exception): ... -class NoParser(Exception): ... -class BoxVersion(Exception): ... -class BadSize(Exception): ... - -class Box: - version: int - minor_version: int - item_count: int - size: int - after: int - pos: int - compat: list[bytes] - base_offset: int - subs: dict[str, Box] - locs: dict[int, list[tuple[int, int]]] - exif_infe: Box | None - item_id: int - item_type: bytes - item_name: bytes - item_protection_index: int - major_brand: bytes - offset_size: int - length_size: int - base_offset_size: int - index_size: int - flags: int - name: str - def __init__(self, name: str) -> None: ... - def set_sizes(self, offset: int, length: int, base_offset: int, index: int) -> None: ... - def set_full(self, vflags: int) -> None: ... - -class HEICExifFinder: - file_handle: Reader - def __init__(self, file_handle: Reader) -> None: ... - def get(self, nbytes: int) -> bytes: ... - def get16(self) -> int: ... - def get32(self) -> int: ... - def get64(self) -> int: ... - def get_int4x2(self) -> tuple[int, int]: ... - def get_int(self, size: int) -> int: ... - def get_string(self) -> bytes: ... - def next_box(self) -> Box: ... - def get_full(self, box: Box) -> None: ... - def skip(self, box: Box) -> None: ... - def expect_parse(self, name: str) -> Box: ... - def get_parser(self, box: Box) -> Callable[[Box], None]: ... - def parse_box(self, box: Box) -> Box: ... - def find_exif(self) -> tuple[int, bytes]: ... diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/jpeg.pyi b/python/helpers/typeshed/stubs/ExifRead/exifread/jpeg.pyi deleted file mode 100644 index 9b179150410d..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/exifread/jpeg.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from logging import Logger - -from ._types import Reader - -logger: Logger - -def find_jpeg_exif(fh: Reader, data: bytes, fake_exif: bool) -> tuple[int, bytes, bool]: ... diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/__init__.pyi b/python/helpers/typeshed/stubs/ExifRead/exifread/tags/__init__.pyi deleted file mode 100644 index ce0670d24c74..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/__init__.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from _typeshed import Incomplete - -from exifread.tags.exif import EXIF_TAGS as EXIF_TAGS -from exifread.tags.makernote import ( - apple as apple, - canon as canon, - casio as casio, - fujifilm as fujifilm, - nikon as nikon, - olympus as olympus, -) - -DEFAULT_STOP_TAG: str -FIELD_TYPES: Incomplete -IGNORE_TAGS: Incomplete diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/exif.pyi b/python/helpers/typeshed/stubs/ExifRead/exifread/tags/exif.pyi deleted file mode 100644 index 569609e93fb3..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/exif.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from exifread._types import TagDict - -INTEROP_TAGS: TagDict -INTEROP_INFO: tuple[str, TagDict] -GPS_TAGS: TagDict -GPS_INFO: tuple[str, TagDict] -EXIF_TAGS: TagDict diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/apple.pyi b/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/apple.pyi deleted file mode 100644 index c72072637e49..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/apple.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from exifread._types import TagDict - -TAGS: TagDict diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/canon.pyi b/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/canon.pyi deleted file mode 100644 index 97d4f93c5309..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/canon.pyi +++ /dev/null @@ -1,26 +0,0 @@ -from collections.abc import Callable -from typing import Any -from typing_extensions import TypeAlias - -from exifread._types import TagDict - -TAGS: TagDict - -CAMERA_SETTINGS: TagDict -FOCAL_LENGTH: TagDict -SHOT_INFO: TagDict -AF_INFO_2: TagDict -FILE_INFO: TagDict - -def add_one(value: int) -> int: ... -def subtract_one(value: int) -> int: ... -def convert_temp(value: int) -> str: ... - -_CameraInfo: TypeAlias = dict[int, tuple[str, str, Callable[[int], Any]]] - -CAMERA_INFO_TAG_NAME: str -CAMERA_INFO_5D: _CameraInfo -CAMERA_INFO_5DMKII: _CameraInfo -CAMERA_INFO_5DMKIII: _CameraInfo -CAMERA_INFO_600D: _CameraInfo -CAMERA_INFO_MODEL_MAP: dict[str, _CameraInfo] diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/casio.pyi b/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/casio.pyi deleted file mode 100644 index c72072637e49..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/casio.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from exifread._types import TagDict - -TAGS: TagDict diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/fujifilm.pyi b/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/fujifilm.pyi deleted file mode 100644 index c72072637e49..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/fujifilm.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from exifread._types import TagDict - -TAGS: TagDict diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/nikon.pyi b/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/nikon.pyi deleted file mode 100644 index ffa7101f5df4..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/nikon.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from exifread._types import TagDict - -def ev_bias(seq: list[int]) -> str: ... - -TAGS_NEW: TagDict -TAGS_OLD: TagDict diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/olympus.pyi b/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/olympus.pyi deleted file mode 100644 index 0744c773824f..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/olympus.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from exifread._types import TagDict - -def special_mode(val: bytes) -> str: ... - -TAGS: TagDict -TAG_0x2020: TagDict diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/utils.pyi b/python/helpers/typeshed/stubs/ExifRead/exifread/utils.pyi deleted file mode 100644 index 1dace202cbd2..000000000000 --- a/python/helpers/typeshed/stubs/ExifRead/exifread/utils.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from collections.abc import Mapping -from fractions import Fraction -from typing import Any, TypeVar, overload -from typing_extensions import Self - -_T = TypeVar("_T") - -@overload -def ord_(dta: str) -> int: ... -@overload -def ord_(dta: _T) -> _T: ... -def make_string(seq: str | list[int]) -> str: ... -def make_string_uc(seq: str | list[int]) -> str: ... -def get_gps_coords(tags: Mapping[str, Any]) -> tuple[float, float]: ... - -class Ratio(Fraction): - def __new__(cls, numerator: int = 0, denominator: int | None = None) -> Self: ... - @property - def num(self) -> int: ... - @property - def den(self) -> int: ... - def decimal(self) -> float: ... diff --git a/python/helpers/typeshed/stubs/Markdown/METADATA.toml b/python/helpers/typeshed/stubs/Markdown/METADATA.toml index 9a121e5aeb0d..348b7b26267e 100644 --- a/python/helpers/typeshed/stubs/Markdown/METADATA.toml +++ b/python/helpers/typeshed/stubs/Markdown/METADATA.toml @@ -1,2 +1,2 @@ -version = "3.9.*" +version = "3.10.*" upstream_repository = "https://github.com/Python-Markdown/markdown" diff --git a/python/helpers/typeshed/stubs/Markdown/markdown/htmlparser.pyi b/python/helpers/typeshed/stubs/Markdown/markdown/htmlparser.pyi index c9319565b921..3e6fbfa305aa 100644 --- a/python/helpers/typeshed/stubs/Markdown/markdown/htmlparser.pyi +++ b/python/helpers/typeshed/stubs/Markdown/markdown/htmlparser.pyi @@ -6,6 +6,8 @@ from collections.abc import Sequence from markdown import Markdown spec: ModuleSpec +commentclose: re.Pattern[str] +commentabruptclose: re.Pattern[str] blank_line_re: re.Pattern[str] class HTMLExtractor(htmlparser.HTMLParser): diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/console.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/console.pyi index 0de5c60fba94..ea9baa94f987 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/console.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/console.pyi @@ -1,9 +1,9 @@ -from typing import Any +from _typeshed import Incomplete esc: str -codes: Any -dark_colors: Any -light_colors: Any +codes: Incomplete +dark_colors: Incomplete +light_colors: Incomplete def reset_color(): ... def colorize(color_key, text): ... diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/filter.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/filter.pyi index d11b994f87fa..917273f6bcc7 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/filter.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/filter.pyi @@ -1,5 +1,5 @@ +from _typeshed import Incomplete from collections.abc import Iterable, Iterator -from typing import Any from pygments.lexer import Lexer from pygments.token import _TokenType @@ -8,11 +8,11 @@ def apply_filters(stream, filters, lexer=None): ... def simplefilter(f): ... class Filter: - options: Any + options: Incomplete def __init__(self, **options) -> None: ... def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... class FunctionFilter(Filter): - function: Any + function: Incomplete def __init__(self, **options) -> None: ... def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/filters/__init__.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/filters/__init__.pyi index 05325c8c63d2..ee98372d3fad 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/filters/__init__.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/filters/__init__.pyi @@ -1,5 +1,5 @@ +from _typeshed import Incomplete from collections.abc import Generator, Iterable, Iterator -from typing import Any from pygments.filter import Filter from pygments.lexer import Lexer @@ -7,46 +7,46 @@ from pygments.token import _TokenType def find_filter_class(filtername): ... def get_filter_by_name(filtername, **options): ... -def get_all_filters() -> Generator[str, None, None]: ... +def get_all_filters() -> Generator[str]: ... class CodeTagFilter(Filter): - tag_re: Any + tag_re: Incomplete def __init__(self, **options) -> None: ... def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... class SymbolFilter(Filter): - latex_symbols: Any - isabelle_symbols: Any - lang_map: Any - symbols: Any + 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]]: ... class KeywordCaseFilter(Filter): - convert: Any + convert: Incomplete def __init__(self, **options) -> None: ... def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... class NameHighlightFilter(Filter): - names: Any - tokentype: Any + names: Incomplete + tokentype: Incomplete def __init__(self, **options) -> None: ... def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... class ErrorToken(Exception): ... class RaiseOnErrorTokenFilter(Filter): - exception: Any + exception: Incomplete def __init__(self, **options) -> None: ... def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... class VisibleWhitespaceFilter(Filter): - wstt: Any + wstt: Incomplete def __init__(self, **options) -> None: ... def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... class GobbleFilter(Filter): - n: Any + 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]]: ... @@ -55,4 +55,4 @@ class TokenMergeFilter(Filter): def __init__(self, **options) -> None: ... def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ... -FILTERS: Any +FILTERS: Incomplete diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/formatter.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/formatter.pyi index f13948978eb4..254f68529f33 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/formatter.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/formatter.pyi @@ -1,17 +1,18 @@ -from typing import Any, Generic, TypeVar, overload +from _typeshed import Incomplete +from typing import Generic, TypeVar, overload _T = TypeVar("_T", str, bytes) class Formatter(Generic[_T]): - name: Any - aliases: Any - filenames: Any + name: Incomplete + aliases: Incomplete + filenames: Incomplete unicodeoutput: bool - style: Any - full: Any - title: Any - encoding: Any - options: Any + style: Incomplete + full: Incomplete + title: Incomplete + encoding: Incomplete + options: Incomplete @overload def __init__(self: Formatter[str], *, encoding: None = None, outencoding: None = None, **options) -> None: ... @overload diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/__init__.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/__init__.pyi index 09fc071c813c..f1b275f58f0f 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/__init__.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/__init__.pyi @@ -1,5 +1,5 @@ +from _typeshed import Incomplete from collections.abc import Generator -from typing import Any from ..formatter import Formatter from .bbcode import BBCodeFormatter as BBCodeFormatter @@ -19,7 +19,7 @@ from .svg import SvgFormatter as SvgFormatter from .terminal import TerminalFormatter as TerminalFormatter from .terminal256 import Terminal256Formatter as Terminal256Formatter, TerminalTrueColorFormatter as TerminalTrueColorFormatter -def get_all_formatters() -> Generator[type[Formatter[Any]], None, None]: ... +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): ... def get_formatter_for_filename(fn, **options): ... diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/_mapping.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/_mapping.pyi index a9e5864b9cfe..4ca06c4415b0 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/_mapping.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/_mapping.pyi @@ -1,3 +1,3 @@ -from typing import Any +from _typeshed import Incomplete -FORMATTERS: Any +FORMATTERS: Incomplete diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/bbcode.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/bbcode.pyi index df1708bec27a..26758a014638 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/bbcode.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/bbcode.pyi @@ -1,4 +1,5 @@ -from typing import Any, TypeVar +from _typeshed import Incomplete +from typing import TypeVar from pygments.formatter import Formatter @@ -6,7 +7,7 @@ _T = TypeVar("_T", str, bytes) class BBCodeFormatter(Formatter[_T]): name: str - aliases: Any - filenames: Any - styles: Any + aliases: Incomplete + filenames: Incomplete + styles: Incomplete def format_unencoded(self, tokensource, outfile) -> None: ... diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/html.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/html.pyi index 234ff59e1dd1..5d5c78f4bebd 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/html.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/html.pyi @@ -1,4 +1,5 @@ -from typing import Any, TypeVar +from _typeshed import Incomplete +from typing import TypeVar from pygments.formatter import Formatter @@ -6,32 +7,32 @@ _T = TypeVar("_T", str, bytes) class HtmlFormatter(Formatter[_T]): name: str - aliases: Any - filenames: Any - title: Any - nowrap: Any - noclasses: Any - classprefix: Any - cssclass: Any - cssstyles: Any - prestyles: Any - cssfile: Any - noclobber_cssfile: Any - tagsfile: Any - tagurlformat: Any - filename: Any - wrapcode: Any - span_element_openers: Any + aliases: Incomplete + filenames: Incomplete + title: Incomplete + nowrap: Incomplete + noclasses: Incomplete + classprefix: Incomplete + cssclass: Incomplete + cssstyles: Incomplete + prestyles: Incomplete + cssfile: Incomplete + noclobber_cssfile: Incomplete + tagsfile: Incomplete + tagurlformat: Incomplete + filename: Incomplete + wrapcode: Incomplete + span_element_openers: Incomplete linenos: int - linenostart: Any - linenostep: Any - linenospecial: Any - nobackground: Any - lineseparator: Any - lineanchors: Any - linespans: Any - anchorlinenos: Any - hl_lines: Any + linenostart: Incomplete + linenostep: Incomplete + linenospecial: Incomplete + nobackground: Incomplete + lineseparator: Incomplete + lineanchors: Incomplete + linespans: Incomplete + anchorlinenos: Incomplete + hl_lines: Incomplete def get_style_defs(self, arg=None): ... def get_token_style_defs(self, arg=None): ... def get_background_style_defs(self, arg=None): ... diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/img.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/img.pyi index 67310cfd2e2a..68b30d1890bc 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/img.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/img.pyi @@ -1,4 +1,5 @@ -from typing import Any, TypeVar +from _typeshed import Incomplete +from typing import TypeVar from pygments.formatter import Formatter @@ -8,10 +9,10 @@ class PilNotAvailable(ImportError): ... class FontNotFound(Exception): ... class FontManager: - font_name: Any - font_size: Any - fonts: Any - encoding: Any + font_name: Incomplete + font_size: Incomplete + fonts: Incomplete + encoding: Incomplete variable: bool def __init__(self, font_name, font_size: int = 14) -> None: ... def get_char_size(self): ... @@ -21,48 +22,48 @@ class FontManager: class ImageFormatter(Formatter[_T]): name: str - aliases: Any - filenames: Any + aliases: Incomplete + filenames: Incomplete unicodeoutput: bool default_image_format: str encoding: str - styles: Any + styles: Incomplete background_color: str - image_format: Any - image_pad: Any - line_pad: Any - fonts: Any - line_number_fg: Any - line_number_bg: Any - line_number_chars: Any - line_number_bold: Any - line_number_italic: Any - line_number_pad: Any - line_numbers: Any - line_number_separator: Any - line_number_step: Any - line_number_start: Any - line_number_width: Any - hl_lines: Any - hl_color: Any - drawables: Any + image_format: Incomplete + image_pad: Incomplete + line_pad: Incomplete + fonts: Incomplete + line_number_fg: Incomplete + line_number_bg: Incomplete + line_number_chars: Incomplete + line_number_bold: Incomplete + line_number_italic: Incomplete + line_number_pad: Incomplete + line_numbers: Incomplete + line_number_separator: Incomplete + line_number_step: Incomplete + line_number_start: Incomplete + line_number_width: Incomplete + hl_lines: Incomplete + hl_color: Incomplete + drawables: Incomplete def get_style_defs(self, arg: str = "") -> None: ... def format(self, tokensource, outfile) -> None: ... class GifImageFormatter(ImageFormatter[_T]): name: str - aliases: Any - filenames: Any + aliases: Incomplete + filenames: Incomplete default_image_format: str class JpgImageFormatter(ImageFormatter[_T]): name: str - aliases: Any - filenames: Any + aliases: Incomplete + filenames: Incomplete default_image_format: str class BmpImageFormatter(ImageFormatter[_T]): name: str - aliases: Any - filenames: Any + aliases: Incomplete + filenames: Incomplete default_image_format: str diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/irc.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/irc.pyi index 7af728d1445c..00b45e671e70 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/irc.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/irc.pyi @@ -1,4 +1,5 @@ -from typing import Any, TypeVar +from _typeshed import Incomplete +from typing import TypeVar from pygments.formatter import Formatter @@ -6,9 +7,9 @@ _T = TypeVar("_T", str, bytes) class IRCFormatter(Formatter[_T]): name: str - aliases: Any - filenames: Any - darkbg: Any - colorscheme: Any - linenos: Any + aliases: Incomplete + filenames: Incomplete + darkbg: Incomplete + colorscheme: Incomplete + linenos: Incomplete def format_unencoded(self, tokensource, outfile) -> None: ... diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/latex.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/latex.pyi index 1cdbf7b2c076..be793c6662b2 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/latex.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/latex.pyi @@ -1,4 +1,5 @@ -from typing import Any, TypeVar +from _typeshed import Incomplete +from typing import TypeVar from pygments.formatter import Formatter from pygments.lexer import Lexer @@ -7,28 +8,28 @@ _T = TypeVar("_T", str, bytes) class LatexFormatter(Formatter[_T]): name: str - aliases: Any - filenames: Any - docclass: Any - preamble: Any - linenos: Any - linenostart: Any - linenostep: Any - verboptions: Any - nobackground: Any - commandprefix: Any - texcomments: Any - mathescape: Any - escapeinside: Any - left: Any - right: Any - envname: Any + aliases: Incomplete + filenames: Incomplete + docclass: Incomplete + preamble: Incomplete + linenos: Incomplete + linenostart: Incomplete + linenostep: Incomplete + verboptions: Incomplete + nobackground: Incomplete + commandprefix: Incomplete + texcomments: Incomplete + mathescape: Incomplete + escapeinside: Incomplete + left: Incomplete + right: Incomplete + envname: Incomplete def get_style_defs(self, arg: str = ""): ... def format_unencoded(self, tokensource, outfile) -> None: ... class LatexEmbeddedLexer(Lexer): - left: Any - right: Any - lang: Any + left: Incomplete + right: Incomplete + lang: Incomplete def __init__(self, left, right, lang, **options) -> None: ... def get_tokens_unprocessed(self, text): ... diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/other.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/other.pyi index b3f42c323c09..44b16833aaf4 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/other.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/other.pyi @@ -1,4 +1,5 @@ -from typing import Any, TypeVar +from _typeshed import Incomplete +from typing import TypeVar from pygments.formatter import Formatter @@ -6,21 +7,21 @@ _T = TypeVar("_T", str, bytes) class NullFormatter(Formatter[_T]): name: str - aliases: Any - filenames: Any + aliases: Incomplete + filenames: Incomplete def format(self, tokensource, outfile) -> None: ... class RawTokenFormatter(Formatter[bytes]): name: str - aliases: Any - filenames: Any + aliases: Incomplete + filenames: Incomplete unicodeoutput: bool encoding: str - compress: Any - error_color: Any + compress: Incomplete + error_color: Incomplete def format(self, tokensource, outfile) -> None: ... class TestcaseFormatter(Formatter[_T]): name: str - aliases: Any + aliases: Incomplete def format(self, tokensource, outfile) -> None: ... diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/pangomarkup.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/pangomarkup.pyi index d266bbe3f295..aadc1747327c 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/pangomarkup.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/pangomarkup.pyi @@ -1,4 +1,5 @@ -from typing import Any, TypeVar +from _typeshed import Incomplete +from typing import TypeVar from pygments.formatter import Formatter @@ -6,7 +7,7 @@ _T = TypeVar("_T", str, bytes) class PangoMarkupFormatter(Formatter[_T]): name: str - aliases: Any - filenames: Any - styles: Any + aliases: Incomplete + filenames: Incomplete + styles: Incomplete def format_unencoded(self, tokensource, outfile) -> None: ... diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/rtf.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/rtf.pyi index 900f43d6f38b..da95cd0d1dfd 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/rtf.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/rtf.pyi @@ -1,4 +1,5 @@ -from typing import Any, TypeVar +from _typeshed import Incomplete +from typing import TypeVar from pygments.formatter import Formatter @@ -6,8 +7,8 @@ _T = TypeVar("_T", str, bytes) class RtfFormatter(Formatter[_T]): name: str - aliases: Any - filenames: Any - fontface: Any - fontsize: Any + aliases: Incomplete + filenames: Incomplete + fontface: Incomplete + fontsize: Incomplete def format_unencoded(self, tokensource, outfile) -> None: ... diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/svg.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/svg.pyi index f349157c0cc5..8f98d0bbf1cb 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/svg.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/svg.pyi @@ -1,4 +1,5 @@ -from typing import Any, TypeVar +from _typeshed import Incomplete +from typing import TypeVar from pygments.formatter import Formatter @@ -6,17 +7,17 @@ _T = TypeVar("_T", str, bytes) class SvgFormatter(Formatter[_T]): name: str - aliases: Any - filenames: Any - nowrap: Any - fontfamily: Any - fontsize: Any - xoffset: Any - yoffset: Any - ystep: Any - spacehack: Any - linenos: Any - linenostart: Any - linenostep: Any - linenowidth: Any + aliases: Incomplete + filenames: Incomplete + nowrap: Incomplete + fontfamily: Incomplete + fontsize: Incomplete + xoffset: Incomplete + yoffset: Incomplete + ystep: Incomplete + spacehack: Incomplete + linenos: Incomplete + linenostart: Incomplete + linenostep: Incomplete + linenowidth: Incomplete def format_unencoded(self, tokensource, outfile) -> None: ... diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/terminal.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/terminal.pyi index 7448f17a695d..90ca462d6b72 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/terminal.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/terminal.pyi @@ -1,4 +1,5 @@ -from typing import Any, TypeVar +from _typeshed import Incomplete +from typing import TypeVar from pygments.formatter import Formatter @@ -6,10 +7,10 @@ _T = TypeVar("_T", str, bytes) class TerminalFormatter(Formatter[_T]): name: str - aliases: Any - filenames: Any - darkbg: Any - colorscheme: Any - linenos: Any + aliases: Incomplete + filenames: Incomplete + darkbg: Incomplete + colorscheme: Incomplete + linenos: Incomplete def format(self, tokensource, outfile): ... def format_unencoded(self, tokensource, outfile) -> None: ... diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/terminal256.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/terminal256.pyi index e494e05467c8..33f17c176f78 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/formatters/terminal256.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/formatters/terminal256.pyi @@ -1,15 +1,16 @@ -from typing import Any, TypeVar +from _typeshed import Incomplete +from typing import TypeVar from pygments.formatter import Formatter _T = TypeVar("_T", str, bytes) class EscapeSequence: - fg: Any - bg: Any - bold: Any - underline: Any - italic: Any + fg: Incomplete + bg: Incomplete + bold: Incomplete + underline: Incomplete + italic: Incomplete def __init__(self, fg=None, bg=None, bold: bool = False, underline: bool = False, italic: bool = False) -> None: ... def escape(self, attrs): ... def color_string(self): ... @@ -18,19 +19,19 @@ class EscapeSequence: class Terminal256Formatter(Formatter[_T]): name: str - aliases: Any - filenames: Any - xterm_colors: Any - best_match: Any - style_string: Any - usebold: Any - useunderline: Any - useitalic: Any - linenos: Any + aliases: Incomplete + filenames: Incomplete + xterm_colors: Incomplete + best_match: Incomplete + style_string: Incomplete + usebold: Incomplete + 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: Any - filenames: Any + aliases: Incomplete + filenames: Incomplete diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/lexers/__init__.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/lexers/__init__.pyi index 128c5dcaf71b..3463d6a6e452 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/lexers/__init__.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/lexers/__init__.pyi @@ -1,19 +1,18 @@ from _typeshed import FileDescriptorOrPath, StrPath from collections.abc import Iterator -from typing import Any from pygments.lexer import Lexer, LexerMeta 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 get_lexer_by_name(_alias: str, **options: Any) -> Lexer: ... -def load_lexer_from_file(filename: FileDescriptorOrPath, lexername: str = "CustomLexer", **options: Any) -> 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 get_lexer_for_filename(_fn: StrPath, code: str | bytes | None = None, **options: Any) -> Lexer: ... -def get_lexer_for_mimetype(_mime: str, **options: Any) -> Lexer: ... -def guess_lexer_for_filename(_fn: StrPath, _text: str, **options: Any) -> Lexer: ... -def guess_lexer(_text: str | bytes, **options: Any) -> Lexer: ... +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: ... +def guess_lexer(_text: str | bytes, **options) -> Lexer: ... # Having every lexer class here doesn't seem to be worth it def __getattr__(name: str): ... # incomplete module diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/plugin.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/plugin.pyi index e47d66b02c53..25253818d781 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/plugin.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/plugin.pyi @@ -1,6 +1,6 @@ import sys +from _typeshed import Incomplete from collections.abc import Generator -from typing import Any from pygments.filter import Filter from pygments.formatter import Formatter @@ -21,7 +21,7 @@ else: def iter_entry_points(group_name: str) -> tuple[EntryPoint, ...] | list[EntryPoint]: ... -def find_plugin_lexers() -> Generator[type[Lexer], None, None]: ... -def find_plugin_formatters() -> Generator[tuple[str, type[Formatter[Any]]], None, None]: ... -def find_plugin_styles() -> Generator[tuple[str, type[Style]], None, None]: ... -def find_plugin_filters() -> Generator[tuple[str, type[Filter]], None, None]: ... +def find_plugin_lexers() -> Generator[type[Lexer]]: ... +def find_plugin_formatters() -> Generator[tuple[str, type[Formatter[Incomplete]]]]: ... +def find_plugin_styles() -> Generator[tuple[str, type[Style]]]: ... +def find_plugin_filters() -> Generator[tuple[str, type[Filter]]]: ... diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/regexopt.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/regexopt.pyi index 0d5b90a96a2b..f289a9950759 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/regexopt.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/regexopt.pyi @@ -1,7 +1,7 @@ -from typing import Any +from _typeshed import Incomplete -CS_ESCAPE: Any -FIRST_ELEMENT: Any +CS_ESCAPE: Incomplete +FIRST_ELEMENT: Incomplete def make_charset(letters): ... def regex_opt_inner(strings, open_paren): ... diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/scanner.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/scanner.pyi index df5c2c886fff..29fd64f876f4 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/scanner.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/scanner.pyi @@ -1,15 +1,15 @@ -from typing import Any +from _typeshed import Incomplete class EndOfText(RuntimeError): ... class Scanner: - data: Any - data_length: Any + data: Incomplete + data_length: Incomplete start_pos: int pos: int - flags: Any - last: Any - match: Any + flags: Incomplete + last: Incomplete + match: Incomplete def __init__(self, text, flags: int = 0) -> None: ... @property def eos(self): ... diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/unistring.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/unistring.pyi index 6dd2b3fcea26..bebf225e3634 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/unistring.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/unistring.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete Cc: str Cf: str @@ -32,7 +32,7 @@ Zp: str Zs: str xid_continue: str xid_start: str -cats: Any +cats: Incomplete def combine(*args): ... def allexcept(*args): ... diff --git a/python/helpers/typeshed/stubs/Pygments/pygments/util.pyi b/python/helpers/typeshed/stubs/Pygments/pygments/util.pyi index 963a810038a6..6a4076719ece 100644 --- a/python/helpers/typeshed/stubs/Pygments/pygments/util.pyi +++ b/python/helpers/typeshed/stubs/Pygments/pygments/util.pyi @@ -1,10 +1,10 @@ +from _typeshed import Incomplete from io import TextIOWrapper -from typing import Any -split_path_re: Any -doctype_lookup_re: Any -tag_re: Any -xml_decl_re: Any +split_path_re: Incomplete +doctype_lookup_re: Incomplete +tag_re: Incomplete +xml_decl_re: Incomplete class ClassNotFound(ValueError): ... class OptionError(Exception): ... diff --git a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/BufferedTokenStream.pyi b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/BufferedTokenStream.pyi index aeca2e341ed8..b6a2b43973fb 100644 --- a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/BufferedTokenStream.pyi +++ b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/BufferedTokenStream.pyi @@ -1,19 +1,18 @@ -from _typeshed import Incomplete - from antlr4.error.Errors import IllegalStateException as IllegalStateException +from antlr4.Lexer import Lexer as ActualLexer, TokenSource from antlr4.Token import Token as Token -Lexer: Incomplete +Lexer: None class TokenStream: ... class BufferedTokenStream(TokenStream): __slots__ = ("tokenSource", "tokens", "index", "fetchedEOF") - tokenSource: Incomplete - tokens: Incomplete + tokenSource: TokenSource + tokens: list[Token] index: int fetchedEOF: bool - def __init__(self, tokenSource: Lexer) -> None: ... + def __init__(self, tokenSource: ActualLexer | None) -> None: ... def mark(self) -> int: ... def release(self, marker: int) -> None: ... def reset(self) -> None: ... @@ -26,15 +25,15 @@ class BufferedTokenStream(TokenStream): def LA(self, i: int) -> int: ... def LB(self, k: int) -> Token | None: ... def LT(self, k: int) -> Token | None: ... - def adjustSeekIndex(self, i: int): ... + def adjustSeekIndex(self, i: int) -> int: ... def lazyInit(self) -> None: ... def setup(self) -> None: ... - def setTokenSource(self, tokenSource: Lexer): ... - def nextTokenOnChannel(self, i: int, channel: int): ... - def previousTokenOnChannel(self, i: int, channel: int): ... - def getHiddenTokensToRight(self, tokenIndex: int, channel: int = -1): ... - def getHiddenTokensToLeft(self, tokenIndex: int, channel: int = -1): ... - def filterForChannel(self, left: int, right: int, channel: int): ... - def getSourceName(self): ... - def getText(self, start: int | None = None, stop: int | None = None): ... + def setTokenSource(self, tokenSource: ActualLexer | None) -> None: ... + def nextTokenOnChannel(self, i: int, channel: int) -> int: ... + def previousTokenOnChannel(self, i: int, channel: int) -> int: ... + def getHiddenTokensToRight(self, tokenIndex: int, channel: int = -1) -> list[Token] | None: ... + def getHiddenTokensToLeft(self, tokenIndex: int, channel: int = -1) -> list[Token] | None: ... + def filterForChannel(self, left: int, right: int, channel: int) -> list[Token] | None: ... + def getSourceName(self) -> str: ... + def getText(self, start: int | None = None, stop: int | None = None) -> str: ... def fill(self) -> None: ... diff --git a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/CommonTokenFactory.pyi b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/CommonTokenFactory.pyi index 447f2a6f6274..e654055b7258 100644 --- a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/CommonTokenFactory.pyi +++ b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/CommonTokenFactory.pyi @@ -1,15 +1,23 @@ -from _typeshed import Incomplete - +from antlr4.InputStream import InputStream +from antlr4.Lexer import TokenSource from antlr4.Token import CommonToken as CommonToken class TokenFactory: ... class CommonTokenFactory(TokenFactory): __slots__ = "copyText" - DEFAULT: Incomplete - copyText: Incomplete + DEFAULT: CommonTokenFactory | None + copyText: bool def __init__(self, copyText: bool = False) -> None: ... def create( - self, source: tuple[Incomplete, ...], type: int, text: str, channel: int, start: int, stop: int, line: int, column: int - ): ... - def createThin(self, type: int, text: str): ... + self, + source: tuple[TokenSource, InputStream], + type: int, + text: str, + channel: int, + start: int, + stop: int, + line: int, + column: int, + ) -> CommonToken: ... + def createThin(self, type: int, text: str) -> CommonToken: ... diff --git a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/CommonTokenStream.pyi b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/CommonTokenStream.pyi index 304106cd8ba3..ad5d92d3bc9e 100644 --- a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/CommonTokenStream.pyi +++ b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/CommonTokenStream.pyi @@ -1,12 +1,10 @@ -from _typeshed import Incomplete - from antlr4.BufferedTokenStream import BufferedTokenStream as BufferedTokenStream from antlr4.Lexer import Lexer as Lexer from antlr4.Token import Token as Token class CommonTokenStream(BufferedTokenStream): __slots__ = "channel" - channel: Incomplete + channel: int def __init__(self, lexer: Lexer, channel: int = 0) -> None: ... def adjustSeekIndex(self, i: int) -> int: ... def LB(self, k: int) -> Token | None: ... diff --git a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/FileStream.pyi b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/FileStream.pyi index dc759a462f15..75ae77b2447b 100644 --- a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/FileStream.pyi +++ b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/FileStream.pyi @@ -1,9 +1,7 @@ -from _typeshed import Incomplete - from antlr4.InputStream import InputStream as InputStream class FileStream(InputStream): __slots__ = "fileName" - fileName: Incomplete + fileName: str def __init__(self, fileName: str, encoding: str = "ascii", errors: str = "strict") -> None: ... - def readDataFrom(self, fileName: str, encoding: str, errors: str = "strict"): ... + def readDataFrom(self, fileName: str, encoding: str, errors: str = "strict") -> str: ... diff --git a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/InputStream.pyi b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/InputStream.pyi index 3a5991e5ba94..c4afb48832d6 100644 --- a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/InputStream.pyi +++ b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/InputStream.pyi @@ -1,22 +1,24 @@ -from _typeshed import Incomplete +from typing import Literal from antlr4.Token import Token as Token class InputStream: __slots__ = ("name", "strdata", "_index", "data", "_size") name: str - strdata: Incomplete - data: Incomplete + strdata: str + data: list[int] + _index: int + _size: int def __init__(self, data: str) -> None: ... @property - def index(self): ... + def index(self) -> int: ... @property - def size(self): ... + def size(self) -> int: ... def reset(self) -> None: ... def consume(self) -> None: ... - def LA(self, offset: int): ... - def LT(self, offset: int): ... - def mark(self): ... - def release(self, marker: int): ... - def seek(self, _index: int): ... - def getText(self, start: int, stop: int): ... + def LA(self, offset: int) -> int: ... + def LT(self, offset: int) -> int: ... + def mark(self) -> Literal[-1]: ... + def release(self, marker: int) -> None: ... + def seek(self, _index: int) -> None: ... + def getText(self, start: int, stop: int) -> str: ... diff --git a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/Lexer.pyi b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/Lexer.pyi index 1ac2177ffbad..a2690aa7004b 100644 --- a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/Lexer.pyi +++ b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/Lexer.pyi @@ -1,4 +1,3 @@ -from _typeshed import Incomplete from typing import TextIO from antlr4.atn.LexerATNSimulator import LexerATNSimulator as LexerATNSimulator @@ -10,7 +9,7 @@ from antlr4.error.Errors import ( ) from antlr4.InputStream import InputStream as InputStream from antlr4.Recognizer import Recognizer as Recognizer -from antlr4.Token import Token as Token +from antlr4.Token import CommonToken, Token as Token class TokenSource: ... @@ -34,47 +33,62 @@ class Lexer(Recognizer, TokenSource): DEFAULT_MODE: int MORE: int SKIP: int - DEFAULT_TOKEN_CHANNEL: Incomplete - HIDDEN: Incomplete + DEFAULT_TOKEN_CHANNEL: int + HIDDEN: int MIN_CHAR_VALUE: int MAX_CHAR_VALUE: int + _input: InputStream + _output: TextIO + _factory: CommonTokenFactory + _tokenFactorySourcePair: tuple[TokenSource, InputStream] + _interp: LexerATNSimulator + _token: Token | None + _tokenStartCharIndex: int + _tokenStartLine: int + _tokenStartColumn: int + _hitEOF: bool + _channel: int + _type: int + _modeStack: list[int] + _mode: int + _text: str | None def __init__(self, input: InputStream, output: TextIO = ...) -> None: ... def reset(self) -> None: ... - def nextToken(self): ... + def nextToken(self) -> Token | None: ... def skip(self) -> None: ... def more(self) -> None: ... - def mode(self, m: int): ... - def pushMode(self, m: int): ... - def popMode(self): ... + def mode(self, m: int) -> None: ... + def pushMode(self, m: int) -> None: ... + def popMode(self) -> int: ... @property - def inputStream(self): ... + def inputStream(self) -> InputStream: ... @inputStream.setter - def inputStream(self, input: InputStream): ... + def inputStream(self, input: InputStream) -> None: ... @property - def sourceName(self): ... - def emitToken(self, token: Token): ... - def emit(self): ... - def emitEOF(self): ... + def sourceName(self) -> str: ... + def emitToken(self, token: Token) -> None: ... + def emit(self) -> CommonToken: ... + def emitEOF(self) -> CommonToken: ... @property - def type(self): ... + def type(self) -> int: ... @type.setter - def type(self, type: int): ... + def type(self, type: int) -> None: ... @property - def line(self): ... + def line(self) -> int: ... @line.setter - def line(self, line: int): ... + def line(self, line: int) -> None: ... @property - def column(self): ... + def column(self) -> int: ... @column.setter - def column(self, column: int): ... - def getCharIndex(self): ... + def column(self, column: int) -> None: ... + def getCharIndex(self) -> int: ... @property - def text(self): ... + def text(self) -> str: ... @text.setter - def text(self, txt: str): ... - def getAllTokens(self): ... - def notifyListeners(self, e: LexerNoViableAltException): ... - def getErrorDisplay(self, s: str): ... - def getErrorDisplayForChar(self, c: str): ... - def getCharErrorDisplay(self, c: str): ... - def recover(self, re: RecognitionException): ... + def text(self, txt: str) -> None: ... + def getAllTokens(self) -> list[Token]: ... + def notifyListeners(self, e: LexerNoViableAltException) -> None: ... + def getErrorDisplay(self, s: str) -> str: ... + def getErrorDisplayForChar(self, c: str) -> str: ... + def getCharErrorDisplay(self, c: str) -> str: ... + def recover(self, re: RecognitionException) -> None: ... diff --git a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/Parser.pyi b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/Parser.pyi index 42cf6443cc97..3e4409dba8af 100644 --- a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/Parser.pyi +++ b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/Parser.pyi @@ -1,8 +1,9 @@ from _typeshed import Incomplete -from typing import TextIO +from typing import Literal, TextIO from antlr4.atn.ATNDeserializationOptions import ATNDeserializationOptions as ATNDeserializationOptions from antlr4.atn.ATNDeserializer import ATNDeserializer as ATNDeserializer +from antlr4.atn.ParserATNSimulator import ParserATNSimulator from antlr4.BufferedTokenStream import TokenStream as TokenStream from antlr4.CommonTokenFactory import TokenFactory as TokenFactory from antlr4.error.Errors import ( @@ -16,6 +17,7 @@ from antlr4.ParserRuleContext import ParserRuleContext as ParserRuleContext from antlr4.Recognizer import Recognizer as Recognizer from antlr4.RuleContext import RuleContext as RuleContext from antlr4.Token import Token as Token +from antlr4.tree.ParseTreePattern import ParseTreePattern from antlr4.tree.ParseTreePatternMatcher import ParseTreePatternMatcher as ParseTreePatternMatcher from antlr4.tree.Tree import ErrorNode as ErrorNode, ParseTreeListener as ParseTreeListener, TerminalNode as TerminalNode @@ -39,48 +41,59 @@ class Parser(Recognizer): "_parseListeners", "_syntaxErrors", ) - bypassAltsAtnCache: Incomplete + _input: TokenStream + _output: TextIO + _errHandler: DefaultErrorStrategy + _precedenceStack: list[int] + _ctx: ParserRuleContext | None + _tracer: TraceListener | None + _parseListeners: list[ParseTreeListener] + _syntaxErrors: int + _interp: ParserATNSimulator + bypassAltsAtnCache: dict[Incomplete, Incomplete] buildParseTrees: bool def __init__(self, input: TokenStream, output: TextIO = ...) -> None: ... def reset(self) -> None: ... - def match(self, ttype: int): ... - def matchWildcard(self): ... - def getParseListeners(self): ... - def addParseListener(self, listener: ParseTreeListener): ... - def removeParseListener(self, listener: ParseTreeListener): ... + def match(self, ttype: int) -> Token: ... + def matchWildcard(self) -> Token: ... + def getParseListeners(self) -> list[ParseTreeListener]: ... + def addParseListener(self, listener: ParseTreeListener) -> None: ... + def removeParseListener(self, listener: ParseTreeListener) -> None: ... def removeParseListeners(self) -> None: ... def triggerEnterRuleEvent(self) -> None: ... def triggerExitRuleEvent(self) -> None: ... - def getNumberOfSyntaxErrors(self): ... - def getTokenFactory(self): ... - def setTokenFactory(self, factory: TokenFactory): ... + def getNumberOfSyntaxErrors(self) -> int: ... + def getTokenFactory(self) -> TokenFactory: ... + def setTokenFactory(self, factory: TokenFactory) -> None: ... def getATNWithBypassAlts(self): ... - def compileParseTreePattern(self, pattern: str, patternRuleIndex: int, lexer: Lexer | None = None): ... - def getInputStream(self): ... - def setInputStream(self, input: InputStream): ... - def getTokenStream(self): ... - def setTokenStream(self, input: TokenStream): ... - def getCurrentToken(self): ... - def notifyErrorListeners(self, msg: str, offendingToken: Token | None = None, e: RecognitionException | None = None): ... - def consume(self): ... + def compileParseTreePattern(self, pattern: str, patternRuleIndex: int, lexer: Lexer | None = None) -> ParseTreePattern: ... + def getInputStream(self) -> InputStream: ... + def setInputStream(self, input: InputStream) -> None: ... + def getTokenStream(self) -> TokenStream: ... + def setTokenStream(self, input: TokenStream) -> None: ... + def getCurrentToken(self) -> Token | None: ... + def notifyErrorListeners( + self, msg: str, offendingToken: Token | None = None, e: RecognitionException | None = None + ) -> None: ... + def consume(self) -> None: ... def addContextToParseTree(self) -> None: ... - state: Incomplete - def enterRule(self, localctx: ParserRuleContext, state: int, ruleIndex: int): ... + state: int + def enterRule(self, localctx: ParserRuleContext, state: int, ruleIndex: int) -> None: ... def exitRule(self) -> None: ... - def enterOuterAlt(self, localctx: ParserRuleContext, altNum: int): ... - def getPrecedence(self): ... - def enterRecursionRule(self, localctx: ParserRuleContext, state: int, ruleIndex: int, precedence: int): ... - def pushNewRecursionContext(self, localctx: ParserRuleContext, state: int, ruleIndex: int): ... - def unrollRecursionContexts(self, parentCtx: ParserRuleContext): ... - def getInvokingContext(self, ruleIndex: int): ... - def precpred(self, localctx: RuleContext, precedence: int): ... - def inContext(self, context: str): ... - def isExpectedToken(self, symbol: int): ... + def enterOuterAlt(self, localctx: ParserRuleContext, altNum: int) -> None: ... + def getPrecedence(self) -> int: ... + def enterRecursionRule(self, localctx: ParserRuleContext, state: int, ruleIndex: int, precedence: int) -> None: ... + def pushNewRecursionContext(self, localctx: ParserRuleContext, state: int, ruleIndex: int) -> None: ... + def unrollRecursionContexts(self, parentCtx: ParserRuleContext) -> None: ... + def getInvokingContext(self, ruleIndex: int) -> RuleContext | None: ... + def precpred(self, localctx: RuleContext, precedence: int) -> bool: ... + def inContext(self, context: str) -> Literal[False]: ... + def isExpectedToken(self, symbol: int) -> bool: ... def getExpectedTokens(self): ... def getExpectedTokensWithinCurrentRule(self): ... - def getRuleIndex(self, ruleName: str): ... - def getRuleInvocationStack(self, p: RuleContext | None = None): ... - def getDFAStrings(self): ... + def getRuleIndex(self, ruleName: str) -> int: ... + def getRuleInvocationStack(self, p: RuleContext | None = None) -> list[str]: ... + def getDFAStrings(self) -> list[str]: ... def dumpDFA(self) -> None: ... - def getSourceName(self): ... - def setTrace(self, trace: bool): ... + def getSourceName(self) -> str: ... + def setTrace(self, trace: bool) -> None: ... diff --git a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/ParserInterpreter.pyi b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/ParserInterpreter.pyi index b7dabbc4aa33..121045923a2e 100644 --- a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/ParserInterpreter.pyi +++ b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/ParserInterpreter.pyi @@ -28,19 +28,19 @@ class ParserInterpreter(Parser): "_parentContextStack", "pushRecursionContextStates", ) - grammarFileName: Incomplete - atn: Incomplete - tokenNames: Incomplete - ruleNames: Incomplete - decisionToDFA: Incomplete - sharedContextCache: Incomplete - pushRecursionContextStates: Incomplete + grammarFileName: str + atn: ATN + tokenNames: list[Incomplete] + ruleNames: list[str] + decisionToDFA: list[DFA] + sharedContextCache: PredictionContextCache + pushRecursionContextStates: set[int] def __init__( self, grammarFileName: str, tokenNames: list[str], ruleNames: list[str], atn: ATN, input: TokenStream ) -> None: ... - state: Incomplete - def parse(self, startRuleIndex: int): ... - def enterRecursionRule(self, localctx: ParserRuleContext, state: int, ruleIndex: int, precedence: int): ... - def getATNState(self): ... - def visitState(self, p: ATNState): ... - def visitRuleStopState(self, p: ATNState): ... + state: int + def parse(self, startRuleIndex: int) -> ParserRuleContext | None: ... + def enterRecursionRule(self, localctx: ParserRuleContext, state: int, ruleIndex: int, precedence: int) -> None: ... + def getATNState(self) -> ATNState: ... + def visitState(self, p: ATNState) -> None: ... + def visitRuleStopState(self, p: ATNState) -> None: ... diff --git a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/ParserRuleContext.pyi b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/ParserRuleContext.pyi index 73c5c5d752b4..ba07bd5fbe72 100644 --- a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/ParserRuleContext.pyi +++ b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/ParserRuleContext.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete -from collections.abc import Generator +from collections.abc import Callable, Generator +from typing import TypeVar +from antlr4.error.Errors import RecognitionException from antlr4.RuleContext import RuleContext as RuleContext from antlr4.Token import Token as Token from antlr4.tree.Tree import ( @@ -14,29 +15,35 @@ from antlr4.tree.Tree import ( class ParserRuleContext(RuleContext): __slots__ = ("children", "start", "stop", "exception") - children: Incomplete - start: Incomplete - stop: Incomplete - exception: Incomplete + children: list[ParseTree | TerminalNode] | None + start: Token | None + stop: Token | None + exception: RecognitionException | None def __init__(self, parent: ParserRuleContext | None = None, invokingStateNumber: int | None = None) -> None: ... - parentCtx: Incomplete - invokingState: Incomplete - def copyFrom(self, ctx: ParserRuleContext): ... - def enterRule(self, listener: ParseTreeListener): ... - def exitRule(self, listener: ParseTreeListener): ... - def addChild(self, child: ParseTree): ... + parentCtx: RuleContext | None + invokingState: int + def copyFrom(self, ctx: ParserRuleContext) -> None: ... + def enterRule(self, listener: ParseTreeListener) -> None: ... + def exitRule(self, listener: ParseTreeListener) -> None: ... + def addChild(self, child: _ParseTreeT) -> _ParseTreeT: ... def removeLastChild(self) -> None: ... - def addTokenNode(self, token: Token): ... - def addErrorNode(self, badToken: Token): ... - def getChild(self, i: int, ttype: type | None = None): ... - def getChildren(self, predicate=None) -> Generator[Incomplete, None, None]: ... - def getToken(self, ttype: int, i: int): ... - def getTokens(self, ttype: int): ... - def getTypedRuleContext(self, ctxType: type, i: int): ... - def getTypedRuleContexts(self, ctxType: type): ... - def getChildCount(self): ... - def getSourceInterval(self): ... + def addTokenNode(self, token: Token) -> TerminalNodeImpl: ... + def addErrorNode(self, badToken: Token) -> ErrorNodeImpl: ... + 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]: ... + 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: ... + def getTypedRuleContexts(self, ctxType: type[_ParserRuleContextT]) -> list[_ParserRuleContextT]: ... + def getChildCount(self) -> int: ... + def getSourceInterval(self) -> tuple[int | None, int | None]: ... + +_GenericType = TypeVar("_GenericType", bound=type) +_ParseTreeT = TypeVar("_ParseTreeT", bound=ParseTree) +_ParserRuleContextT = TypeVar("_ParserRuleContextT", bound=ParserRuleContext) class InterpreterRuleContext(ParserRuleContext): - ruleIndex: Incomplete + ruleIndex: int def __init__(self, parent: ParserRuleContext, invokingStateNumber: int, ruleIndex: int) -> None: ... diff --git a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/Recognizer.pyi b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/Recognizer.pyi index 5e9fcc8bc086..a13b195f2955 100644 --- a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/Recognizer.pyi +++ b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/Recognizer.pyi @@ -1,28 +1,37 @@ from _typeshed import Incomplete -from antlr4.error.ErrorListener import ConsoleErrorListener as ConsoleErrorListener, ProxyErrorListener as ProxyErrorListener +from antlr4.atn.ATNSimulator import ATNSimulator +from antlr4.error.ErrorListener import ( + ConsoleErrorListener as ConsoleErrorListener, + ErrorListener, + ProxyErrorListener as ProxyErrorListener, +) +from antlr4.error.Errors import RecognitionException from antlr4.RuleContext import RuleContext as RuleContext from antlr4.Token import Token as Token class Recognizer: __slots__ = ("_listeners", "_interp", "_stateNumber") - tokenTypeMapCache: Incomplete - ruleIndexMapCache: Incomplete + tokenTypeMapCache: dict[Incomplete, int] + ruleIndexMapCache: dict[str, int] + _listeners: list[ErrorListener] + _interp: ATNSimulator | None + _stateNumber: int def __init__(self) -> None: ... - def extractVersion(self, version): ... - def checkVersion(self, toolVersion) -> None: ... - def addErrorListener(self, listener) -> None: ... - def removeErrorListener(self, listener) -> None: ... + def extractVersion(self, version: str) -> tuple[str, str]: ... + def checkVersion(self, toolVersion: str) -> None: ... + def addErrorListener(self, listener: ErrorListener) -> None: ... + def removeErrorListener(self, listener: ErrorListener) -> None: ... def removeErrorListeners(self) -> None: ... - def getTokenTypeMap(self): ... - def getRuleIndexMap(self): ... - def getTokenType(self, tokenName: str): ... - def getErrorHeader(self, e): ... - def getTokenErrorDisplay(self, t: Token): ... - def getErrorListenerDispatch(self): ... - def sempred(self, localctx: RuleContext, ruleIndex: int, actionIndex: int): ... - def precpred(self, localctx: RuleContext, precedence: int): ... + def getTokenTypeMap(self) -> dict[Incomplete, int]: ... + def getRuleIndexMap(self) -> dict[str, int]: ... + def getTokenType(self, tokenName: str) -> int: ... + def getErrorHeader(self, e: RecognitionException) -> str: ... + def getTokenErrorDisplay(self, t: Token | None) -> str: ... + def getErrorListenerDispatch(self) -> ProxyErrorListener: ... + def sempred(self, localctx: RuleContext, ruleIndex: int, actionIndex: int) -> bool: ... + def precpred(self, localctx: RuleContext, precedence: int) -> bool: ... @property - def state(self): ... + def state(self) -> int: ... @state.setter - def state(self, atnState: int): ... + def state(self, atnState: int) -> None: ... diff --git a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/RuleContext.pyi b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/RuleContext.pyi index c7bb19b4e31e..925e2f9fab3d 100644 --- a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/RuleContext.pyi +++ b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/RuleContext.pyi @@ -1,29 +1,31 @@ -from _typeshed import Incomplete from collections.abc import Generator +from typing import Any, Literal +from typing_extensions import Self +from antlr4.Recognizer import Recognizer from antlr4.tree.Tree import INVALID_INTERVAL as INVALID_INTERVAL, ParseTreeVisitor as ParseTreeVisitor, RuleNode as RuleNode from antlr4.tree.Trees import Trees as Trees -Parser: Incomplete +Parser: None class RuleContext(RuleNode): __slots__ = ("parentCtx", "invokingState") - EMPTY: Incomplete - parentCtx: Incomplete - invokingState: Incomplete + EMPTY: RuleContext | None + parentCtx: RuleContext | None + invokingState: int def __init__(self, parent: RuleContext | None = None, invokingState: int = -1) -> None: ... - def depth(self): ... - def isEmpty(self): ... - def getSourceInterval(self): ... - def getRuleContext(self): ... - def getPayload(self): ... - def getText(self): ... - def getRuleIndex(self): ... - def getAltNumber(self): ... - def setAltNumber(self, altNumber: int): ... - def getChild(self, i: int): ... - def getChildCount(self): ... - def getChildren(self) -> Generator[Incomplete, None, None]: ... - def accept(self, visitor: ParseTreeVisitor): ... - def toStringTree(self, ruleNames: list[Incomplete] | None = None, recog: Parser | None = None): ... - def toString(self, ruleNames: list[Incomplete], stop: RuleContext) -> str: ... + def depth(self) -> int: ... + def isEmpty(self) -> bool: ... + def getSourceInterval(self) -> tuple[int | None, int | None]: ... + def getRuleContext(self) -> Self: ... + def getPayload(self) -> Self: ... + def getText(self) -> str: ... + def getRuleIndex(self) -> Literal[-1]: ... + def getAltNumber(self) -> Literal[0]: ... + def setAltNumber(self, altNumber: int) -> None: ... + def getChild(self, i: int) -> Any: ... + def getChildCount(self) -> int: ... + def getChildren(self) -> Generator[Any, None, None]: ... + 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/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/Token.pyi b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/Token.pyi index 3ca3b3c58eee..acbab1f198b5 100644 --- a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/Token.pyi +++ b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/Token.pyi @@ -1,4 +1,5 @@ -from _typeshed import Incomplete +from antlr4.InputStream import InputStream +from antlr4.Lexer import TokenSource class Token: __slots__ = ("source", "type", "channel", "start", "stop", "tokenIndex", "line", "column", "_text") @@ -8,42 +9,42 @@ class Token: EOF: int DEFAULT_CHANNEL: int HIDDEN_CHANNEL: int - source: Incomplete - type: Incomplete - channel: Incomplete - start: Incomplete - stop: Incomplete - tokenIndex: Incomplete - line: Incomplete - column: Incomplete + source: tuple[TokenSource | None, InputStream | None] + type: int + channel: int + start: int + stop: int + tokenIndex: int | None + line: int + column: int def __init__(self) -> None: ... @property - def text(self): ... + def text(self) -> str: ... @text.setter - def text(self, text: str): ... - def getTokenSource(self): ... - def getInputStream(self): ... + def text(self, text: str) -> None: ... + def getTokenSource(self) -> TokenSource | None: ... + def getInputStream(self) -> InputStream | None: ... class CommonToken(Token): - EMPTY_SOURCE: Incomplete - source: Incomplete - type: Incomplete - channel: Incomplete - start: Incomplete - stop: Incomplete + EMPTY_SOURCE: tuple[None, None] + source: tuple[TokenSource | None, InputStream | None] + type: int + channel: int + start: int + stop: int tokenIndex: int - line: Incomplete - column: Incomplete + line: int + column: int def __init__( self, - source: tuple[Incomplete, Incomplete] = (None, None), + source: tuple[TokenSource | None, InputStream | None] = (None, None), type: int | None = None, channel: int = 0, start: int = -1, stop: int = -1, ) -> None: ... - def clone(self): ... + def clone(self) -> CommonToken: ... @property - def text(self): ... + def text(self) -> str: ... @text.setter - def text(self, text: str): ... + def text(self, text: str) -> None: ... diff --git a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/tree/Tree.pyi b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/tree/Tree.pyi index c50e70da5897..0eca91c7d868 100644 --- a/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/tree/Tree.pyi +++ b/python/helpers/typeshed/stubs/antlr4-python3-runtime/antlr4/tree/Tree.pyi @@ -1,5 +1,7 @@ from _typeshed import Incomplete +from typing import Any, Literal, TypeVar +from antlr4.ParserRuleContext import ParserRuleContext, RuleContext from antlr4.Token import Token as Token INVALID_INTERVAL: Incomplete @@ -11,42 +13,44 @@ class RuleNode(ParseTree): ... class TerminalNode(ParseTree): ... class ErrorNode(TerminalNode): ... +_GenericType = TypeVar("_GenericType", bound=type) + class ParseTreeVisitor: - def visit(self, tree): ... - def visitChildren(self, node): ... - def visitTerminal(self, node): ... - def visitErrorNode(self, node): ... + def visit(self, tree: Tree) -> None: ... + def visitChildren(self, node) -> None: ... + def visitTerminal(self, node: TerminalNode) -> None: ... + def visitErrorNode(self, node: ErrorNode) -> None: ... def defaultResult(self) -> None: ... - def aggregateResult(self, aggregate, nextResult): ... - def shouldVisitNextChild(self, node, currentResult): ... + def aggregateResult(self, aggregate, nextResult: _GenericType) -> _GenericType: ... + def shouldVisitNextChild(self, node, currentResult) -> Literal[True]: ... class ParseTreeListener: - def visitTerminal(self, node: TerminalNode): ... - def visitErrorNode(self, node: ErrorNode): ... - def enterEveryRule(self, ctx): ... - def exitEveryRule(self, ctx): ... + def visitTerminal(self, node: TerminalNode) -> None: ... + def visitErrorNode(self, node: ErrorNode) -> None: ... + def enterEveryRule(self, ctx: ParserRuleContext) -> None: ... + def exitEveryRule(self, ctx: ParserRuleContext) -> None: ... class TerminalNodeImpl(TerminalNode): __slots__ = ("parentCtx", "symbol") - parentCtx: Incomplete - symbol: Incomplete + parentCtx: RuleContext | None + symbol: Token def __init__(self, symbol: Token) -> None: ... - def __setattr__(self, key, value) -> None: ... - def getChild(self, i: int): ... - def getSymbol(self): ... - def getParent(self): ... - def getPayload(self): ... - def getSourceInterval(self): ... - def getChildCount(self): ... - def accept(self, visitor: ParseTreeVisitor): ... - def getText(self): ... + def __setattr__(self, key: str, value: Any) -> None: ... + def getChild(self, i: int) -> None: ... + def getSymbol(self) -> Token: ... + def getParent(self) -> RuleContext | None: ... + def getPayload(self) -> Token: ... + def getSourceInterval(self) -> tuple[Literal[-1], Literal[-2]] | tuple[int | None, int | None]: ... + def getChildCount(self) -> Literal[0]: ... + def accept(self, visitor: ParseTreeVisitor) -> None: ... + def getText(self) -> str: ... class ErrorNodeImpl(TerminalNodeImpl, ErrorNode): def __init__(self, token: Token) -> None: ... - def accept(self, visitor: ParseTreeVisitor): ... + def accept(self, visitor: ParseTreeVisitor) -> None: ... class ParseTreeWalker: - DEFAULT: Incomplete - def walk(self, listener: ParseTreeListener, t: ParseTree): ... - def enterRule(self, listener: ParseTreeListener, r: RuleNode): ... - def exitRule(self, listener: ParseTreeListener, r: RuleNode): ... + DEFAULT: ParseTreeWalker + def walk(self, listener: ParseTreeListener, t: ParseTree) -> None: ... + def enterRule(self, listener: ParseTreeListener, r: RuleNode) -> None: ... + def exitRule(self, listener: ParseTreeListener, r: RuleNode) -> None: ... diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/@tests/stubtest_allowlist.txt b/python/helpers/typeshed/stubs/aws-xray-sdk/@tests/stubtest_allowlist.txt index 75131498945f..0ccd2bd8b0ab 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/@tests/stubtest_allowlist.txt +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/@tests/stubtest_allowlist.txt @@ -1,6 +1,9 @@ aws_xray_sdk.core.models.subsegment.subsegment_decorator aws_xray_sdk.core.sampling.connector.ServiceConnector.fetch_sampling_rules +# Inconsistency because `context_missing` param can be passed in *args or **kwargs: +aws_xray_sdk.core.async_context.AsyncContext.__init__ + # We can not import 3rd-party libraries in teststubs runtime, # but we can use Protocol to replace this types: aws_xray_sdk.ext.aiobotocore diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/METADATA.toml b/python/helpers/typeshed/stubs/aws-xray-sdk/METADATA.toml index 67550f9adbcf..9dc0897df2d1 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/METADATA.toml +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/METADATA.toml @@ -1,2 +1,2 @@ -version = "2.14.*" +version = "2.15.*" upstream_repository = "https://github.com/aws/aws-xray-sdk-python" diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/async_context.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/async_context.pyi index 7579d0896224..85c366e821ee 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/async_context.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/async_context.pyi @@ -1,13 +1,23 @@ +from asyncio.events import AbstractEventLoop +from asyncio.tasks import Task, _TaskCompatibleCoro +from typing import Any, TypeVar + from .context import Context as _Context +_T_co = TypeVar("_T_co", covariant=True) + class AsyncContext(_Context): - def __init__(self, *args, loop=None, use_task_factory: bool = True, **kwargs) -> None: ... + def __init__( + self, context_missing: str = "LOG_ERROR", loop: AbstractEventLoop | None = None, use_task_factory: bool = True + ) -> None: ... def clear_trace_entities(self) -> None: ... class TaskLocalStorage: - def __init__(self, loop=None) -> None: ... - def __setattr__(self, name: str, value) -> None: ... - def __getattribute__(self, item: str): ... + def __init__(self, loop: AbstractEventLoop | None = None) -> None: ... + # Sets unknown items on the current task's context attribute + def __setattr__(self, name: str, value: Any) -> None: ... + # Returns unknown items from the current tasks context attribute + def __getattribute__(self, item: str) -> Any | None: ... def clear(self) -> None: ... -def task_factory(loop, coro): ... +def task_factory(loop: AbstractEventLoop | None, coro: _TaskCompatibleCoro[_T_co]) -> Task[_T_co]: ... diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/async_recorder.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/async_recorder.pyi index 4d4bdb8be332..f7e4d588fa29 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/async_recorder.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/async_recorder.pyi @@ -1,24 +1,43 @@ +from _typeshed import Incomplete +from collections.abc import Awaitable, Callable, Iterable, Mapping from types import TracebackType +from typing import TypeVar -from .models.segment import SegmentContextManager -from .models.subsegment import SubsegmentContextManager +from .models.dummy_entities import DummySegment, DummySubsegment +from .models.segment import Segment, SegmentContextManager +from .models.subsegment import Subsegment, SubsegmentContextManager from .recorder import AWSXRayRecorder +_T = TypeVar("_T") + class AsyncSegmentContextManager(SegmentContextManager): - async def __aenter__(self): ... + async def __aenter__(self) -> DummySegment | Segment: ... async def __aexit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... class AsyncSubsegmentContextManager(SubsegmentContextManager): - async def __call__(self, wrapped, instance, args, kwargs): ... - async def __aenter__(self): ... + async def __call__( + self, wrapped: Callable[..., Awaitable[_T]], instance, args: Iterable[Incomplete], kwargs: Mapping[str, Incomplete] + ) -> _T: ... + async def __aenter__(self) -> DummySubsegment | Subsegment | None: ... async def __aexit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... class AsyncAWSXRayRecorder(AWSXRayRecorder): - def capture_async(self, name=None): ... - def in_segment_async(self, name=None, **segment_kwargs): ... - def in_subsegment_async(self, name=None, **subsegment_kwargs): ... - async def record_subsegment_async(self, wrapped, instance, args, kwargs, name, namespace, meta_processor): ... + def capture_async(self, name: str | None = None) -> AsyncSubsegmentContextManager: ... + def in_segment_async( + self, name: str | None = None, *, traceid: str | None = None, parent_id: str | None = None, sampling: bool | None = None + ) -> AsyncSegmentContextManager: ... + def in_subsegment_async(self, name: str | None = None, *, namespace: str = "local") -> AsyncSubsegmentContextManager: ... + async def record_subsegment_async( + self, + wrapped: Callable[..., Awaitable[_T]], + instance, + args: Iterable[Incomplete], + kwargs: Mapping[str, Incomplete], + name: str, + namespace: str, + meta_processor: Callable[..., object] | None, + ) -> _T: ... diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/context.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/context.pyi index 3b389b303cc0..c84574342ab4 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/context.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/context.pyi @@ -1,27 +1,27 @@ import time from logging import Logger -from typing import Any +from typing import Final from .models.entity import Entity from .models.segment import Segment from .models.subsegment import Subsegment log: Logger -SUPPORTED_CONTEXT_MISSING: Any -MISSING_SEGMENT_MSG: str -CXT_MISSING_STRATEGY_KEY: str +MISSING_SEGMENT_MSG: Final[str] +SUPPORTED_CONTEXT_MISSING: Final = ("RUNTIME_ERROR", "LOG_ERROR", "IGNORE_ERROR") +CXT_MISSING_STRATEGY_KEY: Final = "AWS_XRAY_CONTEXT_MISSING" class Context: def __init__(self, context_missing: str = "LOG_ERROR") -> None: ... def put_segment(self, segment: Segment) -> None: ... def end_segment(self, end_time: time.struct_time | None = None) -> None: ... def put_subsegment(self, subsegment: Subsegment) -> None: ... - def end_subsegment(self, end_time: time.struct_time | None = None): ... - def get_trace_entity(self): ... + def end_subsegment(self, end_time: time.struct_time | None = None) -> bool: ... + def get_trace_entity(self) -> Entity: ... def set_trace_entity(self, trace_entity: Entity) -> None: ... def clear_trace_entities(self) -> None: ... def handle_context_missing(self) -> None: ... @property - def context_missing(self): ... + def context_missing(self) -> str: ... @context_missing.setter def context_missing(self, value: str) -> None: ... diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/daemon_config.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/daemon_config.pyi index e5c4b9609def..35a393a7712b 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/daemon_config.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/daemon_config.pyi @@ -1,13 +1,15 @@ -DAEMON_ADDRESS_KEY: str -DEFAULT_ADDRESS: str +from typing import Final + +DAEMON_ADDRESS_KEY: Final = "AWS_XRAY_DAEMON_ADDRESS" +DEFAULT_ADDRESS: Final = "127.0.0.1:2000" class DaemonConfig: - def __init__(self, daemon_address="127.0.0.1:2000") -> None: ... + def __init__(self, daemon_address: str | None = "127.0.0.1:2000") -> None: ... @property - def udp_ip(self): ... + def udp_ip(self) -> str: ... @property - def udp_port(self): ... + def udp_port(self) -> int: ... @property - def tcp_ip(self): ... + def tcp_ip(self) -> str: ... @property - def tcp_port(self): ... + def tcp_port(self) -> int: ... diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/emitters/udp_emitter.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/emitters/udp_emitter.pyi index fa5c2b24ca4e..affa22d2a484 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/emitters/udp_emitter.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/emitters/udp_emitter.pyi @@ -13,6 +13,6 @@ class UDPEmitter: def send_entity(self, entity: Entity) -> None: ... def set_daemon_address(self, address: str | None) -> None: ... @property - def ip(self): ... + def ip(self) -> str: ... @property - def port(self): ... + def port(self) -> int: ... diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/lambda_launcher.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/lambda_launcher.pyi index 9d0cbf5e3f17..50e94b257de5 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/lambda_launcher.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/lambda_launcher.pyi @@ -1,23 +1,19 @@ from logging import Logger +from typing import Final from .context import Context log: Logger -LAMBDA_TRACE_HEADER_KEY: str -LAMBDA_TASK_ROOT_KEY: str -TOUCH_FILE_DIR: str -TOUCH_FILE_PATH: str +LAMBDA_TRACE_HEADER_KEY: Final = "_X_AMZN_TRACE_ID" +LAMBDA_TASK_ROOT_KEY: Final = "LAMBDA_TASK_ROOT" +TOUCH_FILE_DIR: Final = "/tmp/.aws-xray/" +TOUCH_FILE_PATH: Final = "/tmp/.aws-xray/initialized" -def check_in_lambda(): ... +def check_in_lambda() -> LambdaContext | None: ... class LambdaContext(Context): def __init__(self) -> None: ... - def put_segment(self, segment) -> None: ... - def end_segment(self, end_time=None) -> None: ... - def put_subsegment(self, subsegment) -> None: ... - def get_trace_entity(self): ... - @property + @property # type: ignore[override] def context_missing(self) -> None: ... @context_missing.setter - def context_missing(self, value) -> None: ... - def handle_context_missing(self) -> None: ... + def context_missing(self, value: str) -> None: ... diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/entity.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/entity.pyi index 0e19e4d65fa1..5ea373e689fd 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/entity.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/entity.pyi @@ -7,7 +7,7 @@ from .subsegment import Subsegment from .throwable import Throwable log: Logger -ORIGIN_TRACE_HEADER_ATTR_KEY: Final[str] +ORIGIN_TRACE_HEADER_ATTR_KEY: Final = "_origin_trace_header" class Entity: id: str diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/facade_segment.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/facade_segment.pyi index 69c156c46cfe..2ae599e4c968 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/facade_segment.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/facade_segment.pyi @@ -2,7 +2,7 @@ from typing import Final from .segment import Segment -MUTATION_UNSUPPORTED_MESSAGE: Final[str] +MUTATION_UNSUPPORTED_MESSAGE: Final = "FacadeSegments cannot be mutated." class FacadeSegment(Segment): initializing: bool diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/http.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/http.pyi index 4aa14206214e..360493f2f829 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/http.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/http.pyi @@ -1,13 +1,13 @@ from typing import Final -URL: Final[str] -METHOD: Final[str] -USER_AGENT: Final[str] -CLIENT_IP: Final[str] -X_FORWARDED_FOR: Final[str] -STATUS: Final[str] -CONTENT_LENGTH: Final[str] -XRAY_HEADER: Final[str] -ALT_XRAY_HEADER: Final[str] +URL: Final = "url" +METHOD: Final = "method" +USER_AGENT: Final = "user_agent" +CLIENT_IP: Final = "client_ip" +X_FORWARDED_FOR: Final = "x_forwarded_for" +STATUS: Final = "status" +CONTENT_LENGTH: Final = "content_length" +XRAY_HEADER: Final = "X-Amzn-Trace-Id" +ALT_XRAY_HEADER: Final = "HTTP_X_AMZN_TRACE_ID" request_keys: tuple[str, ...] response_keys: tuple[str, ...] diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/segment.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/segment.pyi index 903378f6e6b6..1851d8ea3282 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/segment.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/segment.pyi @@ -8,7 +8,7 @@ from .dummy_entities import DummySegment from .entity import Entity from .subsegment import Subsegment -ORIGIN_TRACE_HEADER_ATTR_KEY: Final[str] +ORIGIN_TRACE_HEADER_ATTR_KEY: Final = "_origin_trace_header" class SegmentContextManager: name: str | None diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/subsegment.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/subsegment.pyi index 57ceefa1cb12..27481f85870b 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/subsegment.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/subsegment.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete +from collections.abc import Callable from types import TracebackType from typing import Final @@ -7,10 +8,10 @@ from .dummy_entities import DummySubsegment from .entity import Entity from .segment import Segment -SUBSEGMENT_RECORDING_ATTRIBUTE: Final[str] +SUBSEGMENT_RECORDING_ATTRIBUTE: Final = "_self___SUBSEGMENT_RECORDING_ATTRIBUTE__" def set_as_recording(decorated_func, wrapped) -> None: ... -def is_already_recording(func): ... +def is_already_recording(func: Callable[..., object]) -> bool: ... def subsegment_decorator(wrapped, instance, args, kwargs): ... class SubsegmentContextManager: diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/throwable.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/throwable.pyi index 54b918634306..e4e0f748fd59 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/throwable.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/models/throwable.pyi @@ -1,7 +1,9 @@ -from _typeshed import Incomplete from logging import Logger from traceback import StackSummary from typing import TypedDict, type_check_only +from typing_extensions import NotRequired + +log: Logger @type_check_only class _StackInfo(TypedDict): @@ -9,7 +11,13 @@ class _StackInfo(TypedDict): line: int label: str -log: Logger +@type_check_only +class _ThrowableAttrs(TypedDict): + id: str + message: NotRequired[str] + type: str + remote: bool + stack: NotRequired[list[_StackInfo]] class Throwable: id: str @@ -18,4 +26,4 @@ class Throwable: remote: bool stack: list[_StackInfo] | None def __init__(self, exception: Exception, stack: StackSummary, remote: bool = False) -> None: ... - def to_dict(self) -> dict[str, Incomplete]: ... + def to_dict(self) -> _ThrowableAttrs: ... diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/patcher.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/patcher.pyi index 20cee42f8ef9..6b9f5d73226a 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/patcher.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/patcher.pyi @@ -1,9 +1,10 @@ from collections.abc import Iterable from logging import Logger +from typing import Final log: Logger -SUPPORTED_MODULES: tuple[str, ...] -NO_DOUBLE_PATCH: tuple[str, ...] +SUPPORTED_MODULES: Final[tuple[str, ...]] +NO_DOUBLE_PATCH: Final[tuple[str, ...]] def patch_all(double_patch: bool = False) -> None: ... def patch( diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/plugins/ec2_plugin.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/plugins/ec2_plugin.pyi index aae2f13951b7..84c29f5631cf 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/plugins/ec2_plugin.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/plugins/ec2_plugin.pyi @@ -3,9 +3,9 @@ from logging import Logger from typing import Any, Final, overload log: Logger -SERVICE_NAME: Final[str] -ORIGIN: Final[str] -IMDS_URL: Final[str] +SERVICE_NAME: Final = "ec2" +ORIGIN: Final = "AWS::EC2::Instance" +IMDS_URL: Final = "http://169.254.169.254/latest/" def initialize() -> None: ... def get_token() -> str | None: ... diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/plugins/ecs_plugin.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/plugins/ecs_plugin.pyi index b2cd96d3dcba..019494fb0c57 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/plugins/ecs_plugin.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/plugins/ecs_plugin.pyi @@ -2,7 +2,7 @@ from logging import Logger from typing import Final log: Logger -SERVICE_NAME: Final[str] -ORIGIN: Final[str] +SERVICE_NAME: Final = "ecs" +ORIGIN: Final = "AWS::ECS::Container" def initialize() -> None: ... diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/plugins/elasticbeanstalk_plugin.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/plugins/elasticbeanstalk_plugin.pyi index 3ae45f58cded..9ac631478457 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/plugins/elasticbeanstalk_plugin.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/plugins/elasticbeanstalk_plugin.pyi @@ -2,8 +2,8 @@ from logging import Logger from typing import Final log: Logger -CONF_PATH: Final[str] -SERVICE_NAME: Final[str] -ORIGIN: Final[str] +CONF_PATH: Final = "/var/elasticbeanstalk/xray/environment.conf" +SERVICE_NAME: Final = "elastic_beanstalk" +ORIGIN: Final = "AWS::ElasticBeanstalk::Environment" def initialize() -> None: ... diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/recorder.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/recorder.pyi index ee8f964f3e30..8b05f527a5a1 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/recorder.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/recorder.pyi @@ -1,8 +1,8 @@ import time -from _typeshed import FileDescriptorOrPath -from collections.abc import Callable, Iterable +from _typeshed import FileDescriptorOrPath, Incomplete +from collections.abc import Callable, Iterable, Mapping from logging import Logger -from typing import Any +from typing import Any, Final, TypeVar from .context import Context from .emitters.udp_emitter import UDPEmitter @@ -15,11 +15,13 @@ from .sampling.sampler import DefaultSampler from .streaming.default_streaming import DefaultStreaming log: Logger -TRACING_NAME_KEY: str -DAEMON_ADDR_KEY: str -CONTEXT_MISSING_KEY: str -XRAY_META: dict[str, dict[str, str]] -SERVICE_INFO: dict[str, str] +TRACING_NAME_KEY: Final = "AWS_XRAY_TRACING_NAME" +DAEMON_ADDR_KEY: Final = "AWS_XRAY_DAEMON_ADDRESS" +CONTEXT_MISSING_KEY: Final = "AWS_XRAY_CONTEXT_MISSING" +XRAY_META: Final[dict[str, dict[str, str]]] +SERVICE_INFO: Final[dict[str, str]] + +_T = TypeVar("_T") class AWSXRayRecorder: def __init__(self) -> None: ... @@ -40,8 +42,10 @@ class AWSXRayRecorder: sampler: LocalSampler | DefaultSampler | None = None, stream_sql: bool | None = True, ) -> None: ... - def in_segment(self, name: str | None = None, **segment_kwargs) -> SegmentContextManager: ... - def in_subsegment(self, name: str | None = None, **subsegment_kwargs) -> SubsegmentContextManager: ... + def in_segment( + self, name: str | None = None, *, traceid: str | None = None, parent_id: str | None = None, sampling: bool | None = None + ) -> SegmentContextManager: ... + def in_subsegment(self, name: str | None = None, *, namespace: str = "local") -> SubsegmentContextManager: ... def begin_segment( self, name: str | None = None, traceid: str | None = None, parent_id: str | None = None, sampling: bool | None = None ) -> Segment | DummySegment: ... @@ -61,14 +65,14 @@ class AWSXRayRecorder: def capture(self, name: str | None = None) -> SubsegmentContextManager: ... def record_subsegment( self, - wrapped: Callable[..., Any], + wrapped: Callable[..., _T], instance: Any, - args: list[Any], - kwargs: dict[str, Any], + args: Iterable[Incomplete], + kwargs: Mapping[str, Incomplete], name: str, namespace: str, - meta_processor: Callable[..., object], - ) -> Any: ... + meta_processor: Callable[..., object] | None, + ) -> _T: ... @property def enabled(self) -> bool: ... @enabled.setter diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/rule_cache.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/rule_cache.pyi index 6fb06c428f2e..c6e06134ace7 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/rule_cache.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/rule_cache.pyi @@ -4,7 +4,7 @@ TTL: Final = 3600 class RuleCache: def __init__(self) -> None: ... - def get_matched_rule(self, sampling_req, now): ... + def get_matched_rule(self, sampling_req, now: float): ... def load_rules(self, rules) -> None: ... def load_targets(self, targets_dict) -> None: ... @property diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/sampler.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/sampler.pyi index 53235a4db593..0bc379e1cb0b 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/sampler.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/sampler.pyi @@ -1,5 +1,7 @@ from logging import Logger +from aws_xray_sdk.core.daemon_config import DaemonConfig + log: Logger class DefaultSampler: @@ -7,7 +9,7 @@ class DefaultSampler: def start(self) -> None: ... def should_trace(self, sampling_req=None): ... def load_local_rules(self, rules) -> None: ... - def load_settings(self, daemon_config, context, origin=None) -> None: ... + def load_settings(self, daemon_config: DaemonConfig, context, origin=None) -> None: ... @property def xray_client(self): ... @xray_client.setter diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/sampling_rule.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/sampling_rule.pyi index 1ea487cfb0c7..f67af0b60997 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/sampling_rule.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/sampling_rule.pyi @@ -1,13 +1,23 @@ +from typing import Literal, TypedDict, type_check_only + +from .reservoir import Reservoir + +@type_check_only +class _Stats(TypedDict): + request_count: int + borrow_count: int + sampled_count: int + class SamplingRule: def __init__( - self, name, priority, rate, reservoir_size, host=None, method=None, path=None, service=None, service_type=None + self, name: str, priority, rate, reservoir_size, host=None, method=None, path=None, service=None, service_type=None ) -> None: ... - def match(self, sampling_req): ... - def is_default(self): ... - def snapshot_statistics(self): ... + def match(self, sampling_req) -> bool: ... + def is_default(self) -> bool: ... + def snapshot_statistics(self) -> _Stats: ... def merge(self, rule) -> None: ... - def ever_matched(self): ... - def time_to_report(self): ... + def ever_matched(self) -> bool: ... + def time_to_report(self) -> Literal[True] | None: ... def increment_request_count(self) -> None: ... def increment_borrow_count(self) -> None: ... def increment_sampled_count(self) -> None: ... @@ -16,18 +26,18 @@ class SamplingRule: @rate.setter def rate(self, v) -> None: ... @property - def name(self): ... + def name(self) -> str: ... @property def priority(self): ... @property - def reservoir(self): ... + def reservoir(self) -> Reservoir: ... @reservoir.setter - def reservoir(self, v) -> None: ... + def reservoir(self, v: Reservoir) -> None: ... @property - def can_borrow(self): ... + def can_borrow(self) -> bool: ... @property - def request_count(self): ... + def request_count(self) -> int: ... @property - def borrow_count(self): ... + def borrow_count(self) -> int: ... @property - def sampled_count(self): ... + def sampled_count(self) -> int: ... diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/target_poller.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/target_poller.pyi index 7fdc45bf8f0b..7a1a5ff753b1 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/target_poller.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/target_poller.pyi @@ -1,7 +1,11 @@ from logging import Logger +from .connector import ServiceConnector +from .rule_cache import RuleCache +from .rule_poller import RulePoller + log: Logger class TargetPoller: - def __init__(self, cache, rule_poller, connector) -> None: ... + def __init__(self, cache: RuleCache, rule_poller: RulePoller, connector: ServiceConnector) -> None: ... def start(self) -> None: ... diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/ext/psycopg/__init__.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/ext/psycopg/__init__.pyi new file mode 100644 index 000000000000..47b402c8e221 --- /dev/null +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/ext/psycopg/__init__.pyi @@ -0,0 +1,3 @@ +from .patch import patch as patch + +__all__ = ["patch"] diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/ext/psycopg/patch.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/ext/psycopg/patch.pyi new file mode 100644 index 000000000000..969a93686fd4 --- /dev/null +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/ext/psycopg/patch.pyi @@ -0,0 +1 @@ +def patch() -> None: ... diff --git a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/ext/util.pyi b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/ext/util.pyi index daf9f4501bcf..d61f173ceb75 100644 --- a/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/ext/util.pyi +++ b/python/helpers/typeshed/stubs/aws-xray-sdk/aws_xray_sdk/ext/util.pyi @@ -5,7 +5,7 @@ from aws_xray_sdk.core.models.trace_header import TraceHeader first_cap_re: Final[re.Pattern[str]] all_cap_re: Final[re.Pattern[str]] -UNKNOWN_HOSTNAME: str = "UNKNOWN HOST" +UNKNOWN_HOSTNAME: Final = "UNKNOWN HOST" def inject_trace_header(headers, entity) -> None: ... def calculate_sampling_decision(trace_header, recorder, sampling_req): ... diff --git a/python/helpers/typeshed/stubs/bleach/METADATA.toml b/python/helpers/typeshed/stubs/bleach/METADATA.toml index 7dfbd41a855e..38c7fd7b5c4d 100644 --- a/python/helpers/typeshed/stubs/bleach/METADATA.toml +++ b/python/helpers/typeshed/stubs/bleach/METADATA.toml @@ -1,4 +1,4 @@ -version = "6.2.*" +version = "6.3.*" requires = ["types-html5lib"] upstream_repository = "https://github.com/mozilla/bleach" diff --git a/python/helpers/typeshed/stubs/bleach/bleach/html5lib_shim.pyi b/python/helpers/typeshed/stubs/bleach/bleach/html5lib_shim.pyi index d24c2d825f33..1904b538e8dd 100644 --- a/python/helpers/typeshed/stubs/bleach/bleach/html5lib_shim.pyi +++ b/python/helpers/typeshed/stubs/bleach/bleach/html5lib_shim.pyi @@ -50,7 +50,7 @@ class InputStreamWithMemory: class BleachHTMLTokenizer(HTMLTokenizer): consume_entities: bool - stream: InputStreamWithMemory + stream: InputStreamWithMemory # type: ignore[assignment] emitted_last_token: dict[str, Any] | None def __init__(self, consume_entities: bool = False, **kwargs: Any) -> None: ... diff --git a/python/helpers/typeshed/stubs/bleach/bleach/linkifier.pyi b/python/helpers/typeshed/stubs/bleach/bleach/linkifier.pyi index 73fe653c1b62..e6ec5d0ae35a 100644 --- a/python/helpers/typeshed/stubs/bleach/bleach/linkifier.pyi +++ b/python/helpers/typeshed/stubs/bleach/bleach/linkifier.pyi @@ -36,7 +36,7 @@ class Linker: # or `html5lib` token might be reused _Token: TypeAlias = dict[str, Any] -class LinkifyFilter(Filter): +class LinkifyFilter(Filter[_Token]): callbacks: Iterable[_Callback] skip_tags: Container[str] parse_email: bool diff --git a/python/helpers/typeshed/stubs/bleach/bleach/sanitizer.pyi b/python/helpers/typeshed/stubs/bleach/bleach/sanitizer.pyi index a86be65feae6..897c17f8a27b 100644 --- a/python/helpers/typeshed/stubs/bleach/bleach/sanitizer.pyi +++ b/python/helpers/typeshed/stubs/bleach/bleach/sanitizer.pyi @@ -40,7 +40,7 @@ class Cleaner: protocols: Iterable[str] strip: bool strip_comments: bool - filters: Iterable[Filter] + filters: Iterable[_FilterConstructor] css_sanitizer: CSSSanitizer | None parser: BleachHTMLParser walker: TreeWalker @@ -85,7 +85,7 @@ class BleachSanitizerFilter(SanitizerFilter): def sanitize_stream(self, token_iterator: Iterable[_Token]) -> Iterator[_Token]: ... def merge_characters(self, token_iterator: Iterable[_Token]) -> Iterator[_Token]: ... def __iter__(self) -> Iterator[_Token]: ... - def sanitize_token(self, token: _Token) -> _Token | list[_Token] | None: ... + def sanitize_token(self, token: _Token) -> _Token | list[_Token] | None: ... # type: ignore[override] def sanitize_characters(self, token: _Token) -> _Token | list[_Token]: ... def sanitize_uri_value(self, value: str, allowed_protocols: Container[str]) -> str | None: ... def allow_token(self, token: _Token) -> _Token: ... diff --git a/python/helpers/typeshed/stubs/braintree/METADATA.toml b/python/helpers/typeshed/stubs/braintree/METADATA.toml index 30cdf466ba3a..909042028e0e 100644 --- a/python/helpers/typeshed/stubs/braintree/METADATA.toml +++ b/python/helpers/typeshed/stubs/braintree/METADATA.toml @@ -1,2 +1,2 @@ -version = "4.39.*" +version = "4.40.*" upstream_repository = "https://github.com/braintree/braintree_python" diff --git a/python/helpers/typeshed/stubs/braintree/braintree/address.pyi b/python/helpers/typeshed/stubs/braintree/braintree/address.pyi index f90932b60fd1..eaf4ec201650 100644 --- a/python/helpers/typeshed/stubs/braintree/braintree/address.pyi +++ b/python/helpers/typeshed/stubs/braintree/braintree/address.pyi @@ -1,7 +1,9 @@ from _typeshed import Incomplete from typing import Final +from braintree.error_result import ErrorResult from braintree.resource import Resource +from braintree.successful_result import SuccessfulResult class Address(Resource): class ShippingMethod: @@ -14,13 +16,15 @@ class Address(Resource): PickupInStore: Final = "pickup_in_store" @staticmethod - def create(params: dict[str, Incomplete] | None = None): ... + def create(params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult | None: ... @staticmethod - def delete(customer_id: str, address_id: str): ... + def delete(customer_id: str, address_id: str) -> SuccessfulResult: ... @staticmethod - def find(customer_id: str, address_id: str): ... + def find(customer_id: str, address_id: str) -> Address: ... @staticmethod - def update(customer_id: str, address_id: str, params: dict[str, Incomplete] | None = None): ... + def update( + customer_id: str, address_id: str, params: dict[str, Incomplete] | None = None + ) -> SuccessfulResult | ErrorResult | None: ... @staticmethod def create_signature() -> list[str | dict[str, list[str]]]: ... @staticmethod diff --git a/python/helpers/typeshed/stubs/braintree/braintree/address_gateway.pyi b/python/helpers/typeshed/stubs/braintree/braintree/address_gateway.pyi index fc7735b016b4..0ecadbe8c924 100644 --- a/python/helpers/typeshed/stubs/braintree/braintree/address_gateway.pyi +++ b/python/helpers/typeshed/stubs/braintree/braintree/address_gateway.pyi @@ -1,13 +1,14 @@ from _typeshed import Incomplete from braintree.address import Address +from braintree.braintree_gateway import BraintreeGateway from braintree.error_result import ErrorResult from braintree.successful_result import SuccessfulResult class AddressGateway: - gateway: Incomplete + gateway: BraintreeGateway config: Incomplete - def __init__(self, gateway) -> None: ... + def __init__(self, gateway: BraintreeGateway) -> None: ... def create(self, params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult | None: ... def delete(self, customer_id: str, address_id: str) -> SuccessfulResult: ... def find(self, customer_id: str, address_id: str) -> Address: ... diff --git a/python/helpers/typeshed/stubs/braintree/braintree/client_token.pyi b/python/helpers/typeshed/stubs/braintree/braintree/client_token.pyi index 1e2f68f19a0b..4855a008da44 100644 --- a/python/helpers/typeshed/stubs/braintree/braintree/client_token.pyi +++ b/python/helpers/typeshed/stubs/braintree/braintree/client_token.pyi @@ -1,5 +1,9 @@ +from _typeshed import Incomplete + +from braintree.braintree_gateway import BraintreeGateway + class ClientToken: @staticmethod - def generate(params=None, gateway=None): ... + def generate(params: dict[str, Incomplete] | None = None, gateway: BraintreeGateway | None = None) -> str: ... @staticmethod def generate_signature() -> list[str | dict[str, list[str]]]: ... diff --git a/python/helpers/typeshed/stubs/braintree/braintree/client_token_gateway.pyi b/python/helpers/typeshed/stubs/braintree/braintree/client_token_gateway.pyi index 1f53d277caba..b07681cee224 100644 --- a/python/helpers/typeshed/stubs/braintree/braintree/client_token_gateway.pyi +++ b/python/helpers/typeshed/stubs/braintree/braintree/client_token_gateway.pyi @@ -1,7 +1,9 @@ from _typeshed import Incomplete +from braintree.braintree_gateway import BraintreeGateway + class ClientTokenGateway: - gateway: Incomplete + gateway: BraintreeGateway config: Incomplete - def __init__(self, gateway) -> None: ... - def generate(self, params=None): ... + def __init__(self, gateway: BraintreeGateway) -> None: ... + def generate(self, params: dict[str, Incomplete] | None = None) -> str: ... diff --git a/python/helpers/typeshed/stubs/braintree/braintree/error_codes.pyi b/python/helpers/typeshed/stubs/braintree/braintree/error_codes.pyi index 154bf9051b00..8f0e8864438c 100644 --- a/python/helpers/typeshed/stubs/braintree/braintree/error_codes.pyi +++ b/python/helpers/typeshed/stubs/braintree/braintree/error_codes.pyi @@ -509,6 +509,7 @@ class ErrorCodes: PaymentMethodNonceUnknown: Final = "91565" PaymentMethodTokenCardTypeIsNotAccepted: Final = "91517" PaymentMethodTokenIsInvalid: Final = "91518" + ProcessingMerchantCategoryCodeIsInvalid: Final = "915265" ProcessorAuthorizationCodeCannotBeSet: Final = "91519" ProcessorAuthorizationCodeIsInvalid: Final = "81520" ProcessorDoesNotSupportAuths: Final = "915104" @@ -572,8 +573,17 @@ class ErrorCodes: TransactionIsNotEligibleForAdjustment: Final = "915219" TransactionMustBeInStateAuthorized: Final = "915218" TransactionSourceIsInvalid: Final = "915133" - TransferTypeIsInvalid: Final = "97501" + TransferDetailsAreNotApplicableForThisMerchantAccount: Final = "97511" TransferDetailsAreRequired: Final = "97510" + TransferReceiverAccountReferenceNumberIsNotValid: Final = "97509" + TransferReceiverFirstNameIsNotValid: Final = "97507" + TransferReceiverLastNameIsNotValid: Final = "97508" + TransferReceiverTaxIdIsNotValid: Final = "97506" + TransferSenderAccountReferenceNumberIsNotValid: Final = "97505" + TransferSenderFirstNameIsNotValid: Final = "97503" + TransferSenderLastNameIsNotValid: Final = "97504" + TransferSenderTaxIdIsNotValid: Final = "97502" + TransferTypeIsInvalid: Final = "97501" TypeIsInvalid: Final = "91523" TypeIsRequired: Final = "91524" UnsupportedVoiceAuthorization: Final = "91539" diff --git a/python/helpers/typeshed/stubs/braintree/braintree/payment_method.pyi b/python/helpers/typeshed/stubs/braintree/braintree/payment_method.pyi index 9d87458d2c30..41ac52cb6807 100644 --- a/python/helpers/typeshed/stubs/braintree/braintree/payment_method.pyi +++ b/python/helpers/typeshed/stubs/braintree/braintree/payment_method.pyi @@ -1,14 +1,43 @@ from _typeshed import Incomplete +from braintree.amex_express_checkout_card import AmexExpressCheckoutCard +from braintree.android_pay_card import AndroidPayCard +from braintree.apple_pay_card import ApplePayCard +from braintree.credit_card import CreditCard from braintree.error_result import ErrorResult +from braintree.europe_bank_account import EuropeBankAccount +from braintree.masterpass_card import MasterpassCard +from braintree.paypal_account import PayPalAccount from braintree.resource import Resource +from braintree.samsung_pay_card import SamsungPayCard +from braintree.sepa_direct_debit_account import SepaDirectDebitAccount from braintree.successful_result import SuccessfulResult +from braintree.unknown_payment_method import UnknownPaymentMethod +from braintree.us_bank_account import UsBankAccount +from braintree.venmo_account import VenmoAccount +from braintree.visa_checkout_card import VisaCheckoutCard class PaymentMethod(Resource): @staticmethod def create(params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult: ... @staticmethod - def find(payment_method_token: str) -> Resource: ... + def find( + payment_method_token: str, + ) -> ( + AndroidPayCard + | ApplePayCard + | EuropeBankAccount + | CreditCard + | PayPalAccount + | UsBankAccount + | VenmoAccount + | VisaCheckoutCard + | AmexExpressCheckoutCard + | SepaDirectDebitAccount + | MasterpassCard + | SamsungPayCard + | UnknownPaymentMethod + ): ... @staticmethod def update(payment_method_token: str, params) -> SuccessfulResult | ErrorResult: ... @staticmethod diff --git a/python/helpers/typeshed/stubs/braintree/braintree/payment_method_gateway.pyi b/python/helpers/typeshed/stubs/braintree/braintree/payment_method_gateway.pyi index 73393a851e7c..16054b4413d5 100644 --- a/python/helpers/typeshed/stubs/braintree/braintree/payment_method_gateway.pyi +++ b/python/helpers/typeshed/stubs/braintree/braintree/payment_method_gateway.pyi @@ -1,15 +1,43 @@ from _typeshed import Incomplete +from braintree.amex_express_checkout_card import AmexExpressCheckoutCard +from braintree.android_pay_card import AndroidPayCard +from braintree.apple_pay_card import ApplePayCard +from braintree.credit_card import CreditCard from braintree.error_result import ErrorResult -from braintree.resource import Resource +from braintree.europe_bank_account import EuropeBankAccount +from braintree.masterpass_card import MasterpassCard +from braintree.paypal_account import PayPalAccount +from braintree.samsung_pay_card import SamsungPayCard +from braintree.sepa_direct_debit_account import SepaDirectDebitAccount from braintree.successful_result import SuccessfulResult +from braintree.unknown_payment_method import UnknownPaymentMethod +from braintree.us_bank_account import UsBankAccount +from braintree.venmo_account import VenmoAccount +from braintree.visa_checkout_card import VisaCheckoutCard class PaymentMethodGateway: gateway: Incomplete config: Incomplete def __init__(self, gateway) -> None: ... def create(self, params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult: ... - def find(self, payment_method_token: str) -> Resource: ... + def find( + self, payment_method_token: str + ) -> ( + AndroidPayCard + | ApplePayCard + | EuropeBankAccount + | CreditCard + | PayPalAccount + | UsBankAccount + | VenmoAccount + | VisaCheckoutCard + | AmexExpressCheckoutCard + | SepaDirectDebitAccount + | MasterpassCard + | SamsungPayCard + | UnknownPaymentMethod + ): ... def update(self, payment_method_token: str, params) -> SuccessfulResult | ErrorResult: ... def delete(self, payment_method_token: str, options=None) -> SuccessfulResult: ... options: dict[str, Incomplete] diff --git a/python/helpers/typeshed/stubs/braintree/braintree/subscription.pyi b/python/helpers/typeshed/stubs/braintree/braintree/subscription.pyi index 98acf134f39d..24bb2a09a05c 100644 --- a/python/helpers/typeshed/stubs/braintree/braintree/subscription.pyi +++ b/python/helpers/typeshed/stubs/braintree/braintree/subscription.pyi @@ -1,12 +1,16 @@ from _typeshed import Incomplete +from datetime import date from decimal import Decimal from typing import Final from braintree.add_on import AddOn from braintree.descriptor import Descriptor from braintree.discount import Discount +from braintree.error_result import ErrorResult from braintree.resource import Resource +from braintree.resource_collection import ResourceCollection from braintree.subscription_status_event import SubscriptionStatusEvent +from braintree.successful_result import SuccessfulResult from braintree.transaction import Transaction class Subscription(Resource): @@ -27,23 +31,24 @@ class Subscription(Resource): Pending: Final = "Pending" @staticmethod - def create(params=None): ... + def create(params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult | None: ... @staticmethod def create_signature(): ... @staticmethod - def find(subscription_id): ... + def find(subscription_id: str) -> Subscription: ... @staticmethod def retry_charge(subscription_id, amount=None, submit_for_settlement: bool = False): ... @staticmethod - def update(subscription_id, params=None): ... + def update(subscription_id: str, params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult | None: ... @staticmethod - def cancel(subscription_id): ... + def cancel(subscription_id: str) -> SuccessfulResult | ErrorResult | None: ... @staticmethod - def search(*query): ... + def search(*query) -> ResourceCollection: ... @staticmethod def update_signature(): ... price: Decimal balance: Decimal + next_billing_date: date next_billing_period_amount: Decimal add_ons: list[AddOn] descriptor: Descriptor diff --git a/python/helpers/typeshed/stubs/braintree/braintree/subscription_details.pyi b/python/helpers/typeshed/stubs/braintree/braintree/subscription_details.pyi index 30014161f03b..df2da1daa1a6 100644 --- a/python/helpers/typeshed/stubs/braintree/braintree/subscription_details.pyi +++ b/python/helpers/typeshed/stubs/braintree/braintree/subscription_details.pyi @@ -1,3 +1,7 @@ +from datetime import date + from braintree.attribute_getter import AttributeGetter -class SubscriptionDetails(AttributeGetter): ... +class SubscriptionDetails(AttributeGetter): + billing_period_start_date: date + billing_period_end_date: date diff --git a/python/helpers/typeshed/stubs/braintree/braintree/subscription_gateway.pyi b/python/helpers/typeshed/stubs/braintree/braintree/subscription_gateway.pyi index 37dfbae24b93..44907bce1d97 100644 --- a/python/helpers/typeshed/stubs/braintree/braintree/subscription_gateway.pyi +++ b/python/helpers/typeshed/stubs/braintree/braintree/subscription_gateway.pyi @@ -1,12 +1,19 @@ from _typeshed import Incomplete +from braintree.error_result import ErrorResult +from braintree.resource_collection import ResourceCollection +from braintree.subscription import Subscription +from braintree.successful_result import SuccessfulResult + class SubscriptionGateway: gateway: Incomplete config: Incomplete def __init__(self, gateway) -> None: ... - def cancel(self, subscription_id): ... - def create(self, params=None): ... - def find(self, subscription_id): ... + def cancel(self, subscription_id: str) -> SuccessfulResult | ErrorResult | None: ... + def create(self, params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult | None: ... + def find(self, subscription_id: str) -> Subscription: ... def retry_charge(self, subscription_id, amount=None, submit_for_settlement: bool = False): ... - def search(self, *query): ... - def update(self, subscription_id, params=None): ... + def search(self, *query) -> ResourceCollection: ... + def update( + self, subscription_id: str, params: dict[str, Incomplete] | None = None + ) -> SuccessfulResult | ErrorResult | None: ... diff --git a/python/helpers/typeshed/stubs/braintree/braintree/transaction.pyi b/python/helpers/typeshed/stubs/braintree/braintree/transaction.pyi index 6aebd7369799..9554df46319c 100644 --- a/python/helpers/typeshed/stubs/braintree/braintree/transaction.pyi +++ b/python/helpers/typeshed/stubs/braintree/braintree/transaction.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete +from datetime import datetime from decimal import Decimal from typing import Final @@ -26,6 +27,7 @@ from braintree.payment_facilitator import PaymentFacilitator from braintree.paypal_account import PayPalAccount from braintree.paypal_here import PayPalHere from braintree.resource import Resource +from braintree.resource_collection import ResourceCollection from braintree.risk_data import RiskData from braintree.samsung_pay_card import SamsungPayCard from braintree.sepa_direct_debit_account import SepaDirectDebitAccount @@ -102,13 +104,13 @@ class Transaction(Resource): @staticmethod def credit(params=None): ... @staticmethod - def find(transaction_id): ... + def find(transaction_id: str) -> Transaction: ... @staticmethod def refund(transaction_id, amount_or_options=None): ... @staticmethod def sale(params=None): ... @staticmethod - def search(*query): ... + def search(*query) -> ResourceCollection: ... @staticmethod def submit_for_settlement(transaction_id, amount=None, params=None): ... @staticmethod @@ -176,6 +178,8 @@ class Transaction(Resource): network_transaction_id: Incomplete payment_facilitator: PaymentFacilitator transfer: Transfer + subscription_id: str + created_at: datetime def __init__(self, gateway, attributes) -> None: ... @property def vault_billing_address(self): ... diff --git a/python/helpers/typeshed/stubs/braintree/braintree/transaction_gateway.pyi b/python/helpers/typeshed/stubs/braintree/braintree/transaction_gateway.pyi index a6ad5f3f6c97..c3bfc8880708 100644 --- a/python/helpers/typeshed/stubs/braintree/braintree/transaction_gateway.pyi +++ b/python/helpers/typeshed/stubs/braintree/braintree/transaction_gateway.pyi @@ -1,5 +1,8 @@ from _typeshed import Incomplete +from braintree.resource_collection import ResourceCollection +from braintree.transaction import Transaction + class TransactionGateway: gateway: Incomplete config: Incomplete @@ -9,10 +12,10 @@ class TransactionGateway: def cancel_release(self, transaction_id): ... def create(self, params): ... def credit(self, params): ... - def find(self, transaction_id): ... + def find(self, transaction_id: str) -> Transaction: ... def refund(self, transaction_id, amount_or_options=None): ... def sale(self, params): ... - def search(self, *query): ... + def search(self, *query) -> ResourceCollection: ... def submit_for_settlement(self, transaction_id, amount=None, params=None): ... def update_details(self, transaction_id, params=None): ... def submit_for_partial_settlement(self, transaction_id, amount, params=None): ... diff --git a/python/helpers/typeshed/stubs/colorful/METADATA.toml b/python/helpers/typeshed/stubs/colorful/METADATA.toml new file mode 100644 index 000000000000..251b9ed1e241 --- /dev/null +++ b/python/helpers/typeshed/stubs/colorful/METADATA.toml @@ -0,0 +1,2 @@ +version = "0.5.*" +upstream_repository = "https://github.com/timofurrer/colorful" diff --git a/python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/__init__.pyi b/python/helpers/typeshed/stubs/colorful/colorful/__init__.pyi similarity index 100% rename from python/helpers/typeshed/stubs/ExifRead/exifread/tags/makernote/__init__.pyi rename to python/helpers/typeshed/stubs/colorful/colorful/__init__.pyi diff --git a/python/helpers/typeshed/stubs/colorful/colorful/ansi.pyi b/python/helpers/typeshed/stubs/colorful/colorful/ansi.pyi new file mode 100644 index 000000000000..ed25609c6766 --- /dev/null +++ b/python/helpers/typeshed/stubs/colorful/colorful/ansi.pyi @@ -0,0 +1,14 @@ +from typing import Final + +MODIFIERS: Final[dict[str, tuple[int, int]]] +MODIFIER_RESET_OFFSET: Final[int] +FOREGROUND_COLOR_OFFSET: Final[int] +BACKGROUND_COLOR_OFFSET: Final[int] +COLOR_CLOSE_OFFSET: Final[int] +CSI: Final[str] +ANSI_ESCAPE_CODE: Final[str] +NEST_PLACEHOLDER: Final[str] + +def round(value: float) -> int: ... +def rgb_to_ansi256(r: int, g: int, b: int) -> int: ... +def rgb_to_ansi16(r: int, g: int, b: int, use_bright: bool = False) -> int: ... diff --git a/python/helpers/typeshed/stubs/colorful/colorful/colors.pyi b/python/helpers/typeshed/stubs/colorful/colorful/colors.pyi new file mode 100644 index 000000000000..8865b2357284 --- /dev/null +++ b/python/helpers/typeshed/stubs/colorful/colorful/colors.pyi @@ -0,0 +1,6 @@ +from _typeshed import SupportsItems + +def parse_colors(path: str) -> SupportsItems[str, str | tuple[int, int, int]]: ... +def parse_rgb_txt_file(path: str) -> SupportsItems[str, str | tuple[int, int, int]]: ... +def parse_json_color_file(path: str) -> dict[str, str]: ... +def sanitize_color_palette(colorpalette: SupportsItems[str, str | tuple[int, int, int]]) -> dict[str, tuple[int, int, int]]: ... diff --git a/python/helpers/typeshed/stubs/colorful/colorful/core.pyi b/python/helpers/typeshed/stubs/colorful/colorful/core.pyi new file mode 100644 index 000000000000..93bce78dff43 --- /dev/null +++ b/python/helpers/typeshed/stubs/colorful/colorful/core.pyi @@ -0,0 +1,102 @@ +from _typeshed import SupportsGetItem, SupportsItems, SupportsWrite + +# This module defines a function "str()", which is why "str" can't be used +# as a type annotation or type alias. +from builtins import str as _str +from collections.abc import Iterator +from typing import Any, Final, Literal +from typing_extensions import LiteralString, Self, TypeAlias + +# Custom type helpers +_ColorModeType: TypeAlias = Literal[0, 8, 16, 256, 16777215] +_PaletteType: TypeAlias = dict[_str, _str] | dict[_str, tuple[int, int, int]] | dict[_str, _str | tuple[int, int, int]] +_StyleType: TypeAlias = tuple[_str, _str] + +DEFAULT_RGB_TXT_PATH: Final[_str] +COLOR_PALETTE: Final[dict[_str, _str]] +COLORNAMES_COLORS_PATH: Final[_str] + +class ColorfulError(Exception): ... +class ColorfulAttributeError(AttributeError, ColorfulError): ... + +def translate_rgb_to_ansi_code(red: int, green: int, blue: int, offset: int, colormode: _ColorModeType) -> _str: ... +def translate_colorname_to_ansi_code( + colorname: _str, offset: int, colormode: _ColorModeType, colorpalette: SupportsGetItem[_str, _str | tuple[int, int, int]] +) -> _str: ... +def resolve_modifier_to_ansi_code(modifiername: _str, colormode: _ColorModeType) -> _str: ... +def translate_style( + style: _str, colormode: _ColorModeType, colorpalette: SupportsGetItem[_str, _str | tuple[int, int, int]] +) -> _str: ... +def style_string(string: _str, ansi_style: _StyleType, colormode: _ColorModeType, nested: bool = False) -> _str: ... + +class ColorfulString: + orig_string: _str + styled_string: _str + colorful_ctx: Colorful + def __init__(self, orig_string: _str, styled_string: _str, colorful_ctx: Colorful) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_str]: ... + def __add__(self, other: _str | ColorfulString) -> Self: ... + def __iadd__(self, other: _str | ColorfulString) -> Self: ... + def __radd__(self, other: _str | ColorfulString) -> Self: ... + def __mul__(self, other: _str) -> Self: ... + def __format__(self, format_spec: _str) -> _str: ... + # Forwards item access to styled_string (a str). + def __getattr__(self, name: _str) -> Any: ... + +class Colorful: + NO_COLORS: Final[int] + ANSI_8_COLORS: Final[int] + ANSI_16_COLORS: Final[int] + ANSI_256_COLORS: Final[int] + TRUE_COLORS: Final[int] + COLORNAMES_COLORS = COLORNAMES_COLORS_PATH + close_fg_color: Final[_str] + close_bg_color: Final[_str] + no_bold: Final[_str] + no_dimmed: Final[_str] + no_italic: Final[_str] + no_underlined: Final[_str] + no_blinkslow: Final[_str] + no_blinkrapid: Final[_str] + no_inversed: Final[_str] + no_concealed: Final[_str] + no_struckthrough: Final[_str] + colormode: _ColorModeType + def __init__(self, colormode: _ColorModeType | None = None, colorpalette: _str | _PaletteType | None = None) -> None: ... + @property + def colorpalette(self) -> SupportsItems[str, str | tuple[int, int, int]] | None: ... + @colorpalette.setter + def colorpalette(self, colorpalette: _str | _PaletteType) -> None: ... + def setup( + self, + colormode: _ColorModeType | None = None, + colorpalette: _str | _PaletteType | None = None, + extend_colors: bool = False, + ) -> None: ... + def disable(self) -> None: ... + def use_8_ansi_colors(self) -> None: ... + def use_16_ansi_colors(self) -> None: ... + def use_256_ansi_colors(self) -> None: ... + def use_true_colors(self) -> None: ... + def use_palette(self, colorpalette: _str | _PaletteType) -> None: ... + def update_palette(self, colorpalette: _str | _PaletteType) -> None: ... + def use_style(self, style_name: _str) -> None: ... + def format(self, string: _str, *args: LiteralString, **kwargs: LiteralString) -> _str: ... + def str(self, string: _str) -> ColorfulString: ... + def print( + self, *objects: object, sep: _str = " ", end: _str = "\n", file: SupportsWrite[_str] | None = None, flush: bool = False + ) -> None: ... + + class ColorfulStyle: + colormode: _ColorModeType + colorful_ctx: Colorful + def __init__(self, style: _StyleType, colormode: _ColorModeType, colorful_ctx: Colorful) -> None: ... + def evaluate(self, string: _str, nested: bool = False) -> ColorfulString: ... + def __and__(self, other: Self) -> Self: ... + def __call__(self, string: _str, nested: bool = False) -> ColorfulString: ... + def __or__(self, other) -> ColorfulString: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + + def __getattr__(self, name: _str) -> ColorfulStyle: ... diff --git a/python/helpers/typeshed/stubs/colorful/colorful/styles.pyi b/python/helpers/typeshed/stubs/colorful/colorful/styles.pyi new file mode 100644 index 000000000000..8a0fcbe01789 --- /dev/null +++ b/python/helpers/typeshed/stubs/colorful/colorful/styles.pyi @@ -0,0 +1,4 @@ +from typing import Final + +SOLARIZED: Final[dict[str, str]] +MONOKAI: Final[dict[str, str]] diff --git a/python/helpers/typeshed/stubs/colorful/colorful/terminal.pyi b/python/helpers/typeshed/stubs/colorful/colorful/terminal.pyi new file mode 100644 index 000000000000..3445996c485b --- /dev/null +++ b/python/helpers/typeshed/stubs/colorful/colorful/terminal.pyi @@ -0,0 +1,16 @@ +from typing import Final, Protocol, overload, type_check_only + +@type_check_only +class _SupportsGet(Protocol): + @overload + def get(self, name: str, /) -> str | None: ... + @overload + def get(self, name: str, default: str, /) -> str: ... + +NO_COLORS: Final[int] +ANSI_8_COLORS: Final[int] +ANSI_16_COLORS: Final[int] +ANSI_256_COLORS: Final[int] +TRUE_COLORS: Final[int] + +def detect_color_support(env: _SupportsGet) -> int: ... diff --git a/python/helpers/typeshed/stubs/colorful/colorful/utils.pyi b/python/helpers/typeshed/stubs/colorful/colorful/utils.pyi new file mode 100644 index 000000000000..a4156beb64f9 --- /dev/null +++ b/python/helpers/typeshed/stubs/colorful/colorful/utils.pyi @@ -0,0 +1,2 @@ +def hex_to_rgb(value: str) -> tuple[int, int, int]: ... +def check_hex(value: str) -> None: ... diff --git a/python/helpers/typeshed/stubs/decorator/decorator.pyi b/python/helpers/typeshed/stubs/decorator/decorator.pyi index 91f3df155c2e..78beff889938 100644 --- a/python/helpers/typeshed/stubs/decorator/decorator.pyi +++ b/python/helpers/typeshed/stubs/decorator/decorator.pyi @@ -20,9 +20,9 @@ class FunctionMaker: args: list[str] varargs: str | None varkw: str | None - defaults: tuple[Any, ...] + defaults: tuple[Any, ...] | None kwonlyargs: list[str] - kwonlydefaults: str | None + kwonlydefaults: _dict[str, Any] | None shortsignature: str | None name: str doc: str | None diff --git a/python/helpers/typeshed/stubs/docutils/METADATA.toml b/python/helpers/typeshed/stubs/docutils/METADATA.toml index 4a5df21d5c5c..1a84d3665e0c 100644 --- a/python/helpers/typeshed/stubs/docutils/METADATA.toml +++ b/python/helpers/typeshed/stubs/docutils/METADATA.toml @@ -1,2 +1,2 @@ -version = "0.22.2" +version = "0.22.3" upstream_repository = "https://sourceforge.net/p/docutils/code" diff --git a/python/helpers/typeshed/stubs/docutils/docutils/parsers/rst/directives/body.pyi b/python/helpers/typeshed/stubs/docutils/docutils/parsers/rst/directives/body.pyi index d1fa231201e6..75f36f360876 100644 --- a/python/helpers/typeshed/stubs/docutils/docutils/parsers/rst/directives/body.pyi +++ b/python/helpers/typeshed/stubs/docutils/docutils/parsers/rst/directives/body.pyi @@ -12,6 +12,16 @@ _DirectiveFn: TypeAlias = Callable[[str], str | list[str]] class BasePseudoSection(Directive): option_spec: ClassVar[dict[str, _DirectiveFn]] node_class: ClassVar[type[nodes.Node] | None] + invalid_parents: ClassVar[ + tuple[ + type[nodes.SubStructural], + type[nodes.Bibliographic], + type[nodes.Decorative], + type[nodes.Body], + type[nodes.Part], + type[nodes.topic], + ] + ] def run(self): ... class Topic(BasePseudoSection): diff --git a/python/helpers/typeshed/stubs/et_xmlfile/METADATA.toml b/python/helpers/typeshed/stubs/et_xmlfile/METADATA.toml new file mode 100644 index 000000000000..6307b2971bd2 --- /dev/null +++ b/python/helpers/typeshed/stubs/et_xmlfile/METADATA.toml @@ -0,0 +1,2 @@ +version = "2.0.*" +upstream_repository = "https://foss.heptapod.net/openpyxl/et_xmlfile" diff --git a/python/helpers/typeshed/stubs/et_xmlfile/et_xmlfile/__init__.pyi b/python/helpers/typeshed/stubs/et_xmlfile/et_xmlfile/__init__.pyi new file mode 100644 index 000000000000..ddf9bb3b811f --- /dev/null +++ b/python/helpers/typeshed/stubs/et_xmlfile/et_xmlfile/__init__.pyi @@ -0,0 +1,9 @@ +from typing import Final + +from .xmlfile import xmlfile as xmlfile + +__version__: Final[str] +__author__: Final[str] +__license__: Final[str] +__author_email__: Final[str] +__url__: Final[str] diff --git a/python/helpers/typeshed/stubs/et_xmlfile/et_xmlfile/incremental_tree.pyi b/python/helpers/typeshed/stubs/et_xmlfile/et_xmlfile/incremental_tree.pyi new file mode 100644 index 000000000000..3d7690a66d24 --- /dev/null +++ b/python/helpers/typeshed/stubs/et_xmlfile/et_xmlfile/incremental_tree.pyi @@ -0,0 +1,170 @@ +import xml.etree.ElementTree as ET +from _typeshed import Unused +from collections.abc import Callable +from typing import Any, Literal, overload + +def current_global_nsmap() -> dict[str, str]: ... + +class IncrementalTree(ET.ElementTree): + def write( # type: ignore[override] + self, + file_or_filename: ET._FileWrite, + encoding: str | None = None, + xml_declaration: bool | None = None, + default_namespace: str | None = None, + method: Literal["xml", "html", "text"] | None = None, # does not accept 'c14n', unlike parent method + *, + short_empty_elements: bool = True, + nsmap: dict[str, str] | None = None, + root_ns_only: bool = False, + minimal_ns_only: bool = False, + ) -> None: ... + +def process_attribs( + elem: ET.Element[Any], + is_nsmap_scope_changed: bool | None, + default_ns_attr_prefix: str | None, + nsmap_scope: dict[str, str], + global_nsmap: dict[str, str], + new_namespace_prefixes: set[str], + uri_to_prefix: dict[str, str], +) -> tuple[list[tuple[str, str]], str | None, dict[str, str]]: ... +def write_elem_start( + write: Callable[..., None], + elem: ET.Element[Any], + nsmap_scope: dict[str, str], + global_nsmap: dict[str, str], + short_empty_elements: bool | None, + is_html: bool | None, + is_root: bool = False, + uri_to_prefix: dict[str, str] | None = None, + default_ns_attr_prefix: str | None = None, + new_nsmap: dict[str, str] | None = None, + **kwargs: Unused, +) -> tuple[str | None, dict[str, str], str | None, dict[str, str] | None, bool]: ... +@overload +def tostring( + element: ET.Element[Any], + encoding: None = None, + method: Literal["xml", "html", "text"] | None = None, + *, + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, + nsmap: dict[str, str] | None = None, + root_ns_only: bool = False, + minimal_ns_only: bool = False, + tree_cls: type[ET.ElementTree] = ..., +) -> bytes: ... +@overload +def tostring( + element: ET.Element[Any], + encoding: Literal["unicode"], + method: Literal["xml", "html", "text"] | None = None, + *, + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, + nsmap: dict[str, str] | None = None, + root_ns_only: bool = False, + minimal_ns_only: bool = False, + tree_cls: type[ET.ElementTree] = ..., +) -> str: ... +@overload +def tostring( + element: ET.Element[Any], + encoding: str, + method: Literal["xml", "html", "text"] | None = None, + *, + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, + nsmap: dict[str, str] | None = None, + root_ns_only: bool = False, + minimal_ns_only: bool = False, + tree_cls: type[ET.ElementTree] = ..., +) -> Any: ... +@overload +def tostringlist( + element: ET.Element[Any], + encoding: None = None, + method: Literal["xml", "html", "text"] | None = None, + *, + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, + nsmap: dict[str, str] | None = None, + root_ns_only: bool = False, + minimal_ns_only: bool = False, + tree_cls: type[ET.ElementTree] = ..., +) -> list[bytes]: ... +@overload +def tostringlist( + element: ET.Element[Any], + encoding: Literal["unicode"], + method: Literal["xml", "html", "text"] | None = None, + *, + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, + nsmap: dict[str, str] | None = None, + root_ns_only: bool = False, + minimal_ns_only: bool = False, + tree_cls: type[ET.ElementTree] = ..., +) -> list[str]: ... +@overload +def tostringlist( + element: ET.Element[Any], + encoding: str, + method: Literal["xml", "html", "text"] | None = None, + *, + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, + nsmap: dict[str, str] | None = None, + root_ns_only: bool = False, + minimal_ns_only: bool = False, + tree_cls: type[ET.ElementTree] = ..., +) -> list[Any]: ... +@overload +def compat_tostring( + element: ET.Element[Any], + encoding: None = None, + method: Literal["xml", "html", "text"] | None = None, + *, + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, + nsmap: dict[str, str] | None = None, + root_ns_only: bool = True, + minimal_ns_only: bool = False, + tree_cls: type[ET.ElementTree] = ..., +) -> bytes: ... +@overload +def compat_tostring( + element: ET.Element[Any], + encoding: Literal["unicode"], + method: Literal["xml", "html", "text"] | None = None, + *, + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, + nsmap: dict[str, str] | None = None, + root_ns_only: bool = True, + minimal_ns_only: bool = False, + tree_cls: type[ET.ElementTree] = ..., +) -> str: ... +@overload +def compat_tostring( + element: ET.Element[Any], + encoding: str, + method: Literal["xml", "html", "text"] | None = None, + *, + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, + nsmap: dict[str, str] | None = None, + root_ns_only: bool = True, + minimal_ns_only: bool = False, + tree_cls: type[ET.ElementTree] = ..., +) -> Any: ... diff --git a/python/helpers/typeshed/stubs/et_xmlfile/et_xmlfile/xmlfile.pyi b/python/helpers/typeshed/stubs/et_xmlfile/et_xmlfile/xmlfile.pyi new file mode 100644 index 000000000000..9e1f55e25689 --- /dev/null +++ b/python/helpers/typeshed/stubs/et_xmlfile/et_xmlfile/xmlfile.pyi @@ -0,0 +1,37 @@ +import types +import xml.etree.ElementTree as ET +from _typeshed import Incomplete +from collections.abc import Generator +from contextlib import contextmanager +from typing import Any + +class LxmlSyntaxError(Exception): ... + +class _IncrementalFileWriter: + global_nsmap: dict[str, str] + is_html: bool + def __init__(self, output_file: ET._FileWrite) -> None: ... + @contextmanager + def element( + self, + tag: str | ET._ElementCallable, + attrib: dict[str, str] | None = None, + nsmap: dict[str, str] | None = None, + **_extra: str, + ) -> Generator[None]: ... + def write(self, arg: str | ET.Element[Any]) -> None: ... + def __enter__(self) -> None: ... + def __exit__( + self, type: type[BaseException] | None, value: BaseException | None, traceback: types.TracebackType | None + ) -> None: ... + +class xmlfile: + encoding: str + writer_cm: Incomplete + def __init__( + self, output_file: ET._FileWrite, buffered: bool = False, encoding: str = "utf-8", close: bool = False + ) -> None: ... + def __enter__(self) -> _IncrementalFileWriter: ... + def __exit__( + self, type: type[BaseException] | None, value: BaseException | None, traceback: types.TracebackType | None + ) -> None: ... diff --git a/python/helpers/typeshed/stubs/fanstatic/METADATA.toml b/python/helpers/typeshed/stubs/fanstatic/METADATA.toml index 563c927555fc..ece906561784 100644 --- a/python/helpers/typeshed/stubs/fanstatic/METADATA.toml +++ b/python/helpers/typeshed/stubs/fanstatic/METADATA.toml @@ -1,3 +1,3 @@ -version = "1.5.*" +version = "1.6.*" upstream_repository = "https://github.com/zopefoundation/fanstatic" requires = ["types-setuptools", "types-WebOb"] diff --git a/python/helpers/typeshed/stubs/flake8-bugbear/@tests/stubtest_allowlist.txt b/python/helpers/typeshed/stubs/flake8-bugbear/@tests/stubtest_allowlist.txt index 9e7e40af5094..ae255e50fb90 100644 --- a/python/helpers/typeshed/stubs/flake8-bugbear/@tests/stubtest_allowlist.txt +++ b/python/helpers/typeshed/stubs/flake8-bugbear/@tests/stubtest_allowlist.txt @@ -24,7 +24,7 @@ bugbear.NamedExprFinder.__gt__ bugbear.NamedExprFinder.__le__ bugbear.NamedExprFinder.__lt__ bugbear.NamedExprFinder.__match_args__ -# >= Python 3.13 +# == Python 3.13 bugbear.B040CaughtException.__replace__ bugbear.B041VariableKeyType.__replace__ bugbear.BugBearChecker.__replace__ diff --git a/python/helpers/typeshed/stubs/flake8-bugbear/METADATA.toml b/python/helpers/typeshed/stubs/flake8-bugbear/METADATA.toml index 13d13490adac..367daa4d4439 100644 --- a/python/helpers/typeshed/stubs/flake8-bugbear/METADATA.toml +++ b/python/helpers/typeshed/stubs/flake8-bugbear/METADATA.toml @@ -1,2 +1,2 @@ -version = "24.12.12" +version = "25.10.21" upstream_repository = "https://github.com/PyCQA/flake8-bugbear" diff --git a/python/helpers/typeshed/stubs/flake8-bugbear/bugbear.pyi b/python/helpers/typeshed/stubs/flake8-bugbear/bugbear.pyi index 3e708239592e..2e92ede7682b 100644 --- a/python/helpers/typeshed/stubs/flake8-bugbear/bugbear.pyi +++ b/python/helpers/typeshed/stubs/flake8-bugbear/bugbear.pyi @@ -2,10 +2,10 @@ import argparse import ast import sys from _typeshed import Incomplete -from collections.abc import Callable, Generator, Iterable, Sequence +from collections.abc import Generator, Iterable, Sequence from functools import partial from logging import Logger -from typing import Any, ClassVar, Final, Literal, NamedTuple, overload +from typing import Any, ClassVar, Final, Literal, NamedTuple, Protocol, overload __version__: Final[str] LOG: Logger @@ -28,7 +28,7 @@ class BugBearChecker: max_line_length: int visitor: ast.NodeVisitor options: argparse.Namespace | None - def run(self) -> Generator[error]: ... + def run(self) -> Iterable[tuple[int, int, str, type[BugBearChecker]]]: ... def gen_line_based_checks(self) -> Generator[error]: ... @classmethod def adapt_error(cls, e: error) -> tuple[int, int, str, type[BugBearChecker]]: ... @@ -67,7 +67,19 @@ class B041VariableKeyType: name: str def __init__(self, name: str) -> None: ... +class AstPositionNode(Protocol): + lineno: int + col_offset: int + class BugBearVisitor(ast.NodeVisitor): + filename: str + lines: Sequence[str] | None + b008_b039_extend_immutable_calls: set[str] + b902_classmethod_decorators: set[str] + node_window: list[ast.AST] + errors: list[error] + contexts: list[Context] + b040_caught_exception: B040CaughtException | None NODE_WINDOW_SIZE: ClassVar[int] = 4 in_trystar: str def __init__( @@ -82,6 +94,7 @@ class BugBearVisitor(ast.NodeVisitor): b040_caught_exception: B040CaughtException | None = None, in_trystar: str = "", ) -> None: ... + def add_error(self, code: str, node: AstPositionNode, *vars: object) -> None: ... @property def node_stack(self) -> list[Context]: ... def in_class_init(self) -> bool: ... @@ -137,7 +150,9 @@ class BugBearVisitor(ast.NodeVisitor): def check_for_b017(self, node: ast.With | ast.AsyncWith) -> None: ... def check_for_b019(self, node: ast.FunctionDef | ast.AsyncFunctionDef) -> None: ... def check_for_b020(self, node: ast.For | ast.AsyncFor | ast.comprehension) -> None: ... - def check_for_b023(self, loop_node: ast.For | ast.AsyncFor | ast.comprehension) -> None: ... + def check_for_b023( + self, loop_node: ast.For | ast.AsyncFor | ast.While | ast.GeneratorExp | ast.SetComp | ast.ListComp | ast.DictComp + ) -> None: ... def check_for_b024_and_b027(self, node: ast.ClassDef) -> None: ... def check_for_b026(self, call: ast.Call) -> None: ... def check_for_b031(self, loop_node: ast.For | ast.AsyncFor) -> None: ... @@ -163,12 +178,14 @@ class BugBearVisitor(ast.NodeVisitor): def check_for_b908(self, node: ast.With) -> None: ... def check_for_b025(self, node: ast.Try) -> None: ... def check_for_b905(self, node: ast.Call) -> None: ... + def check_for_b912(self, node: ast.Call) -> None: ... def check_for_b906(self, node: ast.FunctionDef) -> None: ... def check_for_b907(self, node: ast.JoinedStr) -> None: ... def check_for_b028(self, node: ast.Call) -> None: ... def check_for_b032(self, node: ast.AnnAssign) -> None: ... def check_for_b033(self, node: ast.Set | ast.List | ast.Tuple) -> None: ... def check_for_b034(self, node: ast.Call) -> None: ... + def check_for_b042(self, node: ast.ClassDef) -> None: ... def check_for_b909(self, node: ast.For) -> None: ... def check_for_b910(self, node: ast.Call) -> None: ... def check_for_b911(self, node: ast.Call) -> None: ... @@ -180,7 +197,7 @@ class B909Checker(ast.NodeVisitor): MUTATING_FUNCTIONS: ClassVar[tuple[str, ...]] name: str key: str - mutations: dict[int, list[ast.AST]] + mutations: dict[int, list[ast.Assign | ast.AugAssign | ast.Delete | ast.Call]] def __init__(self, name: str, key: str) -> None: ... def visit_Assign(self, node: ast.Assign) -> None: ... def visit_AugAssign(self, node: ast.AugAssign) -> None: ... @@ -222,75 +239,30 @@ class B020NameFinder(NameFinder): def visit_comprehension(self, node: ast.comprehension) -> None: ... def visit_Lambda(self, node: ast.Lambda) -> None: ... +B005_METHODS: Final[set[str]] +B006_MUTABLE_LITERALS: Final[tuple[Literal["Dict"], Literal["List"], Literal["Set"]]] +B006_MUTABLE_COMPREHENSIONS: Final[tuple[Literal["ListComp"], Literal["DictComp"], Literal["SetComp"]]] +B006_MUTABLE_CALLS: Final[set[str]] +B008_IMMUTABLE_CALLS: Final[set[str]] +B014_REDUNDANT_EXCEPTIONS: Final[dict[Literal["OSError", "ValueError"], set[str]]] +B019_CACHES: Final[set[str]] +B902_IMPLICIT_CLASSMETHODS: Final[set[str]] +B902_SELF: Final[list[str]] +B902_CLS: Final[list[str]] +B902_METACLS: Final[list[str]] + class error(NamedTuple): lineno: int col: int message: str type: type[BugBearChecker] - vars: tuple[Incomplete] + # Arguments for formatting the message, i.e. message.format(*vars). + vars: tuple[object, ...] -Error: Callable[..., partial[error]] -B001: partial[error] -B002: partial[error] -B003: partial[error] -B004: partial[error] -B005: partial[error] -B005_METHODS: Final[set[str]] -B006: partial[error] -B006_MUTABLE_LITERALS: Final[tuple[Literal["Dict"], Literal["List"], Literal["Set"]]] -B006_MUTABLE_COMPREHENSIONS: Final[tuple[Literal["ListComp"], Literal["DictComp"], Literal["SetComp"]]] -B006_MUTABLE_CALLS: Final[set[str]] -B007: partial[error] -B008: partial[error] -B008_IMMUTABLE_CALLS: Final[set[str]] -B009: partial[error] -B010: partial[error] -B011: partial[error] -B012: partial[error] -B013: partial[error] -B014: partial[error] -B014_REDUNDANT_EXCEPTIONS: Final[dict[Literal["OSError", "ValueError"], set[str]]] -B015: partial[error] -B016: partial[error] -B017: partial[error] -B018: partial[error] -B019: partial[error] -B019_CACHES: Final[set[str]] -B020: partial[error] -B021: partial[error] -B022: partial[error] -B023: partial[error] -B024: partial[error] -B025: partial[error] -B026: partial[error] -B027: partial[error] -B028: partial[error] -B029: partial[error] -B030: partial[error] -B031: partial[error] -B032: partial[error] -B033: partial[error] -B034: partial[error] -B035: partial[error] -B036: partial[error] -B037: partial[error] -B039: partial[error] -B040: partial[error] -B041: partial[error] -B901: partial[error] -B902: partial[error] -B902_IMPLICIT_CLASSMETHODS: Final[set[str]] -B902_SELF: Final[list[str]] -B902_CLS: Final[list[str]] -B902_METACLS: Final[list[str]] -B903: partial[error] -B904: partial[error] -B905: partial[error] -B906: partial[error] -B907: partial[error] -B908: partial[error] -B909: partial[error] -B910: partial[error] -B911: partial[error] -B950: partial[error] +class Error: + message: str + def __init__(self, message: str) -> None: ... + def __call__(self, lineno: int, col: int, vars: tuple[object, ...] = ()) -> error: ... + +error_codes: Final[dict[str, Error]] disabled_by_default: Final[list[str]] diff --git a/python/helpers/typeshed/stubs/flake8-builtins/METADATA.toml b/python/helpers/typeshed/stubs/flake8-builtins/METADATA.toml index c50b847abe22..3406949e4fec 100644 --- a/python/helpers/typeshed/stubs/flake8-builtins/METADATA.toml +++ b/python/helpers/typeshed/stubs/flake8-builtins/METADATA.toml @@ -1,3 +1,3 @@ -version = "3.0.*" +version = "3.1.*" upstream_repository = "https://github.com/gforcada/flake8-builtins" requires = ["types-flake8"] diff --git a/python/helpers/typeshed/stubs/fpdf2/fpdf/drawing.pyi b/python/helpers/typeshed/stubs/fpdf2/fpdf/drawing.pyi index 1d0fbefb7245..c393f1f7eaa7 100644 --- a/python/helpers/typeshed/stubs/fpdf2/fpdf/drawing.pyi +++ b/python/helpers/typeshed/stubs/fpdf2/fpdf/drawing.pyi @@ -1,18 +1,36 @@ import decimal -from _typeshed import Incomplete +import sys +from _typeshed import Incomplete, SupportsWrite from collections import OrderedDict -from collections.abc import Callable, Generator, Sequence +from collections.abc import Callable, Generator, Iterable, Sequence from contextlib import contextmanager from re import Pattern -from typing import Any, ClassVar, Literal, NamedTuple, TypeVar, overload +from typing import Any, ClassVar, Literal, NamedTuple, Protocol, TypeVar, overload, type_check_only from typing_extensions import Self, TypeAlias +if sys.version_info >= (3, 10): + from types import EllipsisType +else: + # Rely on builtins.ellipsis + from builtins import ellipsis as EllipsisType + +from .enums import PathPaintRule from .syntax import Name, Raw __pdoc__: dict[str, bool] +_T = TypeVar("_T") _CallableT = TypeVar("_CallableT", bound=Callable[..., Any]) +@type_check_only +class _SupportsSerialize(Protocol): + def serialize(self) -> str: ... + +@type_check_only +class _SupportsEndPoint(Protocol): + @property + def end_point(self) -> Point: ... + def force_nodocument(item: _CallableT) -> _CallableT: ... def force_document(item: _CallableT) -> _CallableT: ... @@ -23,12 +41,24 @@ EOL_CHARS: frozenset[str] DELIMITERS: frozenset[str] STR_ESC: Pattern[str] STR_ESC_MAP: dict[str, str] +_Primitive: TypeAlias = ( + _SupportsSerialize + | Number + | str + | bytes + | bool + | Raw + | list[_Primitive] + | tuple[_Primitive, ...] + | dict[Name, _Primitive] + | None +) class GraphicsStateDictRegistry(OrderedDict[Raw, Name]): def register_style(self, style: GraphicsStyle) -> Name | None: ... -def number_to_str(number) -> str: ... -def render_pdf_primitive(primitive) -> Raw: ... +def number_to_str(number: Number) -> str: ... +def render_pdf_primitive(primitive: _Primitive) -> Raw: ... class _DeviceRGBBase(NamedTuple): r: Number @@ -72,8 +102,8 @@ class DeviceCMYK(_DeviceCMYKBase): def colors(self) -> tuple[Number, Number, Number, Number]: ... def serialize(self) -> str: ... -def rgb8(r, g, b, a=None) -> DeviceRGB: ... -def gray8(g, a=None) -> DeviceGray: ... +def rgb8(r: Number, g: Number, b: Number, a: Number | None = None) -> DeviceRGB: ... +def gray8(g: Number, a: Number | None = None) -> DeviceGray: ... @overload def convert_to_device_color(r: DeviceCMYK) -> DeviceCMYK: ... @overload @@ -87,24 +117,24 @@ def convert_to_device_color(r: int, g: Literal[-1] = -1, b: Literal[-1] = -1) -> @overload def convert_to_device_color(r: Sequence[int] | int, g: int, b: int) -> DeviceGray | DeviceRGB: ... def cmyk8(c, m, y, k, a=None) -> DeviceCMYK: ... -def color_from_hex_string(hexstr) -> DeviceRGB: ... -def color_from_rgb_string(rgbstr) -> DeviceRGB: ... +def color_from_hex_string(hexstr: str) -> DeviceRGB: ... +def color_from_rgb_string(rgbstr: str) -> DeviceRGB: ... class Point(NamedTuple): x: Number y: Number - def render(self): ... - def dot(self, other): ... - def angle(self, other): ... - def mag(self): ... - def __add__(self, other): ... - def __sub__(self, other): ... - def __neg__(self): ... - def __mul__(self, other): ... - def __rmul__(self, other): ... - def __truediv__(self, other): ... - def __floordiv__(self, other): ... - def __matmul__(self, other): ... + def render(self) -> str: ... + def dot(self, other: Point) -> Number: ... + def angle(self, other: Point) -> float: ... + def mag(self) -> Number: ... + def __add__(self, other: Point) -> Point: ... # type: ignore[override] + def __sub__(self, other: Point) -> Point: ... + def __neg__(self) -> Point: ... + def __mul__(self, other: Number) -> Point: ... # type: ignore[override] + def __rmul__(self, other: Number) -> Point: ... # type: ignore[override] + def __truediv__(self, other: Number) -> Point: ... + def __floordiv__(self, other: Number) -> Point: ... + def __matmul__(self, other: Transform) -> Point: ... class Transform(NamedTuple): a: Number @@ -114,35 +144,35 @@ class Transform(NamedTuple): e: Number f: Number @classmethod - def identity(cls): ... + def identity(cls) -> Self: ... @classmethod - def translation(cls, x, y): ... + def translation(cls, x: Number, y: Number) -> Self: ... @classmethod - def scaling(cls, x, y=None): ... + def scaling(cls, x: Number, y: Number | None = None) -> Self: ... @classmethod - def rotation(cls, theta): ... + def rotation(cls, theta: Number) -> Self: ... @classmethod - def rotation_d(cls, theta_d): ... + def rotation_d(cls, theta_d: Number) -> Self: ... @classmethod - def shearing(cls, x, y=None): ... - def translate(self, x, y): ... - def scale(self, x, y=None): ... - def rotate(self, theta): ... - def rotate_d(self, theta_d): ... - def shear(self, x, y=None): ... - def about(self, x, y): ... - def __mul__(self, other): ... - def __rmul__(self, other): ... - def __matmul__(self, other): ... - def render(self, last_item): ... + def shearing(cls, x: Number, y: Number | None = None) -> Self: ... + def translate(self, x: Number, y: Number) -> Self: ... + def scale(self, x: Number, y: Number | None = None) -> Self: ... + def rotate(self, theta: Number) -> Self: ... + def rotate_d(self, theta_d: Number) -> Self: ... + def shear(self, x: Number, y: Number | None = None) -> Self: ... + def about(self, x: Number, y: Number) -> Transform: ... + def __mul__(self, other: Number) -> Transform: ... # type: ignore[override] + def __rmul__(self, other: Number) -> Transform: ... # type: ignore[override] + def __matmul__(self, other: Transform) -> Self: ... + def render(self, last_item: _T) -> tuple[str, _T]: ... class GraphicsStyle: - INHERIT: ClassVar[Incomplete] + INHERIT: ClassVar[EllipsisType] MERGE_PROPERTIES: ClassVar[tuple[str, ...]] TRANSPARENCY_KEYS: ClassVar[tuple[Name, ...]] PDF_STYLE_KEYS: ClassVar[tuple[Name, ...]] @classmethod - def merge(cls, parent, child): ... + def merge(cls, parent, child) -> Self: ... def __init__(self) -> None: ... def __deepcopy__(self, memo) -> Self: ... @property @@ -150,13 +180,13 @@ class GraphicsStyle: @allow_transparency.setter def allow_transparency(self, new): ... @property - def paint_rule(self): ... + def paint_rule(self) -> PathPaintRule | EllipsisType: ... @paint_rule.setter - def paint_rule(self, new) -> None: ... + def paint_rule(self, new: PathPaintRule | str | EllipsisType | None) -> None: ... @property - def auto_close(self): ... + def auto_close(self) -> bool | EllipsisType: ... @auto_close.setter - def auto_close(self, new) -> None: ... + def auto_close(self, new: bool | EllipsisType) -> None: ... @property def intersection_rule(self): ... @intersection_rule.setter @@ -172,7 +202,7 @@ class GraphicsStyle: @property def stroke_color(self): ... @stroke_color.setter - def stroke_color(self, color) -> None: ... + def stroke_color(self, color: str | DeviceRGB | DeviceGray | DeviceCMYK | EllipsisType | None) -> None: ... @property def stroke_opacity(self): ... @stroke_opacity.setter @@ -184,7 +214,7 @@ class GraphicsStyle: @property def stroke_width(self): ... @stroke_width.setter - def stroke_width(self, width) -> None: ... + def stroke_width(self, width: Number | EllipsisType | None) -> None: ... @property def stroke_cap_style(self): ... @stroke_cap_style.setter @@ -196,36 +226,66 @@ class GraphicsStyle: @property def stroke_miter_limit(self): ... @stroke_miter_limit.setter - def stroke_miter_limit(self, value) -> None: ... + def stroke_miter_limit(self, value: Number | EllipsisType) -> None: ... @property def stroke_dash_pattern(self): ... @stroke_dash_pattern.setter - def stroke_dash_pattern(self, value) -> None: ... + def stroke_dash_pattern(self, value: Number | Iterable[Number] | EllipsisType | None) -> None: ... @property def stroke_dash_phase(self): ... @stroke_dash_phase.setter - def stroke_dash_phase(self, value): ... + def stroke_dash_phase(self, value: Number | EllipsisType): ... def serialize(self) -> Raw | None: ... - def resolve_paint_rule(self): ... + def resolve_paint_rule(self) -> PathPaintRule: ... class Move(NamedTuple): pt: Point @property - def end_point(self): ... - def render(self, gsd_registry, style, last_item, initial_point): ... - def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... + def end_point(self) -> Point: ... + def render( + self, gsd_registry: GraphicsStateDictRegistry, style: GraphicsStyle, last_item: _SupportsEndPoint, initial_point: Point + ) -> tuple[str, Self, Point]: ... + def render_debug( + self, + gsd_registry: GraphicsStateDictRegistry, + style: GraphicsStyle, + last_item: _SupportsEndPoint, + initial_point: Point, + debug_stream: SupportsWrite[str], + pfx: str, + ) -> tuple[str, Self, Point]: ... class RelativeMove(NamedTuple): pt: Point - def render(self, gsd_registry, style, last_item, initial_point): ... - def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... + def render( + self, gsd_registry: GraphicsStateDictRegistry, style: GraphicsStyle, last_item: _SupportsEndPoint, initial_point: Point + ) -> tuple[str, Move, Point]: ... + def render_debug( + self, + gsd_registry: GraphicsStateDictRegistry, + style: GraphicsStyle, + last_item: _SupportsEndPoint, + initial_point: Point, + debug_stream: SupportsWrite[str], + pfx: str, + ) -> tuple[str, Move, Point]: ... class Line(NamedTuple): pt: Point @property - def end_point(self): ... - def render(self, gsd_registry, style, last_item, initial_point): ... - def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... + def end_point(self) -> Point: ... + def render( + self, gsd_registry: GraphicsStateDictRegistry, style: GraphicsStyle, last_item: _SupportsEndPoint, initial_point: Point + ) -> tuple[str, Self, Point]: ... + def render_debug( + self, + gsd_registry: GraphicsStateDictRegistry, + style: GraphicsStyle, + last_item: _SupportsEndPoint, + initial_point: Point, + debug_stream: SupportsWrite[str], + pfx: str, + ) -> tuple[str, Self, Point]: ... class RelativeLine(NamedTuple): pt: Point @@ -257,7 +317,7 @@ class BezierCurve(NamedTuple): c2: Point end: Point @property - def end_point(self): ... + def end_point(self) -> Point: ... def render(self, gsd_registry, style, last_item, initial_point): ... def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... @@ -272,7 +332,7 @@ class QuadraticBezierCurve(NamedTuple): ctrl: Point end: Point @property - def end_point(self): ... + def end_point(self) -> Point: ... def to_cubic_curve(self, start_point): ... def render(self, gsd_registry, style, last_item, initial_point): ... def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... @@ -290,7 +350,7 @@ class Arc(NamedTuple): sweep: bool end: Point @staticmethod - def subdivde_sweep(sweep_angle) -> Generator[Incomplete, None, None]: ... + def subdivde_sweep(sweep_angle: Number) -> Generator[tuple[Point, Point, Point]]: ... def render(self, gsd_registry, style, last_item, initial_point): ... def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... @@ -337,10 +397,10 @@ class DrawingContext: def render_debug(self, gsd_registry, first_point, scale, height, starting_style, debug_stream): ... class PaintedPath: - def __init__(self, x: int = 0, y: int = 0) -> None: ... + def __init__(self, x: Number = 0, y: Number = 0) -> None: ... def __deepcopy__(self, memo) -> Self: ... @property - def style(self): ... + def style(self) -> GraphicsStyle: ... @property def transform(self): ... @transform.setter @@ -361,30 +421,34 @@ class PaintedPath: def transform_group(self, transform) -> Generator[Self]: ... def add_path_element(self, item, _copy: bool = True) -> None: ... def remove_last_path_element(self) -> None: ... - def rectangle(self, x, y, w, h, rx: int = 0, ry: int = 0) -> Self: ... - def circle(self, cx, cy, r) -> Self: ... - def ellipse(self, cx, cy, rx, ry) -> Self: ... - def move_to(self, x, y) -> Self: ... - def move_relative(self, x, y) -> Self: ... - def line_to(self, x, y) -> Self: ... - def line_relative(self, dx, dy) -> Self: ... - def horizontal_line_to(self, x) -> Self: ... - def horizontal_line_relative(self, dx) -> Self: ... - def vertical_line_to(self, y) -> Self: ... - def vertical_line_relative(self, dy) -> Self: ... - def curve_to(self, x1, y1, x2, y2, x3, y3) -> Self: ... - def curve_relative(self, dx1, dy1, dx2, dy2, dx3, dy3) -> Self: ... - def quadratic_curve_to(self, x1, y1, x2, y2) -> Self: ... - def quadratic_curve_relative(self, dx1, dy1, dx2, dy2) -> Self: ... - def arc_to(self, rx, ry, rotation, large_arc, positive_sweep, x, y) -> Self: ... - def arc_relative(self, rx, ry, rotation, large_arc, positive_sweep, dx, dy) -> Self: ... + def rectangle(self, x: Number, y: Number, w: Number, h: Number, rx: Number = 0, ry: Number = 0) -> Self: ... + def circle(self, cx: Number, cy: Number, r: Number) -> Self: ... + def ellipse(self, cx: Number, cy: Number, rx: Number, ry: Number) -> Self: ... + def move_to(self, x: Number, y: Number) -> Self: ... + def move_relative(self, x: Number, y: Number) -> Self: ... + def line_to(self, x: Number, y: Number) -> Self: ... + def line_relative(self, dx: Number, dy: Number) -> Self: ... + def horizontal_line_to(self, x: Number) -> Self: ... + def horizontal_line_relative(self, dx: Number) -> Self: ... + def vertical_line_to(self, y: Number) -> Self: ... + def vertical_line_relative(self, dy: Number) -> Self: ... + def curve_to(self, x1: Number, y1: Number, x2: Number, y2: Number, x3: Number, y3: Number) -> Self: ... + def curve_relative(self, dx1: Number, dy1: Number, dx2: Number, dy2: Number, dx3: Number, dy3: Number) -> Self: ... + def quadratic_curve_to(self, x1: Number, y1: Number, x2: Number, y2: Number) -> Self: ... + def quadratic_curve_relative(self, dx1: Number, dy1: Number, dx2: Number, dy2: Number) -> Self: ... + def arc_to( + self, rx: Number, ry: Number, rotation: Number, large_arc: bool, positive_sweep: bool, x: Number, y: Number + ) -> Self: ... + def arc_relative( + self, rx: Number, ry: Number, rotation: Number, large_arc: bool, positive_sweep: bool, dx: Number, dy: Number + ) -> Self: ... def close(self) -> None: ... def render(self, gsd_registry, style, last_item, initial_point, debug_stream=None, pfx=None): ... def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... class ClippingPath(PaintedPath): - paint_rule: Incomplete - def __init__(self, x: int = 0, y: int = 0) -> None: ... + paint_rule: PathPaintRule + def __init__(self, x: Number = 0, y: Number = 0) -> None: ... def render(self, gsd_registry, style, last_item, initial_point, debug_stream=None, pfx=None): ... def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... diff --git a/python/helpers/typeshed/stubs/fpdf2/fpdf/text_region.pyi b/python/helpers/typeshed/stubs/fpdf2/fpdf/text_region.pyi index 481a173b16c0..e5b62cfa839f 100644 --- a/python/helpers/typeshed/stubs/fpdf2/fpdf/text_region.pyi +++ b/python/helpers/typeshed/stubs/fpdf2/fpdf/text_region.pyi @@ -14,7 +14,7 @@ class Extents(NamedTuple): class TextRegionMixin: def __init__(self, *args, **kwargs) -> None: ... def register_text_region(self, region) -> None: ... - def is_current_text_region(self, region): ... + def is_current_text_region(self, region) -> bool: ... def clear_text_region(self) -> None: ... class LineWrapper(NamedTuple): diff --git a/python/helpers/typeshed/stubs/gevent/@tests/stubtest_allowlist_win32.txt b/python/helpers/typeshed/stubs/gevent/@tests/stubtest_allowlist_win32.txt index a8a54020a4c7..3c3dfcea433d 100644 --- a/python/helpers/typeshed/stubs/gevent/@tests/stubtest_allowlist_win32.txt +++ b/python/helpers/typeshed/stubs/gevent/@tests/stubtest_allowlist_win32.txt @@ -4,6 +4,7 @@ gevent.signal.__all__ gevent.signal.getsignal gevent.signal.signal +gevent.signal.set_wakeup_fd # these don't exist on win32 in stdlib, but they do in gevent, for now we ignore them gevent.socket.SocketType.share diff --git a/python/helpers/typeshed/stubs/gevent/METADATA.toml b/python/helpers/typeshed/stubs/gevent/METADATA.toml index dce29acee5db..b4c7ee9cf896 100644 --- a/python/helpers/typeshed/stubs/gevent/METADATA.toml +++ b/python/helpers/typeshed/stubs/gevent/METADATA.toml @@ -1,4 +1,4 @@ -version = "25.4.*" +version = "25.9.*" upstream_repository = "https://github.com/gevent/gevent" requires = ["types-greenlet", "types-psutil"] diff --git a/python/helpers/typeshed/stubs/gevent/gevent/libuv/watcher.pyi b/python/helpers/typeshed/stubs/gevent/gevent/libuv/watcher.pyi index af5b5e6331a4..0f008f490f78 100644 --- a/python/helpers/typeshed/stubs/gevent/gevent/libuv/watcher.pyi +++ b/python/helpers/typeshed/stubs/gevent/gevent/libuv/watcher.pyi @@ -14,6 +14,7 @@ class io(_base.IoMixin, watcher): @events.setter def events(self, value: int) -> None: ... def multiplex(self, events: int) -> _IoWatcher: ... + def close_all(self) -> None: ... class fork(_base.ForkMixin, watcher): ... class child(_base.ChildMixin, watcher): ... diff --git a/python/helpers/typeshed/stubs/gevent/gevent/os.pyi b/python/helpers/typeshed/stubs/gevent/gevent/os.pyi index 279312a03bd2..ac7d0cf0b976 100644 --- a/python/helpers/typeshed/stubs/gevent/gevent/os.pyi +++ b/python/helpers/typeshed/stubs/gevent/gevent/os.pyi @@ -10,6 +10,7 @@ def tp_read(fd: FileDescriptor, n: int) -> bytes: ... def tp_write(fd: FileDescriptor, buf: ReadableBuffer) -> int: ... if sys.platform != "win32": + def close(fd: FileDescriptor) -> None: ... def make_nonblocking(fd: FileDescriptor) -> Literal[True] | None: ... def nb_read(fd: FileDescriptor, n: int) -> bytes: ... def nb_write(fd: FileDescriptor, buf: ReadableBuffer) -> int: ... diff --git a/python/helpers/typeshed/stubs/gevent/gevent/signal.pyi b/python/helpers/typeshed/stubs/gevent/gevent/signal.pyi index 4c08f33ff56a..66d277ac680a 100644 --- a/python/helpers/typeshed/stubs/gevent/gevent/signal.pyi +++ b/python/helpers/typeshed/stubs/gevent/gevent/signal.pyi @@ -8,5 +8,6 @@ from signal import _HANDLER, _SIGNUM if sys.platform != "win32": def getsignal(signalnum: _SIGNUM) -> _HANDLER: ... def signal(signalnum: _SIGNUM, handler: _HANDLER) -> _HANDLER: ... + def set_wakeup_fd(fd: int, /, *, warn_on_full_buffer: bool = True) -> int: ... - __all__ = ["signal", "getsignal"] + __all__ = ["signal", "getsignal", "set_wakeup_fd"] diff --git a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/_cache.pyi b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/_cache.pyi index e40a6ddb344f..3f416ed306b7 100644 --- a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/_cache.pyi +++ b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/_cache.pyi @@ -1,5 +1,4 @@ from _typeshed import Incomplete -from typing import Any from google.cloud.ndb import tasklets as tasklets @@ -13,11 +12,11 @@ class _GlobalCacheBatch: def make_call(self) -> None: ... def future_info(self, key) -> None: ... -global_get: Any +global_get: Incomplete class _GlobalCacheGetBatch(_GlobalCacheBatch): - todo: Any - keys: Any + todo: Incomplete + keys: Incomplete def __init__(self, ignore_options) -> None: ... def add(self, key): ... def done_callback(self, cache_call) -> None: ... @@ -27,7 +26,7 @@ class _GlobalCacheGetBatch(_GlobalCacheBatch): def global_set(key, value, expires: Incomplete | None = ..., read: bool = ...): ... class _GlobalCacheSetBatch(_GlobalCacheBatch): - expires: Any + expires: Incomplete todo: object futures: object def __init__(self, options) -> None: ... @@ -41,17 +40,17 @@ class _GlobalCacheSetIfNotExistsBatch(_GlobalCacheSetBatch): def make_call(self): ... def future_info(self, key, value): ... # type:ignore[override] -global_delete: Any +global_delete: Incomplete class _GlobalCacheDeleteBatch(_GlobalCacheBatch): - keys: Any - futures: Any + keys: Incomplete + futures: Incomplete def __init__(self, ignore_options) -> None: ... def add(self, key): ... def make_call(self): ... def future_info(self, key): ... -global_watch: Any +global_watch: Incomplete class _GlobalCacheWatchBatch(_GlobalCacheDeleteBatch): def make_call(self): ... @@ -63,7 +62,7 @@ class _GlobalCacheUnwatchBatch(_GlobalCacheDeleteBatch): def make_call(self): ... def future_info(self, key): ... -global_compare_and_swap: Any +global_compare_and_swap: Incomplete class _GlobalCacheCompareAndSwapBatch(_GlobalCacheSetBatch): def make_call(self): ... diff --git a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/_datastore_query.pyi b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/_datastore_query.pyi index 597b8810e96d..93454c9e1b7b 100644 --- a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/_datastore_query.pyi +++ b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/_datastore_query.pyi @@ -1,5 +1,4 @@ from _typeshed import Incomplete -from typing import Any class QueryIterator: def __iter__(self): ... @@ -14,7 +13,7 @@ class QueryIterator: class Cursor: @classmethod def from_websafe_string(cls, urlsafe): ... - cursor: Any + cursor: Incomplete def __init__(self, cursor: Incomplete | None = ..., urlsafe: Incomplete | None = ...) -> None: ... def to_websafe_string(self): ... def urlsafe(self): ... diff --git a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/_eventloop.pyi b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/_eventloop.pyi index 2c80cd3751c1..47091d2d3915 100644 --- a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/_eventloop.pyi +++ b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/_eventloop.pyi @@ -1,18 +1,19 @@ -from typing import Any, NamedTuple +from _typeshed import Incomplete +from typing import NamedTuple class _Event(NamedTuple): - when: Any - callback: Any - args: Any - kwargs: Any + when: Incomplete + callback: Incomplete + args: Incomplete + kwargs: Incomplete class EventLoop: - current: Any - idlers: Any + current: Incomplete + idlers: Incomplete inactive: int - queue: Any - rpcs: Any - rpc_results: Any + queue: Incomplete + rpcs: Incomplete + rpc_results: Incomplete def __init__(self) -> None: ... def clear(self) -> None: ... def insort_event_right(self, event) -> None: ... diff --git a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/blobstore.pyi b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/blobstore.pyi index acb002aadcec..8db54d2a1908 100644 --- a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/blobstore.pyi +++ b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/blobstore.pyi @@ -1,8 +1,8 @@ -from typing import Any +from _typeshed import Incomplete from google.cloud.ndb import model -BlobKey: Any +BlobKey: Incomplete BLOB_INFO_KIND: str BLOB_MIGRATION_KIND: str BLOB_KEY_HEADER: str @@ -51,10 +51,10 @@ class Error: def fetch_data(*args, **kwargs) -> None: ... def fetch_data_async(*args, **kwargs) -> None: ... -get: Any -get_async: Any -get_multi: Any -get_multi_async: Any +get: Incomplete +get_async: Incomplete +get_multi: Incomplete +get_multi_async: Incomplete class InternalError: def __init__(self, *args, **kwargs) -> None: ... diff --git a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/context.pyi b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/context.pyi index ec1ca4029d8a..b5234d052a3b 100644 --- a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/context.pyi +++ b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/context.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete from collections.abc import Callable -from typing import Any, NamedTuple +from typing import NamedTuple from google.cloud.ndb import Key, exceptions as exceptions @@ -19,18 +19,18 @@ def get_context(raise_context_error: bool = ...): ... def get_toplevel_context(raise_context_error: bool = ...): ... class _ContextTuple(NamedTuple): - id: Any - client: Any - namespace: Any - eventloop: Any - batches: Any - commit_batches: Any - transaction: Any - cache: Any - global_cache: Any - on_commit_callbacks: Any - transaction_complete_callbacks: Any - legacy_data: Any + id: Incomplete + client: Incomplete + namespace: Incomplete + eventloop: Incomplete + batches: Incomplete + commit_batches: Incomplete + transaction: Incomplete + cache: Incomplete + global_cache: Incomplete + on_commit_callbacks: Incomplete + transaction_complete_callbacks: Incomplete + legacy_data: Incomplete class _Context(_ContextTuple): def __new__( @@ -67,19 +67,19 @@ class Context(_Context): def get_cache_policy(self): ... def get_datastore_policy(self) -> None: ... def get_global_cache_policy(self): ... - get_memcache_policy: Any + get_memcache_policy: Incomplete def get_global_cache_timeout_policy(self): ... - get_memcache_timeout_policy: Any - cache_policy: Any + get_memcache_timeout_policy: Incomplete + cache_policy: Incomplete def set_cache_policy(self, policy): ... - datastore_policy: Any + datastore_policy: Incomplete def set_datastore_policy(self, policy): ... - global_cache_policy: Any + global_cache_policy: Incomplete def set_global_cache_policy(self, policy): ... - set_memcache_policy: Any - global_cache_timeout_policy: Any + set_memcache_policy: Incomplete + global_cache_timeout_policy: Incomplete def set_global_cache_timeout_policy(self, policy): ... - set_memcache_timeout_policy: Any + set_memcache_timeout_policy: Incomplete def get_retry_state(self): ... def set_retry_state(self, state) -> None: ... def clear_retry_state(self) -> None: ... diff --git a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/exceptions.pyi b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/exceptions.pyi index ab5a3a0ae0b2..c575423699d3 100644 --- a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/exceptions.pyi +++ b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/exceptions.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete class Error(Exception): ... @@ -12,7 +12,7 @@ class Rollback(Error): ... class BadQueryError(Error): ... class BadFilterError(Error): - filter: Any + filter: Incomplete def __init__(self, filter) -> None: ... class NoLongerImplementedError(NotImplementedError): diff --git a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi index 3fca22af04c8..aa91d31411cd 100644 --- a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi +++ b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi @@ -1,13 +1,12 @@ import abc from _typeshed import Incomplete -from typing import Any from typing_extensions import Self -ConnectionError: Any +ConnectionError: Incomplete class GlobalCache(metaclass=abc.ABCMeta): - __metaclass__: Any - transient_errors: Any + __metaclass__: Incomplete + transient_errors: Incomplete strict_read: bool strict_write: bool @abc.abstractmethod @@ -26,7 +25,7 @@ class GlobalCache(metaclass=abc.ABCMeta): def clear(self): ... class _InProcessGlobalCache(GlobalCache): - cache: Any + cache: Incomplete def __init__(self) -> None: ... def get(self, keys): ... def set(self, items, expires: Incomplete | None = ...) -> None: ... @@ -37,12 +36,12 @@ class _InProcessGlobalCache(GlobalCache): def clear(self) -> None: ... class RedisCache(GlobalCache): - transient_errors: Any + transient_errors: Incomplete @classmethod def from_environment(cls, strict_read: bool = ..., strict_write: bool = ...) -> Self: ... - redis: Any - strict_read: Any - strict_write: Any + redis: Incomplete + strict_read: Incomplete + strict_write: Incomplete def __init__(self, redis, strict_read: bool = ..., strict_write: bool = ...) -> None: ... @property def pipes(self): ... @@ -56,16 +55,16 @@ class RedisCache(GlobalCache): class MemcacheCache(GlobalCache): class KeyNotSet(Exception): - key: Any + key: Incomplete def __init__(self, key) -> None: ... def __eq__(self, other): ... - transient_errors: Any + transient_errors: Incomplete @classmethod def from_environment(cls, max_pool_size: int = ..., strict_read: bool = ..., strict_write: bool = ...) -> Self: ... - client: Any - strict_read: Any - strict_write: Any + client: Incomplete + strict_read: Incomplete + strict_write: Incomplete def __init__(self, client, strict_read: bool = ..., strict_write: bool = ...) -> None: ... @property def caskeys(self): ... diff --git a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/key.pyi b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/key.pyi index 292e5dd9d05e..fde8894a3905 100644 --- a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/key.pyi +++ b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/key.pyi @@ -1,7 +1,6 @@ from _typeshed import Incomplete -from typing import Any -UNDEFINED: Any +UNDEFINED: Incomplete class Key: def __new__(cls, *path_args, **kwargs): ... @@ -17,7 +16,7 @@ class Key: def root(self): ... def namespace(self): ... def project(self): ... - app: Any + app: Incomplete def database(self) -> str | None: ... def id(self): ... def string_id(self): ... diff --git a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/metadata.pyi b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/metadata.pyi index 3f52576f44c2..4e22eee3598f 100644 --- a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/metadata.pyi +++ b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/metadata.pyi @@ -1,5 +1,4 @@ from _typeshed import Incomplete -from typing import Any from google.cloud.ndb import model @@ -32,7 +31,7 @@ class Property(_BaseMetadata): def property_name(self): ... @property def kind_name(self): ... - property_representation: Any + property_representation: Incomplete @classmethod def key_for_kind(cls, kind): ... @classmethod diff --git a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/polymodel.pyi b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/polymodel.pyi index 43cabd288871..29d9aa8b5f8a 100644 --- a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/polymodel.pyi +++ b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/polymodel.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from google.cloud.ndb import model @@ -6,4 +6,4 @@ class _ClassKeyProperty(model.StringProperty): def __init__(self, name=..., indexed: bool = ...) -> None: ... class PolyModel(model.Model): - class_: Any + class_: Incomplete diff --git a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/query.pyi b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/query.pyi index 07ff7c413608..939a79444b2c 100644 --- a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/query.pyi +++ b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/query.pyi @@ -1,18 +1,17 @@ from _typeshed import Incomplete -from typing import Any from google.cloud.ndb import _options class PropertyOrder: - name: Any - reverse: Any + name: Incomplete + reverse: Incomplete def __init__(self, name, reverse: bool = ...) -> None: ... def __neg__(self): ... class RepeatedStructuredPropertyPredicate: - name: Any - match_keys: Any - match_values: Any + name: Incomplete + match_keys: Incomplete + match_values: Incomplete def __init__(self, name, match_keys, entity_pb) -> None: ... def __call__(self, entity_pb): ... @@ -28,8 +27,8 @@ class Parameter(ParameterizedThing): def resolve(self, bindings, used): ... class ParameterizedFunction(ParameterizedThing): - func: Any - values: Any + func: Incomplete + values: Incomplete def __init__(self, func, values) -> None: ... def __eq__(self, other): ... def is_parameterized(self): ... @@ -65,9 +64,9 @@ class PostFilterNode(Node): def __eq__(self, other): ... class _BooleanClauses: - name: Any - combine_or: Any - or_parts: Any + name: Incomplete + combine_or: Incomplete + or_parts: Incomplete def __init__(self, name, combine_or) -> None: ... def add_node(self, node) -> None: ... @@ -89,24 +88,24 @@ AND = ConjunctionNode OR = DisjunctionNode class QueryOptions(_options.ReadOptions): - project: Any - namespace: Any + project: Incomplete + namespace: Incomplete database: str | None def __init__(self, config: Incomplete | None = ..., context: Incomplete | None = ..., **kwargs) -> None: ... class Query: - default_options: Any - kind: Any - ancestor: Any - filters: Any - order_by: Any - project: Any - namespace: Any - limit: Any - offset: Any - keys_only: Any - projection: Any - distinct_on: Any + default_options: Incomplete + kind: Incomplete + ancestor: Incomplete + filters: Incomplete + order_by: Incomplete + project: Incomplete + namespace: Incomplete + limit: Incomplete + offset: Incomplete + keys_only: Incomplete + projection: Incomplete + distinct_on: Incomplete database: str | None def __init__( self, @@ -136,7 +135,7 @@ class Query: def fetch_async(self, limit: Incomplete | None = ..., **kwargs): ... def run_to_queue(self, queue, conn, options: Incomplete | None = ..., dsquery: Incomplete | None = ...) -> None: ... def iter(self, **kwargs): ... - __iter__: Any + __iter__: Incomplete def map(self, callback, **kwargs): ... def map_async(self, callback, **kwargs) -> None: ... def get(self, **kwargs): ... @@ -146,4 +145,4 @@ class Query: def fetch_page(self, page_size, **kwargs): ... def fetch_page_async(self, page_size, **kwargs) -> None: ... -def gql(query_string: str, *args: Any, **kwds: Any) -> Query: ... +def gql(query_string: str, *args, **kwds) -> Query: ... diff --git a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/stats.pyi b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/stats.pyi index 1ffa02ff04de..7dfaaa5c7042 100644 --- a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/stats.pyi +++ b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/stats.pyi @@ -1,41 +1,41 @@ -from typing import Any +from _typeshed import Incomplete from google.cloud.ndb import model class BaseStatistic(model.Model): STORED_KIND_NAME: str - bytes: Any - count: Any - timestamp: Any + bytes: Incomplete + count: Incomplete + timestamp: Incomplete class BaseKindStatistic(BaseStatistic): STORED_KIND_NAME: str - kind_name: Any - entity_bytes: Any + kind_name: Incomplete + entity_bytes: Incomplete class GlobalStat(BaseStatistic): STORED_KIND_NAME: str - entity_bytes: Any - builtin_index_bytes: Any - builtin_index_count: Any - composite_index_bytes: Any - composite_index_count: Any + entity_bytes: Incomplete + builtin_index_bytes: Incomplete + builtin_index_count: Incomplete + composite_index_bytes: Incomplete + composite_index_count: Incomplete class NamespaceStat(BaseStatistic): STORED_KIND_NAME: str - subject_namespace: Any - entity_bytes: Any - builtin_index_bytes: Any - builtin_index_count: Any - composite_index_bytes: Any - composite_index_count: Any + subject_namespace: Incomplete + entity_bytes: Incomplete + builtin_index_bytes: Incomplete + builtin_index_count: Incomplete + composite_index_bytes: Incomplete + composite_index_count: Incomplete class KindStat(BaseKindStatistic): STORED_KIND_NAME: str - builtin_index_bytes: Any - builtin_index_count: Any - composite_index_bytes: Any - composite_index_count: Any + builtin_index_bytes: Incomplete + builtin_index_count: Incomplete + composite_index_bytes: Incomplete + composite_index_count: Incomplete class KindRootEntityStat(BaseKindStatistic): STORED_KIND_NAME: str @@ -45,34 +45,34 @@ class KindNonRootEntityStat(BaseKindStatistic): class PropertyTypeStat(BaseStatistic): STORED_KIND_NAME: str - property_type: Any - entity_bytes: Any - builtin_index_bytes: Any - builtin_index_count: Any + property_type: Incomplete + entity_bytes: Incomplete + builtin_index_bytes: Incomplete + builtin_index_count: Incomplete class KindPropertyTypeStat(BaseKindStatistic): STORED_KIND_NAME: str - property_type: Any - builtin_index_bytes: Any - builtin_index_count: Any + property_type: Incomplete + builtin_index_bytes: Incomplete + builtin_index_count: Incomplete class KindPropertyNameStat(BaseKindStatistic): STORED_KIND_NAME: str - property_name: Any - builtin_index_bytes: Any - builtin_index_count: Any + property_name: Incomplete + builtin_index_bytes: Incomplete + builtin_index_count: Incomplete class KindPropertyNamePropertyTypeStat(BaseKindStatistic): STORED_KIND_NAME: str - property_type: Any - property_name: Any - builtin_index_bytes: Any - builtin_index_count: Any + property_type: Incomplete + property_name: Incomplete + builtin_index_bytes: Incomplete + builtin_index_count: Incomplete class KindCompositeIndexStat(BaseStatistic): STORED_KIND_NAME: str - index_id: Any - kind_name: Any + index_id: Incomplete + kind_name: Incomplete class NamespaceGlobalStat(GlobalStat): STORED_KIND_NAME: str diff --git a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/tasklets.pyi b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/tasklets.pyi index 4d9f34d69784..8788f40f6c16 100644 --- a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/tasklets.pyi +++ b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/tasklets.pyi @@ -1,7 +1,7 @@ -from typing import Any +from _typeshed import Incomplete class Future: - info: Any + info: Incomplete def __init__(self, info: str = ...) -> None: ... def done(self): ... def running(self): ... @@ -10,9 +10,9 @@ class Future: def set_result(self, result) -> None: ... def set_exception(self, exception) -> None: ... def result(self): ... - get_result: Any + get_result: Incomplete def exception(self): ... - get_exception: Any + get_exception: Incomplete def get_traceback(self): ... def add_done_callback(self, callback) -> None: ... def cancel(self) -> None: ... @@ -23,9 +23,9 @@ class Future: def wait_all(futures): ... class _TaskletFuture(Future): - generator: Any - context: Any - waiting_on: Any + generator: Incomplete + context: Incomplete + waiting_on: Incomplete def __init__(self, generator, context, info: str = ...) -> None: ... def cancel(self) -> None: ... diff --git a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/utils.pyi b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/utils.pyi index 3ddb96071d22..ccc5ca208d88 100644 --- a/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/utils.pyi +++ b/python/helpers/typeshed/stubs/google-cloud-ndb/google/cloud/ndb/utils.pyi @@ -1,11 +1,11 @@ import threading -from typing import Any +from _typeshed import Incomplete -TRUTHY_STRINGS: Any +TRUTHY_STRINGS: Incomplete def asbool(value): ... -DEBUG: Any +DEBUG: Incomplete def code_info(*args, **kwargs) -> None: ... def decorator(*args, **kwargs) -> None: ... @@ -16,7 +16,7 @@ def get_stack(*args, **kwargs) -> None: ... def logging_debug(log, message, *args, **kwargs) -> None: ... class keyword_only: - defaults: Any + defaults: Incomplete def __init__(self, **kwargs) -> None: ... def __call__(self, wrapped): ... diff --git a/python/helpers/typeshed/stubs/gunicorn/gunicorn/arbiter.pyi b/python/helpers/typeshed/stubs/gunicorn/gunicorn/arbiter.pyi index 0f7ae45f5def..8d4f221aa857 100644 --- a/python/helpers/typeshed/stubs/gunicorn/gunicorn/arbiter.pyi +++ b/python/helpers/typeshed/stubs/gunicorn/gunicorn/arbiter.pyi @@ -1,10 +1,10 @@ -import socket from types import FrameType from typing import ClassVar from gunicorn.app.base import BaseApplication from gunicorn.config import Config from gunicorn.glogging import Logger as GLogger +from gunicorn.sock import BaseSocket from gunicorn.workers.base import Worker from ._types import _AddressType @@ -14,7 +14,7 @@ class Arbiter: WORKER_BOOT_ERROR: ClassVar[int] APP_LOAD_ERROR: ClassVar[int] START_CTX: ClassVar[dict[int | str, str | list[str]]] - LISTENERS: ClassVar[list[socket.socket]] + LISTENERS: ClassVar[list[BaseSocket]] WORKERS: ClassVar[dict[int, Worker]] PIPE: ClassVar[list[int]] SIG_QUEUE: ClassVar[list[int]] diff --git a/python/helpers/typeshed/stubs/gunicorn/gunicorn/sock.pyi b/python/helpers/typeshed/stubs/gunicorn/gunicorn/sock.pyi index 4ce1b77cf857..0c19078abe8a 100644 --- a/python/helpers/typeshed/stubs/gunicorn/gunicorn/sock.pyi +++ b/python/helpers/typeshed/stubs/gunicorn/gunicorn/sock.pyi @@ -9,6 +9,8 @@ from gunicorn.glogging import Logger as GLogger from .config import Config class BaseSocket: + sock: socket.socket + def __init__(self, address: str, conf: Config, log: GLogger, fd: SupportsIndex | None = None) -> None: ... def __getattr__(self, name: str) -> Any: ... def set_options(self, sock: socket.socket, bound: bool = False) -> socket.socket: ... diff --git a/python/helpers/typeshed/stubs/html5lib/@tests/stubtest_allowlist.txt b/python/helpers/typeshed/stubs/html5lib/@tests/stubtest_allowlist.txt new file mode 100644 index 000000000000..7d9f867632d2 --- /dev/null +++ b/python/helpers/typeshed/stubs/html5lib/@tests/stubtest_allowlist.txt @@ -0,0 +1,6 @@ +# Side effects from module initialization: +html5lib.serializer.k +html5lib.serializer.v +html5lib.treeadapters.sax.prefix +html5lib.treeadapters.sax.localName +html5lib.treeadapters.sax.namespace diff --git a/python/helpers/typeshed/stubs/html5lib/METADATA.toml b/python/helpers/typeshed/stubs/html5lib/METADATA.toml index 23a4684130a6..3f4ba61f3dc6 100644 --- a/python/helpers/typeshed/stubs/html5lib/METADATA.toml +++ b/python/helpers/typeshed/stubs/html5lib/METADATA.toml @@ -1,5 +1,6 @@ version = "1.1.*" upstream_repository = "https://github.com/html5lib/html5lib-python" +requires = ["types-webencodings"] [tool.stubtest] extras = ["all"] diff --git a/python/helpers/typeshed/stubs/html5lib/html5lib/_ihatexml.pyi b/python/helpers/typeshed/stubs/html5lib/html5lib/_ihatexml.pyi index 44115cfbab7a..4f0844635aa3 100644 --- a/python/helpers/typeshed/stubs/html5lib/html5lib/_ihatexml.pyi +++ b/python/helpers/typeshed/stubs/html5lib/html5lib/_ihatexml.pyi @@ -1,6 +1,4 @@ import re -from _typeshed import Incomplete -from collections.abc import Iterable baseChar: str ideographic: str @@ -13,13 +11,13 @@ nameFirst: str reChar: re.Pattern[str] reCharRange: re.Pattern[str] -def charStringToList(chars: str) -> list[str]: ... -def normaliseCharList(charList: Iterable[str]) -> list[str]: ... +def charStringToList(chars: str) -> list[list[int]]: ... +def normaliseCharList(charList: list[list[int]]) -> list[list[int]]: ... max_unicode: int -def missingRanges(charList: Iterable[str]) -> list[str]: ... -def listToRegexpStr(charList): ... +def missingRanges(charList: list[list[int]]) -> list[list[int]]: ... +def listToRegexpStr(charList: list[list[int]]) -> str: ... def hexToInt(hex_str: str | bytes | bytearray) -> int: ... def escapeRegexp(string: str) -> str: ... @@ -29,13 +27,13 @@ nonPubidCharRegexp: re.Pattern[str] class InfosetFilter: replacementRegexp: re.Pattern[str] - dropXmlnsLocalName: Incomplete - dropXmlnsAttrNs: Incomplete - preventDoubleDashComments: Incomplete - preventDashAtCommentEnd: Incomplete - replaceFormFeedCharacters: Incomplete - preventSingleQuotePubid: Incomplete - replaceCache: Incomplete + dropXmlnsLocalName: bool + dropXmlnsAttrNs: bool + preventDoubleDashComments: bool + preventDashAtCommentEnd: bool + replaceFormFeedCharacters: bool + preventSingleQuotePubid: bool + replaceCache: dict[str, str] def __init__( self, dropXmlnsLocalName: bool = False, @@ -45,13 +43,13 @@ class InfosetFilter: replaceFormFeedCharacters: bool = True, preventSingleQuotePubid: bool = False, ) -> None: ... - def coerceAttribute(self, name, namespace=None): ... - def coerceElement(self, name): ... - def coerceComment(self, data): ... - def coerceCharacters(self, data): ... - def coercePubid(self, data): ... - def toXmlName(self, name): ... - def getReplacementCharacter(self, char): ... - def fromXmlName(self, name): ... - def escapeChar(self, char): ... - def unescapeChar(self, charcode): ... + def coerceAttribute(self, name: str, namespace: str | None = None) -> str | None: ... + def coerceElement(self, name: str) -> str: ... + def coerceComment(self, data: str) -> str: ... + def coerceCharacters(self, data: str) -> str: ... + def coercePubid(self, data: str) -> str: ... + def toXmlName(self, name: str) -> str: ... + def getReplacementCharacter(self, char: str) -> str: ... + def fromXmlName(self, name: str) -> str: ... + def escapeChar(self, char: str) -> str: ... + def unescapeChar(self, charcode: str | bytes | bytearray) -> str: ... diff --git a/python/helpers/typeshed/stubs/html5lib/html5lib/_inputstream.pyi b/python/helpers/typeshed/stubs/html5lib/html5lib/_inputstream.pyi index 9f10e4dbf98e..53a94876db6f 100644 --- a/python/helpers/typeshed/stubs/html5lib/html5lib/_inputstream.pyi +++ b/python/helpers/typeshed/stubs/html5lib/html5lib/_inputstream.pyi @@ -1,37 +1,36 @@ -from _typeshed import Incomplete, SupportsRead -from codecs import CodecInfo -from typing import Protocol, overload, type_check_only -from typing_extensions import TypeAlias +import re +from _io import BytesIO, StringIO +from _typeshed import Incomplete, ReadableBuffer, SupportsRead +from collections.abc import Callable, Iterable +from typing import Any, AnyStr, Generic, Literal, TypeVar, overload +from typing_extensions import Self, TypeAlias -# Is actually webencodings.Encoding -@type_check_only -class _Encoding(Protocol): - name: str - codec_info: CodecInfo - def __init__(self, name: str, codec_info: CodecInfo) -> None: ... +from webencodings import Encoding _UnicodeInputStream: TypeAlias = str | SupportsRead[str] _BinaryInputStream: TypeAlias = bytes | SupportsRead[bytes] _InputStream: TypeAlias = _UnicodeInputStream | _BinaryInputStream # noqa: Y047 # used in other files +_SupportsReadT = TypeVar("_SupportsReadT", bound=SupportsRead[Any]) +_SupportsReadBytesT = TypeVar("_SupportsReadBytesT", bound=SupportsRead[bytes]) -spaceCharactersBytes: Incomplete -asciiLettersBytes: Incomplete -asciiUppercaseBytes: Incomplete -spacesAngleBrackets: Incomplete +spaceCharactersBytes: frozenset[bytes] +asciiLettersBytes: frozenset[bytes] +asciiUppercaseBytes: frozenset[bytes] +spacesAngleBrackets: frozenset[bytes] invalid_unicode_no_surrogate: str -invalid_unicode_re: Incomplete -non_bmp_invalid_codepoints: Incomplete -ascii_punctuation_re: Incomplete -charsUntilRegEx: Incomplete +invalid_unicode_re: re.Pattern[str] +non_bmp_invalid_codepoints: set[int] +ascii_punctuation_re: re.Pattern[str] +charsUntilRegEx: dict[tuple[Iterable[str | bytes | bytearray], bool], re.Pattern[str]] -class BufferedStream: - stream: Incomplete - buffer: Incomplete - position: Incomplete - def __init__(self, stream) -> None: ... - def tell(self): ... - def seek(self, pos) -> None: ... - def read(self, bytes): ... +class BufferedStream(Generic[AnyStr]): + stream: SupportsRead[AnyStr] + buffer: list[AnyStr] + position: list[int] + def __init__(self, stream: SupportsRead[AnyStr]) -> None: ... + def tell(self) -> int: ... + def seek(self, pos: int) -> None: ... + def read(self, bytes: int) -> AnyStr: ... @overload def HTMLInputStream(source: _UnicodeInputStream) -> HTMLUnicodeInputStream: ... @@ -48,9 +47,9 @@ def HTMLInputStream( ) -> HTMLBinaryInputStream: ... class HTMLUnicodeInputStream: - reportCharacterErrors: Incomplete - newLines: Incomplete - charEncoding: tuple[_Encoding, str] + reportCharacterErrors: Callable[[str], None] + newLines: list[int] + charEncoding: tuple[Encoding, str] dataStream: Incomplete def __init__(self, source: _UnicodeInputStream) -> None: ... chunk: str @@ -60,14 +59,17 @@ class HTMLUnicodeInputStream: prevNumLines: int prevNumCols: int def reset(self) -> None: ... - def openStream(self, source): ... + @overload + def openStream(self, source: _SupportsReadT) -> _SupportsReadT: ... + @overload + def openStream(self, source: str | None) -> StringIO: ... def position(self) -> tuple[int, int]: ... - def char(self): ... - def readChunk(self, chunkSize=None): ... - def characterErrorsUCS4(self, data) -> None: ... - def characterErrorsUCS2(self, data) -> None: ... - def charsUntil(self, characters, opposite: bool = False): ... - def unget(self, char) -> None: ... + def char(self) -> str | None: ... + def readChunk(self, chunkSize: int | None = None) -> bool: ... + def characterErrorsUCS4(self, data: str) -> None: ... + def characterErrorsUCS2(self, data: str) -> None: ... + def charsUntil(self, characters: Iterable[str | bytes | bytearray], opposite: bool = False) -> str: ... + def unget(self, char: str | None) -> None: ... class HTMLBinaryInputStream(HTMLUnicodeInputStream): rawStream: Incomplete @@ -77,8 +79,8 @@ class HTMLBinaryInputStream(HTMLUnicodeInputStream): transport_encoding: Incomplete same_origin_parent_encoding: Incomplete likely_encoding: Incomplete - default_encoding: Incomplete - charEncoding: tuple[_Encoding, str] + default_encoding: str + charEncoding: tuple[Encoding, str] def __init__( self, source: _BinaryInputStream, @@ -91,46 +93,52 @@ class HTMLBinaryInputStream(HTMLUnicodeInputStream): ) -> None: ... dataStream: Incomplete def reset(self) -> None: ... - def openStream(self, source): ... + @overload # type: ignore[override] + def openStream(self, source: _SupportsReadBytesT) -> _SupportsReadBytesT: ... + @overload # type: ignore[override] + def openStream(self, source: ReadableBuffer) -> BytesIO: ... def determineEncoding(self, chardet: bool = True): ... def changeEncoding(self, newEncoding: str | bytes | None) -> None: ... - def detectBOM(self): ... - def detectEncodingMeta(self): ... + def detectBOM(self) -> Encoding | None: ... + def detectEncodingMeta(self) -> Encoding | None: ... class EncodingBytes(bytes): - def __new__(self, value): ... - def __init__(self, value) -> None: ... - def __iter__(self): ... - def __next__(self): ... - def next(self): ... - def previous(self): ... - def setPosition(self, position) -> None: ... - def getPosition(self): ... - position: Incomplete - def getCurrentByte(self): ... + def __new__(self, value: bytes) -> Self: ... + def __init__(self, value: bytes) -> None: ... + def __iter__(self) -> Self: ... # type: ignore[override] + def __next__(self) -> bytes: ... + def next(self) -> bytes: ... + def previous(self) -> bytes: ... + def setPosition(self, position: int) -> None: ... + def getPosition(self) -> int | None: ... @property - def currentByte(self): ... - def skip(self, chars=...): ... - def skipUntil(self, chars): ... - def matchBytes(self, bytes): ... - def jumpTo(self, bytes): ... + def position(self) -> int | None: ... + @position.setter + def position(self, position: int) -> None: ... + def getCurrentByte(self) -> bytes: ... + @property + def currentByte(self) -> bytes: ... + def skip(self, chars: bytes | bytearray | Iterable[bytes] = ...) -> bytes | None: ... + def skipUntil(self, chars: bytes | bytearray | Iterable[bytes]) -> bytes | None: ... + def matchBytes(self, bytes: bytes | bytearray) -> bool: ... + def jumpTo(self, bytes: bytes | bytearray) -> Literal[True]: ... class EncodingParser: - data: Incomplete - encoding: Incomplete - def __init__(self, data) -> None: ... - def getEncoding(self): ... - def handleComment(self): ... - def handleMeta(self): ... - def handlePossibleStartTag(self): ... - def handlePossibleEndTag(self): ... - def handlePossibleTag(self, endTag): ... - def handleOther(self): ... - def getAttribute(self): ... + data: EncodingBytes + encoding: Encoding | None + def __init__(self, data: bytes) -> None: ... + def getEncoding(self) -> Encoding | None: ... + def handleComment(self) -> bool: ... + def handleMeta(self) -> bool: ... + def handlePossibleStartTag(self) -> bool: ... + def handlePossibleEndTag(self) -> bool: ... + def handlePossibleTag(self, endTag: bool | None) -> bool: ... + def handleOther(self) -> bool: ... + def getAttribute(self) -> tuple[bytes, bytes] | None: ... class ContentAttrParser: - data: Incomplete - def __init__(self, data) -> None: ... - def parse(self): ... + data: EncodingBytes + def __init__(self, data: EncodingBytes) -> None: ... + def parse(self) -> bytes | None: ... -def lookupEncoding(encoding: str | bytes | None) -> str | None: ... +def lookupEncoding(encoding: str | bytes | None) -> Encoding | None: ... diff --git a/python/helpers/typeshed/stubs/html5lib/html5lib/_tokenizer.pyi b/python/helpers/typeshed/stubs/html5lib/html5lib/_tokenizer.pyi index 22316b1112b5..53c2e1bec605 100644 --- a/python/helpers/typeshed/stubs/html5lib/html5lib/_tokenizer.pyi +++ b/python/helpers/typeshed/stubs/html5lib/html5lib/_tokenizer.pyi @@ -1,42 +1,78 @@ from _typeshed import Incomplete +from collections import deque +from collections.abc import Callable, Iterator +from typing import TypedDict, overload, type_check_only -from ._inputstream import _InputStream +from ._inputstream import HTMLBinaryInputStream, HTMLUnicodeInputStream, _BinaryInputStream, _UnicodeInputStream +from ._trie import Trie -entitiesTrie: Incomplete +@type_check_only +class _DataVars(TypedDict, total=False): + data: str | None + charAsInt: int + +@type_check_only +class _Token(TypedDict, total=False): + type: int + data: str | list[str] + datavars: _DataVars + name: str + selfClosing: bool + selfClosingAcknowledged: bool + publicId: str | None + systemId: str | None + correct: bool + +entitiesTrie: Trie attributeMap = dict class HTMLTokenizer: - stream: Incomplete + # TODO: Use Protocol to allow subclasses to set `stream` that do not inherit from HTMLUnicodeInputStream + stream: HTMLUnicodeInputStream | HTMLBinaryInputStream parser: Incomplete escapeFlag: bool - lastFourChars: Incomplete - state: Incomplete + lastFourChars: list[Incomplete] + state: Callable[[], bool] escape: bool - currentToken: Incomplete - def __init__(self, stream: _InputStream, parser=None, **kwargs) -> None: ... - tokenQueue: Incomplete - def __iter__(self): ... - def consumeNumberEntity(self, isHex): ... - def consumeEntity(self, allowedChar=None, fromAttribute: bool = False) -> None: ... - def processEntityInAttribute(self, allowedChar) -> None: ... + currentToken: _Token | None + @overload + def __init__(self, stream: _UnicodeInputStream, parser=None) -> None: ... + @overload + def __init__( + self, + stream: _BinaryInputStream, + parser=None, + *, + override_encoding: str | bytes | None = None, + transport_encoding: str | bytes | None = None, + same_origin_parent_encoding: str | bytes | None = None, + likely_encoding: str | bytes | None = None, + default_encoding: str = "windows-1252", + useChardet: bool = True, + ) -> None: ... + tokenQueue: deque[_Token] + def __iter__(self) -> Iterator[_Token]: ... + def consumeNumberEntity(self, isHex: bool | None) -> str: ... + def consumeEntity(self, allowedChar: str | None = None, fromAttribute: bool = False) -> None: ... + def processEntityInAttribute(self, allowedChar: str | None) -> None: ... def emitCurrentToken(self) -> None: ... - def dataState(self): ... - def entityDataState(self): ... - def rcdataState(self): ... - def characterReferenceInRcdata(self): ... - def rawtextState(self): ... - def scriptDataState(self): ... - def plaintextState(self): ... - def tagOpenState(self): ... - def closeTagOpenState(self): ... - def tagNameState(self): ... + def dataState(self) -> bool: ... + def entityDataState(self) -> bool: ... + def rcdataState(self) -> bool: ... + def characterReferenceInRcdata(self) -> bool: ... + def rawtextState(self) -> bool: ... + def scriptDataState(self) -> bool: ... + def plaintextState(self) -> bool: ... + def tagOpenState(self) -> bool: ... + def closeTagOpenState(self) -> bool: ... + def tagNameState(self) -> bool: ... temporaryBuffer: str - def rcdataLessThanSignState(self): ... - def rcdataEndTagOpenState(self): ... - def rcdataEndTagNameState(self): ... - def rawtextLessThanSignState(self): ... - def rawtextEndTagOpenState(self): ... - def rawtextEndTagNameState(self): ... + def rcdataLessThanSignState(self) -> bool: ... + def rcdataEndTagOpenState(self) -> bool: ... + def rcdataEndTagNameState(self) -> bool: ... + def rawtextLessThanSignState(self) -> bool: ... + def rawtextEndTagOpenState(self) -> bool: ... + def rawtextEndTagNameState(self) -> bool: ... def scriptDataLessThanSignState(self) -> bool: ... def scriptDataEndTagOpenState(self) -> bool: ... def scriptDataEndTagNameState(self) -> bool: ... @@ -54,17 +90,17 @@ class HTMLTokenizer: def scriptDataDoubleEscapedDashDashState(self) -> bool: ... def scriptDataDoubleEscapedLessThanSignState(self) -> bool: ... def scriptDataDoubleEscapeEndState(self) -> bool: ... - def beforeAttributeNameState(self): ... - def attributeNameState(self): ... - def afterAttributeNameState(self): ... - def beforeAttributeValueState(self): ... - def attributeValueDoubleQuotedState(self): ... - def attributeValueSingleQuotedState(self): ... - def attributeValueUnQuotedState(self): ... - def afterAttributeValueState(self): ... - def selfClosingStartTagState(self): ... - def bogusCommentState(self): ... - def markupDeclarationOpenState(self): ... + def beforeAttributeNameState(self) -> bool: ... + def attributeNameState(self) -> bool: ... + def afterAttributeNameState(self) -> bool: ... + def beforeAttributeValueState(self) -> bool: ... + def attributeValueDoubleQuotedState(self) -> bool: ... + def attributeValueSingleQuotedState(self) -> bool: ... + def attributeValueUnQuotedState(self) -> bool: ... + def afterAttributeValueState(self) -> bool: ... + def selfClosingStartTagState(self) -> bool: ... + def bogusCommentState(self) -> bool: ... + def markupDeclarationOpenState(self) -> bool: ... def commentStartState(self) -> bool: ... def commentStartDashState(self) -> bool: ... def commentState(self) -> bool: ... @@ -76,15 +112,15 @@ class HTMLTokenizer: def doctypeNameState(self) -> bool: ... def afterDoctypeNameState(self) -> bool: ... def afterDoctypePublicKeywordState(self) -> bool: ... - def beforeDoctypePublicIdentifierState(self): ... - def doctypePublicIdentifierDoubleQuotedState(self): ... - def doctypePublicIdentifierSingleQuotedState(self): ... - def afterDoctypePublicIdentifierState(self): ... - def betweenDoctypePublicAndSystemIdentifiersState(self): ... - def afterDoctypeSystemKeywordState(self): ... - def beforeDoctypeSystemIdentifierState(self): ... - def doctypeSystemIdentifierDoubleQuotedState(self): ... - def doctypeSystemIdentifierSingleQuotedState(self): ... - def afterDoctypeSystemIdentifierState(self): ... - def bogusDoctypeState(self): ... - def cdataSectionState(self): ... + def beforeDoctypePublicIdentifierState(self) -> bool: ... + def doctypePublicIdentifierDoubleQuotedState(self) -> bool: ... + def doctypePublicIdentifierSingleQuotedState(self) -> bool: ... + def afterDoctypePublicIdentifierState(self) -> bool: ... + def betweenDoctypePublicAndSystemIdentifiersState(self) -> bool: ... + def afterDoctypeSystemKeywordState(self) -> bool: ... + def beforeDoctypeSystemIdentifierState(self) -> bool: ... + def doctypeSystemIdentifierDoubleQuotedState(self) -> bool: ... + def doctypeSystemIdentifierSingleQuotedState(self) -> bool: ... + def afterDoctypeSystemIdentifierState(self) -> bool: ... + def bogusDoctypeState(self) -> bool: ... + def cdataSectionState(self) -> bool: ... diff --git a/python/helpers/typeshed/stubs/html5lib/html5lib/_utils.pyi b/python/helpers/typeshed/stubs/html5lib/html5lib/_utils.pyi index f41afba04144..70abe9494add 100644 --- a/python/helpers/typeshed/stubs/html5lib/html5lib/_utils.pyi +++ b/python/helpers/typeshed/stubs/html5lib/html5lib/_utils.pyi @@ -1,6 +1,7 @@ import xml.etree.ElementTree as default_etree -from _typeshed import Incomplete -from collections.abc import Mapping +from _typeshed import Incomplete, Unused +from collections.abc import Iterable, Mapping, Sequence +from typing import Final, TypeVar, overload __all__ = [ "default_etree", @@ -11,13 +12,19 @@ __all__ = [ "supports_lone_surrogates", ] -supports_lone_surrogates: bool +supports_lone_surrogates: Final[bool] -class MethodDispatcher(dict[Incomplete, Incomplete]): - default: Incomplete - def __init__(self, items=()) -> None: ... - def __getitem__(self, key): ... - def __get__(self, instance, owner=None): ... +_K = TypeVar("_K") +_V = TypeVar("_V") + +class MethodDispatcher(dict[_K, _V]): + default: _V | None + @overload # to solve `reportInvalidTypeVarUse` + def __init__(self) -> None: ... + @overload + def __init__(self, items: Iterable[tuple[_K | Iterable[_K], _V]]) -> None: ... + def __getitem__(self, key: _K) -> _V | None: ... # type: ignore[override] + def __get__(self, instance, owner: Unused = None) -> BoundMethodDispatcher: ... class BoundMethodDispatcher(Mapping[Incomplete, Incomplete]): instance: Incomplete @@ -27,8 +34,8 @@ class BoundMethodDispatcher(Mapping[Incomplete, Incomplete]): def get(self, key, default): ... # type: ignore[override] def __iter__(self): ... def __len__(self) -> int: ... - def __contains__(self, key): ... + def __contains__(self, key) -> bool: ... -def isSurrogatePair(data): ... -def surrogatePairToCodepoint(data): ... +def isSurrogatePair(data: Sequence[str | bytes | bytearray]) -> bool: ... +def surrogatePairToCodepoint(data: Sequence[str | bytes | bytearray]) -> int: ... def moduleFactoryFactory(factory): ... diff --git a/python/helpers/typeshed/stubs/html5lib/html5lib/constants.pyi b/python/helpers/typeshed/stubs/html5lib/html5lib/constants.pyi index a0e12fbff98e..a5c4c5289afd 100644 --- a/python/helpers/typeshed/stubs/html5lib/html5lib/constants.pyi +++ b/python/helpers/typeshed/stubs/html5lib/html5lib/constants.pyi @@ -1,6 +1,4 @@ -from _typeshed import Incomplete - -EOF: Incomplete +EOF: None E: dict[str, str] namespaces: dict[str, str] scopingElements: frozenset[tuple[str, str]] diff --git a/python/helpers/typeshed/stubs/html5lib/html5lib/filters/alphabeticalattributes.pyi b/python/helpers/typeshed/stubs/html5lib/html5lib/filters/alphabeticalattributes.pyi index 20b694d65edf..955bae07d8ba 100644 --- a/python/helpers/typeshed/stubs/html5lib/html5lib/filters/alphabeticalattributes.pyi +++ b/python/helpers/typeshed/stubs/html5lib/html5lib/filters/alphabeticalattributes.pyi @@ -1,4 +1,5 @@ +from _typeshed import Incomplete + from . import base -class Filter(base.Filter): - def __iter__(self): ... +class Filter(base.Filter[dict[str, Incomplete]]): ... diff --git a/python/helpers/typeshed/stubs/html5lib/html5lib/filters/base.pyi b/python/helpers/typeshed/stubs/html5lib/html5lib/filters/base.pyi index 82773fd9124f..ddbaf78f74ab 100644 --- a/python/helpers/typeshed/stubs/html5lib/html5lib/filters/base.pyi +++ b/python/helpers/typeshed/stubs/html5lib/html5lib/filters/base.pyi @@ -1,7 +1,10 @@ -from _typeshed import Incomplete +from collections.abc import Iterable, Iterator +from typing import Any, Generic, TypeVar -class Filter: - source: Incomplete - def __init__(self, source) -> None: ... - def __iter__(self): ... - def __getattr__(self, name: str): ... +_T = TypeVar("_T", default=Any) + +class Filter(Generic[_T]): + source: Iterable[_T] + def __init__(self, source: Iterable[_T]) -> None: ... + def __iter__(self) -> Iterator[_T]: ... + def __getattr__(self, name: str) -> Any: ... # Depends on `source` diff --git a/python/helpers/typeshed/stubs/html5lib/html5lib/filters/inject_meta_charset.pyi b/python/helpers/typeshed/stubs/html5lib/html5lib/filters/inject_meta_charset.pyi index 030cd63753df..d8bb75bfcf99 100644 --- a/python/helpers/typeshed/stubs/html5lib/html5lib/filters/inject_meta_charset.pyi +++ b/python/helpers/typeshed/stubs/html5lib/html5lib/filters/inject_meta_charset.pyi @@ -1,6 +1,8 @@ +from _typeshed import Incomplete +from collections.abc import Iterable + from . import base -class Filter(base.Filter): +class Filter(base.Filter[dict[str, Incomplete]]): encoding: str | None - def __init__(self, source, encoding: str | None) -> None: ... - def __iter__(self): ... + def __init__(self, source: Iterable[dict[str, Incomplete]], encoding: str | None) -> None: ... diff --git a/python/helpers/typeshed/stubs/html5lib/html5lib/filters/lint.pyi b/python/helpers/typeshed/stubs/html5lib/html5lib/filters/lint.pyi index 39629c8696d6..37da9926b41a 100644 --- a/python/helpers/typeshed/stubs/html5lib/html5lib/filters/lint.pyi +++ b/python/helpers/typeshed/stubs/html5lib/html5lib/filters/lint.pyi @@ -1,8 +1,10 @@ +from _typeshed import Incomplete +from collections.abc import Iterable + from . import base spaceCharacters: str -class Filter(base.Filter): +class Filter(base.Filter[dict[str, Incomplete]]): require_matching_tags: bool - def __init__(self, source, require_matching_tags: bool = True) -> None: ... - def __iter__(self): ... + def __init__(self, source: Iterable[dict[str, Incomplete]], require_matching_tags: bool = True) -> None: ... diff --git a/python/helpers/typeshed/stubs/html5lib/html5lib/filters/optionaltags.pyi b/python/helpers/typeshed/stubs/html5lib/html5lib/filters/optionaltags.pyi index 81045a0e068f..9050d864e756 100644 --- a/python/helpers/typeshed/stubs/html5lib/html5lib/filters/optionaltags.pyi +++ b/python/helpers/typeshed/stubs/html5lib/html5lib/filters/optionaltags.pyi @@ -3,8 +3,7 @@ from collections.abc import Generator from . import base -class Filter(base.Filter): +class Filter(base.Filter[dict[str, Incomplete]]): def slider(self) -> Generator[tuple[Incomplete, Incomplete, Incomplete]]: ... - def __iter__(self): ... def is_optional_start(self, tagname: str, previous, next) -> bool: ... def is_optional_end(self, tagname: str, next) -> bool: ... diff --git a/python/helpers/typeshed/stubs/html5lib/html5lib/filters/sanitizer.pyi b/python/helpers/typeshed/stubs/html5lib/html5lib/filters/sanitizer.pyi index 7761f2719a5a..3308d7fd60cd 100644 --- a/python/helpers/typeshed/stubs/html5lib/html5lib/filters/sanitizer.pyi +++ b/python/helpers/typeshed/stubs/html5lib/html5lib/filters/sanitizer.pyi @@ -1,4 +1,5 @@ import re +from _typeshed import Incomplete from collections.abc import Iterable from typing_extensions import deprecated @@ -19,7 +20,7 @@ allowed_content_types: frozenset[str] data_content_type: re.Pattern[str] @deprecated("html5lib's sanitizer is deprecated; see https://github.com/html5lib/html5lib-python/issues/443") -class Filter(base.Filter): +class Filter(base.Filter[dict[str, Incomplete]]): allowed_elements: Iterable[tuple[str | None, str]] allowed_attributes: Iterable[tuple[str | None, str]] allowed_css_properties: Iterable[str] @@ -32,7 +33,7 @@ class Filter(base.Filter): svg_allow_local_href: Iterable[tuple[str | None, str]] def __init__( self, - source, + source: Iterable[dict[str, Incomplete]], allowed_elements: Iterable[tuple[str | None, str]] = ..., allowed_attributes: Iterable[tuple[str | None, str]] = ..., allowed_css_properties: Iterable[str] = ..., @@ -44,8 +45,7 @@ class Filter(base.Filter): svg_attr_val_allows_ref: Iterable[tuple[str | None, str]] = ..., svg_allow_local_href: Iterable[tuple[str | None, str]] = ..., ) -> None: ... - def __iter__(self): ... - def sanitize_token(self, token): ... - def allowed_token(self, token): ... - def disallowed_token(self, token): ... + def sanitize_token(self, token: dict[str, Incomplete]) -> dict[str, Incomplete] | None: ... + def allowed_token(self, token: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def disallowed_token(self, token: dict[str, Incomplete]) -> dict[str, Incomplete]: ... def sanitize_css(self, style: str) -> str: ... diff --git a/python/helpers/typeshed/stubs/html5lib/html5lib/filters/whitespace.pyi b/python/helpers/typeshed/stubs/html5lib/html5lib/filters/whitespace.pyi index 39f818100c7a..89334b070913 100644 --- a/python/helpers/typeshed/stubs/html5lib/html5lib/filters/whitespace.pyi +++ b/python/helpers/typeshed/stubs/html5lib/html5lib/filters/whitespace.pyi @@ -1,12 +1,12 @@ import re +from _typeshed import Incomplete from . import base spaceCharacters: str SPACES_REGEX: re.Pattern[str] -class Filter(base.Filter): +class Filter(base.Filter[dict[str, Incomplete]]): spacePreserveElements: frozenset[str] - def __iter__(self): ... def collapse_spaces(text: str) -> str: ... diff --git a/python/helpers/typeshed/stubs/html5lib/html5lib/html5parser.pyi b/python/helpers/typeshed/stubs/html5lib/html5lib/html5parser.pyi index ad3adaca4eb6..114ce03ca233 100644 --- a/python/helpers/typeshed/stubs/html5lib/html5lib/html5parser.pyi +++ b/python/helpers/typeshed/stubs/html5lib/html5lib/html5parser.pyi @@ -54,9 +54,9 @@ class HTMLParser: def reparseTokenNormal(self, token: dict[str, Any]) -> None: ... def resetInsertionMode(self) -> None: ... originalPhase: Incomplete - def parseRCDataRawtext(self, token, contentType) -> None: ... + def parseRCDataRawtext(self, token, contentType: Literal["RAWTEXT", "RCDATA"]) -> None: ... -def getPhases(debug): ... +def getPhases(debug: bool | None) -> dict[str, type]: ... def adjust_attributes(token: dict[str, Any], replacements: dict[str, Any]) -> None: ... def impliedTagToken( name: str, type: str = "EndTag", attributes: dict[str, Any] | None = None, selfClosing: bool = False diff --git a/python/helpers/typeshed/stubs/html5lib/html5lib/serializer.pyi b/python/helpers/typeshed/stubs/html5lib/html5lib/serializer.pyi index e7232e2e1d11..e831607ff02d 100644 --- a/python/helpers/typeshed/stubs/html5lib/html5lib/serializer.pyi +++ b/python/helpers/typeshed/stubs/html5lib/html5lib/serializer.pyi @@ -1,20 +1,53 @@ from _typeshed import Incomplete from collections.abc import Generator -from typing import overload +from typing import Literal, overload -k: str -v: str | int - -def htmlentityreplace_errors(exc: Exception) -> tuple[str | bytes, int]: ... +def htmlentityreplace_errors(exc: UnicodeError) -> tuple[str | bytes, int]: ... @overload -def serialize(input, tree: str = "etree", encoding: None = None, **serializer_opts) -> str: ... +def serialize( + input, + tree: Literal["dom", "genshi", "lxml", "etree"] = "etree", + encoding: Literal[""] | None = None, + *, + quote_attr_values: Literal["legacy", "spec", "always"] = "legacy", + quote_char: str = '"', + use_best_quote_char: bool = ..., # default value depends on whether quote_char was passed + omit_optional_tags: bool = True, + minimize_boolean_attributes: bool = True, + use_trailing_solidus: bool = False, + space_before_trailing_solidus: bool = True, + escape_lt_in_attrs: bool = False, + escape_rcdata: bool = False, + resolve_entities: bool = True, + alphabetical_attributes: bool = False, + inject_meta_charset: bool = True, + strip_whitespace: bool = False, + sanitize: bool = False, +) -> str: ... @overload -def serialize(input, tree: str, encoding: str, **serializer_opts) -> bytes: ... -@overload -def serialize(input, *, encoding: str, **serializer_opts) -> bytes: ... +def serialize( + input, + tree: Literal["dom", "genshi", "lxml", "etree"] = "etree", + encoding: str = ..., + *, + quote_attr_values: Literal["legacy", "spec", "always"] = "legacy", + quote_char: str = '"', + use_best_quote_char: bool = ..., # default value depends on whether quote_char was passed + omit_optional_tags: bool = True, + minimize_boolean_attributes: bool = True, + use_trailing_solidus: bool = False, + space_before_trailing_solidus: bool = True, + escape_lt_in_attrs: bool = False, + escape_rcdata: bool = False, + resolve_entities: bool = True, + alphabetical_attributes: bool = False, + inject_meta_charset: bool = True, + strip_whitespace: bool = False, + sanitize: bool = False, +) -> bytes: ... class HTMLSerializer: - quote_attr_values: str + quote_attr_values: Literal["legacy", "spec", "always"] quote_char: str use_best_quote_char: bool omit_optional_tags: bool @@ -28,15 +61,38 @@ class HTMLSerializer: inject_meta_charset: bool strip_whitespace: bool sanitize: bool - options: Incomplete - errors: Incomplete + options: tuple[str, ...] + errors: list[Incomplete] strict: bool - def __init__(self, **kwargs) -> None: ... - def encode(self, string): ... - def encodeStrict(self, string): ... - encoding: Incomplete - def serialize(self, treewalker, encoding=None) -> Generator[Incomplete]: ... - def render(self, treewalker, encoding=None): ... - def serializeError(self, data: str = "XXX ERROR MESSAGE NEEDED") -> None: ... + def __init__( + self, + *, + quote_attr_values: Literal["legacy", "spec", "always"] = "legacy", + quote_char: str = '"', + use_best_quote_char: bool = ..., # default value depends on whether quote_char was passed + omit_optional_tags: bool = True, + minimize_boolean_attributes: bool = True, + use_trailing_solidus: bool = False, + space_before_trailing_solidus: bool = True, + escape_lt_in_attrs: bool = False, + escape_rcdata: bool = False, + resolve_entities: bool = True, + alphabetical_attributes: bool = False, + inject_meta_charset: bool = True, + strip_whitespace: bool = False, + sanitize: bool = False, + ) -> None: ... + def encode(self, string: str) -> str | bytes: ... # result depends on self.encoding + def encodeStrict(self, string: str) -> str | bytes: ... # result depends on self.encoding + encoding: str | None + @overload + def serialize(self, treewalker, encoding: Literal[""] | None = None) -> Generator[str]: ... + @overload + def serialize(self, treewalker, encoding: str = ...) -> Generator[bytes]: ... + @overload + def render(self, treewalker, encoding: Literal[""] | None = None) -> str: ... + @overload + def render(self, treewalker, encoding: str = ...) -> bytes: ... + def serializeError(self, data="XXX ERROR MESSAGE NEEDED") -> None: ... class SerializeError(Exception): ... diff --git a/python/helpers/typeshed/stubs/html5lib/html5lib/treeadapters/sax.pyi b/python/helpers/typeshed/stubs/html5lib/html5lib/treeadapters/sax.pyi index 3ac32ef19361..22c93013ce67 100644 --- a/python/helpers/typeshed/stubs/html5lib/html5lib/treeadapters/sax.pyi +++ b/python/helpers/typeshed/stubs/html5lib/html5lib/treeadapters/sax.pyi @@ -1,6 +1,3 @@ -prefix: str | None -localName: str -namespace: str prefix_mapping: dict[str, str] def to_sax(walker, handler) -> None: ... diff --git a/python/helpers/typeshed/stubs/hvac/METADATA.toml b/python/helpers/typeshed/stubs/hvac/METADATA.toml index f16271580dcf..413110cd4bfe 100644 --- a/python/helpers/typeshed/stubs/hvac/METADATA.toml +++ b/python/helpers/typeshed/stubs/hvac/METADATA.toml @@ -1,3 +1,3 @@ -version = "2.3.*" +version = "2.4.*" upstream_repository = "https://github.com/hvac/hvac" requires = ["types-requests"] diff --git a/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/__init__.pyi b/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/__init__.pyi index 90323a99fb53..7d3e80ff560b 100644 --- a/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/__init__.pyi +++ b/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/__init__.pyi @@ -1,5 +1,3 @@ -from _typeshed import Incomplete - from hvac.api.auth_methods.approle import AppRole as AppRole from hvac.api.auth_methods.aws import Aws as Aws from hvac.api.auth_methods.azure import Azure as Azure @@ -15,6 +13,7 @@ from hvac.api.auth_methods.okta import Okta as Okta from hvac.api.auth_methods.radius import Radius as Radius from hvac.api.auth_methods.token import Token as Token from hvac.api.auth_methods.userpass import Userpass as Userpass +from hvac.api.vault_api_base import VaultApiBase from hvac.api.vault_api_category import VaultApiCategory __all__ = ( @@ -37,5 +36,5 @@ __all__ = ( ) class AuthMethods(VaultApiCategory): - implemented_classes: Incomplete - unimplemented_classes: Incomplete + implemented_classes: list[type[VaultApiBase]] + unimplemented_classes: list[str] diff --git a/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/aws.pyi b/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/aws.pyi index 79dba1a592d6..7298a79a1cc9 100644 --- a/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/aws.pyi +++ b/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/aws.pyi @@ -1,8 +1,8 @@ -from _typeshed import Incomplete +import logging from hvac.api.vault_api_base import VaultApiBase -logger: Incomplete +logger: logging.Logger class Aws(VaultApiBase): def configure( diff --git a/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/azure.pyi b/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/azure.pyi index 5198b3c2e7a1..ffa918c02e17 100644 --- a/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/azure.pyi +++ b/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/azure.pyi @@ -1,9 +1,10 @@ -from _typeshed import Incomplete +import logging from hvac.api.vault_api_base import VaultApiBase DEFAULT_MOUNT_POINT: str -logger: Incomplete + +logger: logging.Logger class Azure(VaultApiBase): def configure(self, tenant_id, resource, environment=None, client_id=None, client_secret=None, mount_point="azure"): ... diff --git a/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/gcp.pyi b/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/gcp.pyi index 8a38915c3637..8ebb0e03faf4 100644 --- a/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/gcp.pyi +++ b/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/gcp.pyi @@ -1,9 +1,10 @@ -from _typeshed import Incomplete +import logging from hvac.api.vault_api_base import VaultApiBase DEFAULT_MOUNT_POINT: str -logger: Incomplete + +logger: logging.Logger class Gcp(VaultApiBase): def configure( diff --git a/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/kubernetes.pyi b/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/kubernetes.pyi index 490238b0200d..d351c9f5c7f1 100644 --- a/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/kubernetes.pyi +++ b/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/kubernetes.pyi @@ -26,6 +26,7 @@ class Kubernetes(VaultApiBase): token_type: str = "", mount_point="kubernetes", alias_name_source=None, + audience: str | None = None, ): ... def read_role(self, name, mount_point="kubernetes"): ... def list_roles(self, mount_point="kubernetes"): ... diff --git a/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/legacy_mfa.pyi b/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/legacy_mfa.pyi index 42598cb7fd93..68f56a952845 100644 --- a/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/legacy_mfa.pyi +++ b/python/helpers/typeshed/stubs/hvac/hvac/api/auth_methods/legacy_mfa.pyi @@ -1,9 +1,7 @@ -from _typeshed import Incomplete - from hvac.api.vault_api_base import VaultApiBase -SUPPORTED_MFA_TYPES: Incomplete -SUPPORTED_AUTH_METHODS: Incomplete +SUPPORTED_MFA_TYPES: list[str] +SUPPORTED_AUTH_METHODS: list[str] class LegacyMfa(VaultApiBase): def configure(self, mount_point, mfa_type: str = "duo", force: bool = False): ... diff --git a/python/helpers/typeshed/stubs/hvac/hvac/api/secrets_engines/__init__.pyi b/python/helpers/typeshed/stubs/hvac/hvac/api/secrets_engines/__init__.pyi index 3831a24d9e5a..b74e0da3363b 100644 --- a/python/helpers/typeshed/stubs/hvac/hvac/api/secrets_engines/__init__.pyi +++ b/python/helpers/typeshed/stubs/hvac/hvac/api/secrets_engines/__init__.pyi @@ -1,5 +1,3 @@ -from _typeshed import Incomplete - from hvac.api.secrets_engines.active_directory import ActiveDirectory as ActiveDirectory from hvac.api.secrets_engines.aws import Aws as Aws from hvac.api.secrets_engines.azure import Azure as Azure @@ -15,6 +13,7 @@ from hvac.api.secrets_engines.rabbitmq import RabbitMQ as RabbitMQ from hvac.api.secrets_engines.ssh import Ssh as Ssh from hvac.api.secrets_engines.transform import Transform as Transform from hvac.api.secrets_engines.transit import Transit as Transit +from hvac.api.vault_api_base import VaultApiBase from hvac.api.vault_api_category import VaultApiCategory __all__ = ( @@ -37,5 +36,5 @@ __all__ = ( ) class SecretsEngines(VaultApiCategory): - implemented_classes: Incomplete - unimplemented_classes: Incomplete + implemented_classes: list[type[VaultApiBase]] + unimplemented_classes: list[str] diff --git a/python/helpers/typeshed/stubs/hvac/hvac/api/secrets_engines/identity.pyi b/python/helpers/typeshed/stubs/hvac/hvac/api/secrets_engines/identity.pyi index acafad3d33c9..7adc58901956 100644 --- a/python/helpers/typeshed/stubs/hvac/hvac/api/secrets_engines/identity.pyi +++ b/python/helpers/typeshed/stubs/hvac/hvac/api/secrets_engines/identity.pyi @@ -1,8 +1,8 @@ -from _typeshed import Incomplete +import logging from hvac.api.vault_api_base import VaultApiBase -logger: Incomplete +logger: logging.Logger class Identity(VaultApiBase): def create_or_update_entity( diff --git a/python/helpers/typeshed/stubs/hvac/hvac/api/secrets_engines/kv.pyi b/python/helpers/typeshed/stubs/hvac/hvac/api/secrets_engines/kv.pyi index 1f4a3de383d0..00b60c9c3437 100644 --- a/python/helpers/typeshed/stubs/hvac/hvac/api/secrets_engines/kv.pyi +++ b/python/helpers/typeshed/stubs/hvac/hvac/api/secrets_engines/kv.pyi @@ -1,11 +1,11 @@ -from _typeshed import Incomplete +import logging from hvac.api.vault_api_base import VaultApiBase -logger: Incomplete +logger: logging.Logger class Kv(VaultApiBase): - allowed_kv_versions: Incomplete + allowed_kv_versions: list[str] def __init__(self, adapter, default_kv_version: str = "2") -> None: ... @property def v1(self): ... diff --git a/python/helpers/typeshed/stubs/hvac/hvac/api/system_backend/__init__.pyi b/python/helpers/typeshed/stubs/hvac/hvac/api/system_backend/__init__.pyi index 23533ef38942..c4066c28c71b 100644 --- a/python/helpers/typeshed/stubs/hvac/hvac/api/system_backend/__init__.pyi +++ b/python/helpers/typeshed/stubs/hvac/hvac/api/system_backend/__init__.pyi @@ -1,5 +1,3 @@ -from _typeshed import Incomplete - from hvac.api.system_backend.audit import Audit as Audit from hvac.api.system_backend.auth import Auth as Auth from hvac.api.system_backend.capabilities import Capabilities as Capabilities @@ -17,6 +15,7 @@ from hvac.api.system_backend.raft import Raft as Raft from hvac.api.system_backend.seal import Seal as Seal from hvac.api.system_backend.system_backend_mixin import SystemBackendMixin as SystemBackendMixin from hvac.api.system_backend.wrapping import Wrapping as Wrapping +from hvac.api.vault_api_base import VaultApiBase from hvac.api.vault_api_category import VaultApiCategory __all__ = ( @@ -59,5 +58,5 @@ class SystemBackend( Seal, Wrapping, ): - implemented_classes: Incomplete - unimplemented_classes: Incomplete + implemented_classes: list[type[VaultApiBase]] + unimplemented_classes: list[str] diff --git a/python/helpers/typeshed/stubs/hvac/hvac/api/system_backend/system_backend_mixin.pyi b/python/helpers/typeshed/stubs/hvac/hvac/api/system_backend/system_backend_mixin.pyi index 44090cd45ac8..5aab4a8129e5 100644 --- a/python/helpers/typeshed/stubs/hvac/hvac/api/system_backend/system_backend_mixin.pyi +++ b/python/helpers/typeshed/stubs/hvac/hvac/api/system_backend/system_backend_mixin.pyi @@ -1,8 +1,8 @@ -from _typeshed import Incomplete +import logging from abc import ABCMeta from hvac.api.vault_api_base import VaultApiBase -logger: Incomplete +logger: logging.Logger class SystemBackendMixin(VaultApiBase, metaclass=ABCMeta): ... diff --git a/python/helpers/typeshed/stubs/hvac/hvac/api/system_backend/wrapping.pyi b/python/helpers/typeshed/stubs/hvac/hvac/api/system_backend/wrapping.pyi index 37a386f4250f..090f79e47a26 100644 --- a/python/helpers/typeshed/stubs/hvac/hvac/api/system_backend/wrapping.pyi +++ b/python/helpers/typeshed/stubs/hvac/hvac/api/system_backend/wrapping.pyi @@ -1,7 +1,6 @@ -from _typeshed import Incomplete - from hvac.api.system_backend.system_backend_mixin import SystemBackendMixin +from requests.models import _JSON class Wrapping(SystemBackendMixin): def unwrap(self, token=None): ... - def wrap(self, payload: dict[Incomplete, Incomplete] | None = None, ttl: int = 60): ... + def wrap(self, payload: _JSON | None = None, ttl: int = 60): ... diff --git a/python/helpers/typeshed/stubs/hvac/hvac/api/vault_api_category.pyi b/python/helpers/typeshed/stubs/hvac/hvac/api/vault_api_category.pyi index 2162d9bb5f52..2807505a3a92 100644 --- a/python/helpers/typeshed/stubs/hvac/hvac/api/vault_api_category.pyi +++ b/python/helpers/typeshed/stubs/hvac/hvac/api/vault_api_category.pyi @@ -1,5 +1,4 @@ from abc import ABCMeta, abstractmethod -from collections.abc import Sequence from logging import Logger from typing import Any @@ -9,7 +8,7 @@ from hvac.api.vault_api_base import VaultApiBase logger: Logger class VaultApiCategory(VaultApiBase, metaclass=ABCMeta): - implemented_class_names: Sequence[str] + implemented_class_names: list[str] def __init__(self, adapter: Adapter[Any]) -> None: ... def __getattr__(self, item): ... @property @@ -20,6 +19,6 @@ class VaultApiCategory(VaultApiBase, metaclass=ABCMeta): @abstractmethod def implemented_classes(self): ... @property - def unimplemented_classes(self) -> None: ... + def unimplemented_classes(self) -> list[str]: ... @staticmethod def get_private_attr_name(class_name): ... diff --git a/python/helpers/typeshed/stubs/icalendar/METADATA.toml b/python/helpers/typeshed/stubs/icalendar/METADATA.toml index e789388aa886..9fbe58c111a2 100644 --- a/python/helpers/typeshed/stubs/icalendar/METADATA.toml +++ b/python/helpers/typeshed/stubs/icalendar/METADATA.toml @@ -1,4 +1,4 @@ -version = "6.3.1" +version = "6.3.2" upstream_repository = "https://github.com/collective/icalendar" requires = ["types-python-dateutil", "types-pytz"] diff --git a/python/helpers/typeshed/stubs/jwcrypto/@tests/stubtest_allowlist.txt b/python/helpers/typeshed/stubs/jwcrypto/@tests/stubtest_allowlist.txt index 10f855e9e871..b81e7c4baa58 100644 --- a/python/helpers/typeshed/stubs/jwcrypto/@tests/stubtest_allowlist.txt +++ b/python/helpers/typeshed/stubs/jwcrypto/@tests/stubtest_allowlist.txt @@ -4,3 +4,6 @@ jwcrypto.tests-cookbook # even if the deprecated decorator is applied, the attribute is not present jwcrypto.jwt.JWTMissingKeyID.__deprecated__ + +# https://github.com/python/mypy/issues/20160 +(jwcrypto.jwt.JWTMissingKeyID.__init_subclass__)? diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/__init__.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/__init__.pyi index d5eeedd55773..7cb7544c04fa 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/__init__.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/__init__.pyi @@ -1,4 +1,4 @@ -from typing import Any, Literal +from typing import Literal from .abstract.attrDef import AttrDef as AttrDef from .abstract.attribute import ( @@ -97,7 +97,7 @@ HASHED_SALTED_SHA384: Literal["SALTED_SHA384"] HASHED_SALTED_SHA512: Literal["SALTED_SHA512"] HASHED_SALTED_MD5: Literal["SALTED_MD5"] -NUMERIC_TYPES: tuple[type[Any], ...] -INTEGER_TYPES: tuple[type[Any], ...] -STRING_TYPES: tuple[type[Any], ...] -SEQUENCE_TYPES: tuple[type[Any], ...] +NUMERIC_TYPES: tuple[type, ...] +INTEGER_TYPES: tuple[type, ...] +STRING_TYPES: tuple[type, ...] +SEQUENCE_TYPES: tuple[type, ...] diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/__init__.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/__init__.pyi index 5c2b1bd77518..2e5fe21aca1c 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/__init__.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/__init__.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete STATUS_INIT: str STATUS_VIRTUAL: str @@ -11,5 +11,5 @@ STATUS_READY_FOR_DELETION: str STATUS_READY_FOR_MOVING: str STATUS_READY_FOR_RENAMING: str STATUS_DELETED: str -STATUSES: Any -INITIAL_STATUSES: Any +STATUSES: Incomplete +INITIAL_STATUSES: Incomplete diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/attrDef.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/attrDef.pyi index 60332975fc42..b59e04f5df98 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/attrDef.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/attrDef.pyi @@ -1,18 +1,18 @@ -from typing import Any +from _typeshed import Incomplete class AttrDef: - name: Any - key: Any - validate: Any - pre_query: Any - post_query: Any - default: Any - dereference_dn: Any - description: Any - mandatory: Any - single_value: Any - oid_info: Any - other_names: Any + name: Incomplete + key: Incomplete + validate: Incomplete + pre_query: Incomplete + post_query: Incomplete + default: Incomplete + dereference_dn: Incomplete + description: Incomplete + mandatory: Incomplete + single_value: Incomplete + oid_info: Incomplete + other_names: Incomplete def __init__( self, name, diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/attribute.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/attribute.pyi index d22ff5d2ed6d..8040ae647a15 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/attribute.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/attribute.pyi @@ -1,14 +1,14 @@ -from typing import Any +from _typeshed import Incomplete class Attribute: - key: Any - definition: Any - values: Any - raw_values: Any - response: Any - entry: Any - cursor: Any - other_names: Any + key: Incomplete + definition: Incomplete + values: Incomplete + raw_values: Incomplete + response: Incomplete + entry: Incomplete + cursor: Incomplete + other_names: Incomplete def __init__(self, attr_def, entry, cursor) -> None: ... def __len__(self) -> int: ... def __iter__(self): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/cursor.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/cursor.pyi index 73c1eb2db8c1..81ad20d99e8b 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/cursor.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/cursor.pyi @@ -1,19 +1,20 @@ -from typing import Any, NamedTuple +from _typeshed import Incomplete +from typing import NamedTuple class Operation(NamedTuple): - request: Any - result: Any - response: Any + request: Incomplete + result: Incomplete + response: Incomplete class Cursor: - connection: Any - get_operational_attributes: Any - definition: Any - attributes: Any - controls: Any - execution_time: Any - entries: Any - schema: Any + connection: Incomplete + get_operational_attributes: Incomplete + definition: Incomplete + attributes: Incomplete + controls: Incomplete + execution_time: Incomplete + entries: Incomplete + schema: Incomplete def __init__( self, connection, @@ -38,14 +39,14 @@ class Cursor: def failed(self): ... class Reader(Cursor): - entry_class: Any - attribute_class: Any - entry_initial_status: Any - sub_tree: Any - base: Any - dereference_aliases: Any - validated_query: Any - query_filter: Any + entry_class: Incomplete + attribute_class: Incomplete + entry_initial_status: Incomplete + sub_tree: Incomplete + base: Incomplete + dereference_aliases: Incomplete + validated_query: Incomplete + query_filter: Incomplete def __init__( self, connection, @@ -68,8 +69,8 @@ class Reader(Cursor): @components_in_and.setter def components_in_and(self, value) -> None: ... def clear(self) -> None: ... - execution_time: Any - entries: Any + execution_time: Incomplete + entries: Incomplete def reset(self) -> None: ... def search(self, attributes=None): ... def search_object(self, entry_dn=None, attributes=None): ... @@ -78,14 +79,14 @@ class Reader(Cursor): def search_paged(self, paged_size, paged_criticality: bool = True, generator: bool = True, attributes=None): ... class Writer(Cursor): - entry_class: Any - attribute_class: Any - entry_initial_status: Any + entry_class: Incomplete + attribute_class: Incomplete + entry_initial_status: Incomplete @staticmethod def from_cursor(cursor, connection=None, object_def=None, custom_validator=None): ... @staticmethod def from_response(connection, object_def, response=None): ... - dereference_aliases: Any + dereference_aliases: Incomplete def __init__( self, connection, @@ -95,7 +96,7 @@ class Writer(Cursor): controls=None, auxiliary_class=None, ) -> None: ... - execution_time: Any + execution_time: Incomplete def commit(self, refresh: bool = True): ... def discard(self) -> None: ... def new(self, dn): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/entry.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/entry.pyi index 2c16d59fb8ec..1b2df740d130 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/entry.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/abstract/entry.pyi @@ -1,16 +1,16 @@ -from typing import Any +from _typeshed import Incomplete class EntryState: - dn: Any - status: Any - attributes: Any - raw_attributes: Any - response: Any - cursor: Any - origin: Any - read_time: Any - changes: Any - definition: Any + dn: Incomplete + status: Incomplete + attributes: Incomplete + raw_attributes: Incomplete + response: Incomplete + cursor: Incomplete + origin: Incomplete + read_time: Incomplete + changes: Incomplete + definition: Incomplete def __init__(self, dn, cursor) -> None: ... def set_status(self, status) -> None: ... @property diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/core/exceptions.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/core/exceptions.pyi index 518ad6b18378..f0ce91bf5ba8 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/core/exceptions.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/core/exceptions.pyi @@ -1,17 +1,17 @@ import socket -from typing import Any +from _typeshed import Incomplete from typing_extensions import Self class LDAPException(Exception): ... class LDAPOperationResult(LDAPException): def __new__(cls, result=None, description=None, dn=None, message=None, response_type=None, response=None) -> Self: ... - result: Any - description: Any - dn: Any - message: Any - type: Any - response: Any + result: Incomplete + description: Incomplete + dn: Incomplete + message: Incomplete + type: Incomplete + response: Incomplete def __init__(self, result=None, description=None, dn=None, message=None, response_type=None, response=None) -> None: ... class LDAPOperationsErrorResult(LDAPOperationResult): ... @@ -63,7 +63,7 @@ class LDAPAssertionFailedResult(LDAPOperationResult): ... class LDAPAuthorizationDeniedResult(LDAPOperationResult): ... class LDAPESyncRefreshRequiredResult(LDAPOperationResult): ... -exception_table: Any +exception_table: Incomplete class LDAPExceptionError(LDAPException): ... class LDAPConfigurationError(LDAPExceptionError): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/core/pooling.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/core/pooling.pyi index c35ddcad8006..861a4d06af53 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/core/pooling.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/core/pooling.pyi @@ -1,19 +1,19 @@ -from typing import Any +from _typeshed import Incomplete -POOLING_STRATEGIES: Any +POOLING_STRATEGIES: Incomplete class ServerState: - server: Any - last_checked_time: Any - available: Any + server: Incomplete + last_checked_time: Incomplete + available: Incomplete def __init__(self, server, last_checked_time, available) -> None: ... class ServerPoolState: - server_states: Any - strategy: Any - server_pool: Any + server_states: Incomplete + strategy: Incomplete + server_pool: Incomplete last_used_server: int - initialize_time: Any + initialize_time: Incomplete def __init__(self, server_pool) -> None: ... def refresh(self) -> None: ... def get_current_server(self): ... @@ -23,12 +23,12 @@ class ServerPoolState: def __len__(self) -> int: ... class ServerPool: - servers: Any - pool_states: Any - active: Any - exhaust: Any - single: Any - strategy: Any + servers: Incomplete + pool_states: Incomplete + active: Incomplete + exhaust: Incomplete + single: Incomplete + strategy: Incomplete def __init__( self, servers=None, pool_strategy="ROUND_ROBIN", active: bool = True, exhaust: bool = False, single_state: bool = True ) -> None: ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/core/rdns.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/core/rdns.pyi index 32123eff5f52..41205368d2d7 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/core/rdns.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/core/rdns.pyi @@ -1,12 +1,12 @@ -from typing import Any +from _typeshed import Incomplete class ReverseDnsSetting: - OFF: Any - REQUIRE_RESOLVE_ALL_ADDRESSES: Any - REQUIRE_RESOLVE_IP_ADDRESSES_ONLY: Any - OPTIONAL_RESOLVE_ALL_ADDRESSES: Any - OPTIONAL_RESOLVE_IP_ADDRESSES_ONLY: Any - SUPPORTED_VALUES: Any + OFF: Incomplete + REQUIRE_RESOLVE_ALL_ADDRESSES: Incomplete + REQUIRE_RESOLVE_IP_ADDRESSES_ONLY: Incomplete + OPTIONAL_RESOLVE_ALL_ADDRESSES: Incomplete + OPTIONAL_RESOLVE_IP_ADDRESSES_ONLY: Incomplete + SUPPORTED_VALUES: Incomplete def get_hostname_by_addr(addr, success_required: bool = True): ... def is_ip_addr(addr): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/core/results.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/core/results.pyi index a2772bd148fe..67e1e0dcb549 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/core/results.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/core/results.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete RESULT_SUCCESS: int RESULT_OPERATIONS_ERROR: int @@ -52,5 +52,5 @@ RESULT_CANNOT_CANCEL: int RESULT_ASSERTION_FAILED: int RESULT_AUTHORIZATION_DENIED: int RESULT_E_SYNC_REFRESH_REQUIRED: int -RESULT_CODES: Any -DO_NOT_RAISE_EXCEPTIONS: Any +RESULT_CODES: Incomplete +DO_NOT_RAISE_EXCEPTIONS: Incomplete diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/core/server.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/core/server.pyi index d86112148ab3..d31ad382f694 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/core/server.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/core/server.pyi @@ -1,22 +1,23 @@ -from typing import Any, Literal +from _typeshed import Incomplete +from typing import Literal unix_socket_available: bool class Server: ipc: bool - host: Any - port: Any - allowed_referral_hosts: Any - ssl: Any - tls: Any - name: Any - get_info: Any - dit_lock: Any - custom_formatter: Any - custom_validator: Any - current_address: Any - connect_timeout: Any - mode: Any + host: Incomplete + port: Incomplete + allowed_referral_hosts: Incomplete + ssl: Incomplete + tls: Incomplete + name: Incomplete + get_info: Incomplete + dit_lock: Incomplete + custom_formatter: Incomplete + custom_validator: Incomplete + current_address: Incomplete + connect_timeout: Incomplete + mode: Incomplete def __init__( self, host: str, diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/core/timezone.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/core/timezone.pyi index c6c52b37c0ae..f56ab0d9f4d3 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/core/timezone.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/core/timezone.pyi @@ -1,9 +1,9 @@ +from _typeshed import Incomplete from datetime import tzinfo -from typing import Any class OffsetTzInfo(tzinfo): - offset: Any - name: Any + offset: Incomplete + name: Incomplete def __init__(self, offset, name) -> None: ... def utcoffset(self, dt): ... def tzname(self, dt): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/core/tls.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/core/tls.pyi index 87d423da05d5..3636fa700ed1 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/core/tls.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/core/tls.pyi @@ -1,20 +1,20 @@ -from typing import Any +from _typeshed import Incomplete use_ssl_context: bool class Tls: - ssl_options: Any - validate: Any - ca_certs_file: Any - ca_certs_path: Any - ca_certs_data: Any - private_key_password: Any - version: Any - private_key_file: Any - certificate_file: Any - valid_names: Any - ciphers: Any - sni: Any + ssl_options: Incomplete + validate: Incomplete + ca_certs_file: Incomplete + ca_certs_path: Incomplete + ca_certs_data: Incomplete + private_key_password: Incomplete + version: Incomplete + private_key_file: Incomplete + certificate_file: Incomplete + valid_names: Incomplete + ciphers: Incomplete + sni: Incomplete def __init__( self, local_private_key_file=None, diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/core/usage.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/core/usage.pyi index ff60063b95c0..19bcd126af4e 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/core/usage.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/core/usage.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete class ConnectionUsage: open_sockets: int @@ -26,11 +26,11 @@ class ConnectionUsage: restartable_successes: int servers_from_pool: int def reset(self) -> None: ... - initial_connection_start_time: Any - open_socket_start_time: Any - connection_stop_time: Any - last_transmitted_time: Any - last_received_time: Any + initial_connection_start_time: Incomplete + open_socket_start_time: Incomplete + connection_stop_time: Incomplete + last_transmitted_time: Incomplete + last_received_time: Incomplete def __init__(self) -> None: ... def __iadd__(self, other): ... def update_transmitted_message(self, message, length) -> None: ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/extend/__init__.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/extend/__init__.pyi index 90d3746d5ac5..db6afd88f452 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/extend/__init__.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/extend/__init__.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete class ExtendedOperationContainer: def __init__(self, connection) -> None: ... @@ -91,7 +91,7 @@ class MicrosoftExtendedOperations(ExtendedOperationContainer): ): ... class ExtendedOperationsRoot(ExtendedOperationContainer): - standard: Any - novell: Any - microsoft: Any + standard: Incomplete + novell: Incomplete + microsoft: Incomplete def __init__(self, connection) -> None: ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/extend/microsoft/dirSync.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/extend/microsoft/dirSync.pyi index 68acbfc5d21e..80f947e9589f 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/extend/microsoft/dirSync.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/extend/microsoft/dirSync.pyi @@ -1,17 +1,17 @@ -from typing import Any +from _typeshed import Incomplete class DirSync: - connection: Any - base: Any - filter: Any - attributes: Any - cookie: Any - object_security: Any - ancestors_first: Any - public_data_only: Any - incremental_values: Any - max_length: Any - hex_guid: Any + connection: Incomplete + base: Incomplete + filter: Incomplete + attributes: Incomplete + cookie: Incomplete + object_security: Incomplete + ancestors_first: Incomplete + public_data_only: Incomplete + incremental_values: Incomplete + max_length: Incomplete + hex_guid: Incomplete more_results: bool def __init__( self, diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/extend/microsoft/persistentSearch.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/extend/microsoft/persistentSearch.pyi index 2e8818c7e1cb..5c39dfc8b0b8 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/extend/microsoft/persistentSearch.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/extend/microsoft/persistentSearch.pyi @@ -1,12 +1,12 @@ -from typing import Any +from _typeshed import Incomplete class ADPersistentSearch: - connection: Any - message_id: Any - base: Any - scope: Any - attributes: Any - controls: Any + connection: Incomplete + message_id: Incomplete + base: Incomplete + scope: Incomplete + attributes: Incomplete + controls: Incomplete filter: str def __init__(self, connection, search_base, search_scope, attributes, streaming, callback) -> None: ... def start(self) -> None: ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/extend/standard/PersistentSearch.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/extend/standard/PersistentSearch.pyi index 4ed285367246..8b059d36c29e 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/extend/standard/PersistentSearch.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/extend/standard/PersistentSearch.pyi @@ -1,18 +1,18 @@ -from typing import Any +from _typeshed import Incomplete class PersistentSearch: - connection: Any - changes_only: Any - notifications: Any - message_id: Any - base: Any - filter: Any - scope: Any - dereference_aliases: Any - attributes: Any - size_limit: Any - time_limit: Any - controls: Any + connection: Incomplete + changes_only: Incomplete + notifications: Incomplete + message_id: Incomplete + base: Incomplete + filter: Incomplete + scope: Incomplete + dereference_aliases: Incomplete + attributes: Incomplete + size_limit: Incomplete + time_limit: Incomplete + controls: Incomplete def __init__( self, connection, diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/operation/modify.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/operation/modify.pyi index 53ff3564333c..f21725f4b7f1 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/operation/modify.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/operation/modify.pyi @@ -1,6 +1,6 @@ -from typing import Any +from _typeshed import Incomplete -change_table: Any +change_table: Incomplete def modify_operation(dn, changes, auto_encode, schema=None, validator=None, check_names: bool = False): ... def modify_request_to_dict(request): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/operation/search.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/operation/search.pyi index 24577fea092c..34f7b29c925a 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/operation/search.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/operation/search.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete ROOT: int AND: int @@ -17,10 +17,10 @@ SEARCH_MATCH_OR_CLOSE: int SEARCH_MATCH_OR_CONTROL: int class FilterNode: - tag: Any - parent: Any - assertion: Any - elements: Any + tag: Incomplete + parent: Incomplete + assertion: Incomplete + elements: Incomplete def __init__(self, tag=None, assertion=None) -> None: ... def __str__(self, pos: int = 0) -> str: ... def __repr__(self, pos: int = 0) -> str: ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/formatters/formatters.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/formatters/formatters.pyi index 69c4e1aea172..62eb577c68af 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/formatters/formatters.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/formatters/formatters.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete def format_unicode(raw_value): ... def format_integer(raw_value): ... @@ -8,7 +8,7 @@ def format_uuid_le(raw_value): ... def format_boolean(raw_value): ... def format_ad_timestamp(raw_value): ... -time_format: Any +time_format: Incomplete def format_time(raw_value): ... def format_ad_timedelta(raw_value): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/formatters/standard.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/formatters/standard.pyi index f85dd6485adf..7fa4eb927472 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/formatters/standard.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/formatters/standard.pyi @@ -1,6 +1,6 @@ -from typing import Any +from _typeshed import Incomplete -standard_formatter: Any +standard_formatter: Incomplete def find_attribute_helpers(attr_type, name, custom_formatter): ... def format_attribute_values(schema, name, values, custom_formatter): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/oid.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/oid.pyi index 77efddad270f..83886b0b5654 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/oid.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/oid.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete OID_CONTROL: str OID_EXTENSION: str @@ -26,4 +26,4 @@ def decode_oids(sequence): ... def decode_syntax(syntax): ... def oid_to_string(oid): ... -Oids: Any +Oids: Incomplete diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/rfc2849.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/rfc2849.pyi index 03de80172871..62420dde63d3 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/rfc2849.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/rfc2849.pyi @@ -1,6 +1,6 @@ -from typing import Any +from _typeshed import Incomplete -conf_ldif_line_length: Any +conf_ldif_line_length: Incomplete def safe_ldif_string(bytes_value): ... def add_controls(controls, all_base64): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/rfc4512.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/rfc4512.pyi index b3c3d10f426a..8334585e4075 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/rfc4512.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/protocol/rfc4512.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete def constant_to_class_kind(value): ... def constant_to_attribute_usage(value): ... @@ -9,7 +9,7 @@ def extension_to_tuple(extension_string): ... def list_to_string(list_object): ... class BaseServerInfo: - raw: Any + raw: Incomplete def __init__(self, raw_attributes) -> None: ... @classmethod def from_json(cls, json_definition, schema=None, custom_formatter=None): ... @@ -19,43 +19,43 @@ class BaseServerInfo: def to_json(self, indent: int = 4, sort: bool = True): ... class DsaInfo(BaseServerInfo): - alt_servers: Any - naming_contexts: Any - supported_controls: Any - supported_extensions: Any - supported_features: Any - supported_ldap_versions: Any - supported_sasl_mechanisms: Any - vendor_name: Any - vendor_version: Any - schema_entry: Any - other: Any + alt_servers: Incomplete + naming_contexts: Incomplete + supported_controls: Incomplete + supported_extensions: Incomplete + supported_features: Incomplete + supported_ldap_versions: Incomplete + supported_sasl_mechanisms: Incomplete + vendor_name: Incomplete + vendor_version: Incomplete + schema_entry: Incomplete + other: Incomplete def __init__(self, attributes, raw_attributes) -> None: ... class SchemaInfo(BaseServerInfo): - schema_entry: Any - create_time_stamp: Any - modify_time_stamp: Any - attribute_types: Any - object_classes: Any - matching_rules: Any - matching_rule_uses: Any - dit_content_rules: Any - dit_structure_rules: Any - name_forms: Any - ldap_syntaxes: Any - other: Any + schema_entry: Incomplete + create_time_stamp: Incomplete + modify_time_stamp: Incomplete + attribute_types: Incomplete + object_classes: Incomplete + matching_rules: Incomplete + matching_rule_uses: Incomplete + dit_content_rules: Incomplete + dit_structure_rules: Incomplete + name_forms: Incomplete + ldap_syntaxes: Incomplete + other: Incomplete def __init__(self, schema_entry, attributes, raw_attributes) -> None: ... def is_valid(self): ... class BaseObjectInfo: - oid: Any - name: Any - description: Any - obsolete: Any - extensions: Any - experimental: Any - raw_definition: Any + oid: Incomplete + name: Incomplete + description: Incomplete + obsolete: Incomplete + extensions: Incomplete + experimental: Incomplete + raw_definition: Incomplete def __init__( self, oid=None, name=None, description=None, obsolete: bool = False, extensions=None, experimental=None, definition=None ) -> None: ... @@ -65,7 +65,7 @@ class BaseObjectInfo: def from_definition(cls, definitions): ... class MatchingRuleInfo(BaseObjectInfo): - syntax: Any + syntax: Incomplete def __init__( self, oid=None, @@ -79,7 +79,7 @@ class MatchingRuleInfo(BaseObjectInfo): ) -> None: ... class MatchingRuleUseInfo(BaseObjectInfo): - apply_to: Any + apply_to: Incomplete def __init__( self, oid=None, @@ -93,10 +93,10 @@ class MatchingRuleUseInfo(BaseObjectInfo): ) -> None: ... class ObjectClassInfo(BaseObjectInfo): - superior: Any - kind: Any - must_contain: Any - may_contain: Any + superior: Incomplete + kind: Incomplete + must_contain: Incomplete + may_contain: Incomplete def __init__( self, oid=None, @@ -113,18 +113,18 @@ class ObjectClassInfo(BaseObjectInfo): ) -> None: ... class AttributeTypeInfo(BaseObjectInfo): - superior: Any - equality: Any - ordering: Any - substring: Any - syntax: Any - min_length: Any - single_value: Any - collective: Any - no_user_modification: Any - usage: Any - mandatory_in: Any - optional_in: Any + superior: Incomplete + equality: Incomplete + ordering: Incomplete + substring: Incomplete + syntax: Incomplete + min_length: Incomplete + single_value: Incomplete + collective: Incomplete + no_user_modification: Incomplete + usage: Incomplete + mandatory_in: Incomplete + optional_in: Incomplete def __init__( self, oid=None, @@ -150,10 +150,10 @@ class LdapSyntaxInfo(BaseObjectInfo): def __init__(self, oid=None, description=None, extensions=None, experimental=None, definition=None) -> None: ... class DitContentRuleInfo(BaseObjectInfo): - auxiliary_classes: Any - must_contain: Any - may_contain: Any - not_contains: Any + auxiliary_classes: Incomplete + must_contain: Incomplete + may_contain: Incomplete + not_contains: Incomplete def __init__( self, oid=None, @@ -170,8 +170,8 @@ class DitContentRuleInfo(BaseObjectInfo): ) -> None: ... class DitStructureRuleInfo(BaseObjectInfo): - superior: Any - name_form: Any + superior: Incomplete + name_form: Incomplete def __init__( self, oid=None, @@ -186,9 +186,9 @@ class DitStructureRuleInfo(BaseObjectInfo): ) -> None: ... class NameFormInfo(BaseObjectInfo): - object_class: Any - must_contain: Any - may_contain: Any + object_class: Incomplete + must_contain: Incomplete + may_contain: Incomplete def __init__( self, oid=None, diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/asyncStream.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/asyncStream.pyi index b0ed1b4fd07e..ece52ea4d10e 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/asyncStream.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/asyncStream.pyi @@ -1,17 +1,17 @@ -from typing import Any +from _typeshed import Incomplete from ..strategy.asynchronous import AsyncStrategy class AsyncStreamStrategy(AsyncStrategy): can_stream: bool - line_separator: Any + line_separator: Incomplete all_base64: bool - stream: Any - order: Any - persistent_search_message_id: Any + stream: Incomplete + order: Incomplete + persistent_search_message_id: Incomplete streaming: bool - callback: Any - events: Any + callback: Incomplete + events: Incomplete def __init__(self, ldap_connection) -> None: ... def accumulate_stream(self, message_id, change) -> None: ... def get_stream(self): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/asynchronous.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/asynchronous.pyi index 883c285af2af..5e8be4de852d 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/asynchronous.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/asynchronous.pyi @@ -1,12 +1,12 @@ +from _typeshed import Incomplete from threading import Thread -from typing import Any from ..strategy.base import BaseStrategy class AsyncStrategy(BaseStrategy): class ReceiverSocketThread(Thread): - connection: Any - socket_size: Any + connection: Incomplete + socket_size: Incomplete def __init__(self, ldap_connection) -> None: ... def run(self) -> None: ... @@ -14,9 +14,9 @@ class AsyncStrategy(BaseStrategy): no_real_dsa: bool pooled: bool can_stream: bool - receiver: Any - async_lock: Any - event_lock: Any + receiver: Incomplete + async_lock: Incomplete + event_lock: Incomplete def __init__(self, ldap_connection) -> None: ... def open(self, reset_usage: bool = True, read_server_info: bool = True) -> None: ... def close(self) -> None: ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/base.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/base.pyi index 41fb3a05c1a6..1adc87f03185 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/base.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/base.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete unix_socket_available: bool SESSION_TERMINATED_BY_SERVER: str @@ -6,12 +6,12 @@ TRANSACTION_ERROR: str RESPONSE_COMPLETE: str class BaseStrategy: - connection: Any - sync: Any - no_real_dsa: Any - pooled: Any - can_stream: Any - referral_cache: Any + connection: Incomplete + sync: Incomplete + no_real_dsa: Incomplete + pooled: Incomplete + can_stream: Incomplete + referral_cache: Incomplete thread_safe: bool def __init__(self, ldap_connection) -> None: ... def open(self, reset_usage: bool = True, read_server_info: bool = True) -> None: ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/ldifProducer.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/ldifProducer.pyi index 0c740e77cc2a..92524d3ad59c 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/ldifProducer.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/ldifProducer.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from .base import BaseStrategy @@ -7,10 +7,10 @@ class LdifProducerStrategy(BaseStrategy): no_real_dsa: bool pooled: bool can_stream: bool - line_separator: Any + line_separator: Incomplete all_base64: bool - stream: Any - order: Any + stream: Incomplete + order: Incomplete def __init__(self, ldap_connection) -> None: ... def receiving(self) -> None: ... def send(self, message_type, request, controls=None): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/mockAsync.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/mockAsync.pyi index 619b8befa28e..9ff38e9dd117 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/mockAsync.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/mockAsync.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from .asynchronous import AsyncStrategy from .mockBase import MockBaseStrategy @@ -6,6 +6,6 @@ from .mockBase import MockBaseStrategy class MockAsyncStrategy(MockBaseStrategy, AsyncStrategy): def __init__(self, ldap_connection) -> None: ... def post_send_search(self, payload): ... - bound: Any + bound: Incomplete def post_send_single_response(self, payload): ... def get_response(self, message_id, timeout=None, get_request: bool = False): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/mockBase.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/mockBase.pyi index 8f828dcfc12b..879cc5efecc8 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/mockBase.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/mockBase.pyi @@ -1,25 +1,25 @@ -from typing import Any +from _typeshed import Incomplete -SEARCH_CONTROLS: Any +SEARCH_CONTROLS: Incomplete SERVER_ENCODING: str def random_cookie(): ... class PagedSearchSet: - size: Any - response: Any - cookie: Any + size: Incomplete + response: Incomplete + cookie: Incomplete sent: int done: bool def __init__(self, response, size, criticality) -> None: ... def next(self, size=None): ... class MockBaseStrategy: - entries: Any + entries: Incomplete no_real_dsa: bool - bound: Any - custom_validators: Any - operational_attributes: Any + bound: Incomplete + custom_validators: Incomplete + operational_attributes: Incomplete def __init__(self) -> None: ... def add_entry(self, dn, attributes, validate: bool = True): ... def remove_entry(self, dn): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/mockSync.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/mockSync.pyi index dcfd12d8958b..7d8b07ec7c3a 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/mockSync.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/mockSync.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from .mockBase import MockBaseStrategy from .sync import SyncStrategy @@ -6,5 +6,5 @@ from .sync import SyncStrategy class MockSyncStrategy(MockBaseStrategy, SyncStrategy): def __init__(self, ldap_connection) -> None: ... def post_send_search(self, payload): ... - bound: Any + bound: Incomplete def post_send_single_response(self, payload): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/restartable.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/restartable.pyi index 4e5c6dc3779f..bec37ed375ac 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/restartable.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/restartable.pyi @@ -1,4 +1,4 @@ -from typing import Any +from _typeshed import Incomplete from .sync import SyncStrategy @@ -7,9 +7,9 @@ class RestartableStrategy(SyncStrategy): no_real_dsa: bool pooled: bool can_stream: bool - restartable_sleep_time: Any - restartable_tries: Any - exception_history: Any + restartable_sleep_time: Incomplete + restartable_tries: Incomplete + exception_history: Incomplete def __init__(self, ldap_connection) -> None: ... def open(self, reset_usage: bool = False, read_server_info: bool = True) -> None: ... def send(self, message_type, request, controls=None): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/reusable.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/reusable.pyi index 4624d7058fad..92b2f3ad7b8f 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/reusable.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/reusable.pyi @@ -1,5 +1,5 @@ +from _typeshed import Incomplete from threading import Thread -from typing import Any from .base import BaseStrategy @@ -10,27 +10,27 @@ BOGUS_EXTENDED: int BOGUS_ABANDON: int class ReusableStrategy(BaseStrategy): - pools: Any + pools: Incomplete def receiving(self) -> None: ... def get_stream(self) -> None: ... def set_stream(self, value) -> None: ... class ConnectionPool: def __new__(cls, connection): ... - name: Any - master_connection: Any - workers: Any - pool_size: Any - lifetime: Any - keepalive: Any - request_queue: Any + name: Incomplete + master_connection: Incomplete + workers: Incomplete + pool_size: Incomplete + lifetime: Incomplete + keepalive: Incomplete + request_queue: Incomplete open_pool: bool bind_pool: bool tls_pool: bool counter: int - terminated_usage: Any + terminated_usage: Incomplete terminated: bool - pool_lock: Any + pool_lock: Incomplete started: bool def __init__(self, connection) -> None: ... def get_info_from_server(self) -> None: ... @@ -41,22 +41,22 @@ class ReusableStrategy(BaseStrategy): class PooledConnectionThread(Thread): daemon: bool - worker: Any - master_connection: Any + worker: Incomplete + master_connection: Incomplete def __init__(self, worker, master_connection) -> None: ... def run(self) -> None: ... class PooledConnectionWorker: - master_connection: Any - request_queue: Any + master_connection: Incomplete + request_queue: Incomplete running: bool busy: bool get_info_from_server: bool - connection: Any - creation_time: Any + connection: Incomplete + creation_time: Incomplete task_counter: int - thread: Any - worker_lock: Any + thread: Incomplete + worker_lock: Incomplete def __init__(self, connection, request_queue) -> None: ... def new_connection(self) -> None: ... @@ -64,7 +64,7 @@ class ReusableStrategy(BaseStrategy): no_real_dsa: bool pooled: bool can_stream: bool - pool: Any + pool: Incomplete def __init__(self, ldap_connection) -> None: ... def open(self, reset_usage: bool = True, read_server_info: bool = True) -> None: ... def terminate(self) -> None: ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/sync.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/sync.pyi index fb77f59093b4..c270ecb6dfc5 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/sync.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/strategy/sync.pyi @@ -1,15 +1,15 @@ -from typing import Any +from _typeshed import Incomplete from ..strategy.base import BaseStrategy -LDAP_MESSAGE_TEMPLATE: Any +LDAP_MESSAGE_TEMPLATE: Incomplete class SyncStrategy(BaseStrategy): sync: bool no_real_dsa: bool pooled: bool can_stream: bool - socket_size: Any + socket_size: Incomplete def __init__(self, ldap_connection) -> None: ... def open(self, reset_usage: bool = True, read_server_info: bool = True) -> None: ... def receiving(self): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/utils/config.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/utils/config.pyi index 80971d5fc15c..e16df54889f5 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/utils/config.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/utils/config.pyi @@ -1,6 +1,6 @@ -from typing import Any +from _typeshed import Incomplete -PARAMETERS: Any +PARAMETERS: Incomplete def get_config_parameter(parameter): ... def set_config_parameter(parameter, value) -> None: ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/utils/hashed.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/utils/hashed.pyi index c4aa9f8a3d49..86c0f721e2d6 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/utils/hashed.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/utils/hashed.pyi @@ -1,6 +1,6 @@ -from typing import Any +from _typeshed import Incomplete -algorithms_table: Any -salted_table: Any +algorithms_table: Incomplete +salted_table: Incomplete def hashed(algorithm, value, salt=None, raw: bool = False, encoding: str = "utf-8"): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/utils/log.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/utils/log.pyi index e7a4681b06b4..9ab59fda4045 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/utils/log.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/utils/log.pyi @@ -1,5 +1,5 @@ +from _typeshed import Incomplete from logging import NullHandler as NullHandler -from typing import Any OFF: int ERROR: int @@ -7,7 +7,7 @@ BASIC: int PROTOCOL: int NETWORK: int EXTENDED: int -DETAIL_LEVELS: Any +DETAIL_LEVELS: Incomplete def get_detail_level_name(level_name): ... def log(detail, message, *args) -> None: ... @@ -22,4 +22,4 @@ def set_library_log_detail_level(detail) -> None: ... def get_library_log_detail_level(): ... def format_ldap_message(message, prefix): ... -logger: Any +logger: Incomplete diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/utils/ntlm.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/utils/ntlm.pyi index e03381cabbef..37045dcbb0d8 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/utils/ntlm.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/utils/ntlm.pyi @@ -1,6 +1,6 @@ -from typing import Any +from _typeshed import Incomplete -oem_encoding: Any +oem_encoding: Incomplete NTLM_SIGNATURE: bytes NTLM_MESSAGE_TYPE_NTLM_NEGOTIATE: int NTLM_MESSAGE_TYPE_NTLM_CHALLENGE: int @@ -27,7 +27,7 @@ FLAG_NEGOTIATE_SIGN: int FLAG_REQUEST_TARGET: int FLAG_NEGOTIATE_OEM: int FLAG_NEGOTIATE_UNICODE: int -FLAG_TYPES: Any +FLAG_TYPES: Incomplete AV_END_OF_LIST: int AV_NETBIOS_COMPUTER_NAME: int AV_NETBIOS_DOMAIN_NAME: int @@ -39,60 +39,60 @@ AV_TIMESTAMP: int AV_SINGLE_HOST_DATA: int AV_TARGET_NAME: int AV_CHANNEL_BINDINGS: int -AV_TYPES: Any +AV_TYPES: Incomplete AV_FLAG_CONSTRAINED: int AV_FLAG_INTEGRITY: int AV_FLAG_TARGET_SPN_UNTRUSTED: int -AV_FLAG_TYPES: Any +AV_FLAG_TYPES: Incomplete def pack_windows_version(debug: bool = False): ... def unpack_windows_version(version_message): ... class NtlmClient: client_config_flags: int - exported_session_key: Any - negotiated_flags: Any - user_name: Any - user_domain: Any - no_lm_response_ntlm_v1: Any + exported_session_key: Incomplete + negotiated_flags: Incomplete + user_name: Incomplete + user_domain: Incomplete + no_lm_response_ntlm_v1: Incomplete client_blocked: bool - client_block_exceptions: Any - client_require_128_bit_encryption: Any - max_life_time: Any - client_signing_key: Any - client_sealing_key: Any - sequence_number: Any - server_sealing_key: Any - server_signing_key: Any + client_block_exceptions: Incomplete + client_require_128_bit_encryption: Incomplete + max_life_time: Incomplete + client_signing_key: Incomplete + client_sealing_key: Incomplete + sequence_number: Incomplete + server_sealing_key: Incomplete + server_signing_key: Incomplete integrity: bool replay_detect: bool sequence_detect: bool confidentiality: bool datagram: bool identity: bool - client_supplied_target_name: Any - client_channel_binding_unhashed: Any - unverified_target_name: Any - server_challenge: Any - server_target_name: Any - server_target_info: Any - server_version: Any - server_av_netbios_computer_name: Any - server_av_netbios_domain_name: Any - server_av_dns_computer_name: Any - server_av_dns_domain_name: Any - server_av_dns_forest_name: Any - server_av_target_name: Any - server_av_flags: Any - server_av_timestamp: Any - server_av_single_host_data: Any - server_av_channel_bindings: Any - server_av_flag_constrained: Any - server_av_flag_integrity: Any - server_av_flag_target_spn_untrusted: Any - current_encoding: Any - client_challenge: Any - server_target_info_raw: Any + client_supplied_target_name: Incomplete + client_channel_binding_unhashed: Incomplete + unverified_target_name: Incomplete + server_challenge: Incomplete + server_target_name: Incomplete + server_target_info: Incomplete + server_version: Incomplete + server_av_netbios_computer_name: Incomplete + server_av_netbios_domain_name: Incomplete + server_av_dns_computer_name: Incomplete + server_av_dns_domain_name: Incomplete + server_av_dns_forest_name: Incomplete + server_av_target_name: Incomplete + server_av_flags: Incomplete + server_av_timestamp: Incomplete + server_av_single_host_data: Incomplete + server_av_channel_bindings: Incomplete + server_av_flag_constrained: Incomplete + server_av_flag_integrity: Incomplete + server_av_flag_target_spn_untrusted: Incomplete + current_encoding: Incomplete + client_challenge: Incomplete + server_target_info_raw: Incomplete def __init__(self, domain, user_name, password) -> None: ... def get_client_flag(self, flag): ... def get_negotiated_flag(self, flag): ... diff --git a/python/helpers/typeshed/stubs/ldap3/ldap3/utils/repr.pyi b/python/helpers/typeshed/stubs/ldap3/ldap3/utils/repr.pyi index f2c58e20ed4d..41c269d19898 100644 --- a/python/helpers/typeshed/stubs/ldap3/ldap3/utils/repr.pyi +++ b/python/helpers/typeshed/stubs/ldap3/ldap3/utils/repr.pyi @@ -1,5 +1,5 @@ -from typing import Any +from _typeshed import Incomplete -repr_encoding: Any +repr_encoding: Incomplete def to_stdout_encoding(value): ... diff --git a/python/helpers/typeshed/stubs/lupa/METADATA.toml b/python/helpers/typeshed/stubs/lupa/METADATA.toml index ce6fd0811de1..b82a8453e4c1 100644 --- a/python/helpers/typeshed/stubs/lupa/METADATA.toml +++ b/python/helpers/typeshed/stubs/lupa/METADATA.toml @@ -1,2 +1,2 @@ -version = "2.5.*" +version = "2.6.*" upstream_repository = "https://github.com/scoder/lupa" diff --git a/python/helpers/typeshed/stubs/netaddr/netaddr/ip/__init__.pyi b/python/helpers/typeshed/stubs/netaddr/netaddr/ip/__init__.pyi index b857e10436ad..9aa6a680bd43 100644 --- a/python/helpers/typeshed/stubs/netaddr/netaddr/ip/__init__.pyi +++ b/python/helpers/typeshed/stubs/netaddr/netaddr/ip/__init__.pyi @@ -1,6 +1,7 @@ from _typeshed import ConvertibleToInt, Unused from abc import abstractmethod from collections.abc import Iterable, Iterator +from types import ModuleType from typing import Literal, SupportsIndex, SupportsInt, overload from typing_extensions import Self, TypeAlias @@ -95,7 +96,9 @@ class IPListMixin: def __contains__(self, other: BaseIP | _IPAddressAddr) -> bool: ... def __bool__(self) -> Literal[True]: ... -def parse_ip_network(module, addr: tuple[int, int] | str, flags: int = 0, *, expand_partial: bool = False) -> tuple[int, int]: ... +def parse_ip_network( + module: ModuleType, addr: tuple[int, int] | str, flags: int = 0, *, expand_partial: bool = False +) -> tuple[int, int]: ... class IPNetwork(BaseIP, IPListMixin): __slots__ = ("_prefixlen",) diff --git a/python/helpers/typeshed/stubs/netaddr/netaddr/ip/iana.pyi b/python/helpers/typeshed/stubs/netaddr/netaddr/ip/iana.pyi index ac386eb78195..a689f90cb52c 100644 --- a/python/helpers/typeshed/stubs/netaddr/netaddr/ip/iana.pyi +++ b/python/helpers/typeshed/stubs/netaddr/netaddr/ip/iana.pyi @@ -1,9 +1,9 @@ -from _typeshed import Incomplete, SupportsWrite +from _typeshed import SupportsWrite from collections.abc import Callable, Mapping, MutableMapping from typing import Any from typing_extensions import TypeAlias -from xml.sax import handler -from xml.sax.xmlreader import AttributesImpl, XMLReader +from xml.sax import _Source, handler +from xml.sax.xmlreader import AttributesImpl, InputSource, XMLReader from netaddr.core import Publisher, Subscriber from netaddr.ip import IPAddress, IPNetwork, IPRange @@ -20,8 +20,8 @@ class SaxRecordParser(handler.ContentHandler): class XMLRecordParser(Publisher): xmlparser: XMLReader - fh: Incomplete - def __init__(self, fh, **kwargs: object) -> None: ... + fh: InputSource | _Source + def __init__(self, fh: InputSource | _Source, **kwargs: object) -> None: ... def process_record(self, rec: Mapping[str, object]) -> dict[str, str] | None: ... def consume_record(self, rec: object) -> None: ... def parse(self) -> None: ... @@ -41,11 +41,11 @@ class MulticastParser(XMLRecordParser): def normalise_addr(self, addr: str) -> str: ... class DictUpdater(Subscriber): - dct: MutableMapping[_IanaInfoKey, Incomplete] + dct: MutableMapping[_IanaInfoKey, dict[str, Any]] topic: str unique_key: str - def __init__(self, dct: MutableMapping[_IanaInfoKey, Incomplete], topic: str, unique_key: str) -> None: ... - def update(self, data) -> None: ... + def __init__(self, dct: MutableMapping[_IanaInfoKey, dict[str, Any]], topic: str, unique_key: str) -> None: ... + def update(self, data: dict[str, Any]) -> None: ... def load_info() -> None: ... def pprint_info(fh: SupportsWrite[str] | None = None) -> None: ... diff --git a/python/helpers/typeshed/stubs/networkx/networkx/algorithms/approximation/treewidth.pyi b/python/helpers/typeshed/stubs/networkx/networkx/algorithms/approximation/treewidth.pyi index 00f95e3eb0cf..6a9f9afe2d39 100644 --- a/python/helpers/typeshed/stubs/networkx/networkx/algorithms/approximation/treewidth.pyi +++ b/python/helpers/typeshed/stubs/networkx/networkx/algorithms/approximation/treewidth.pyi @@ -1,4 +1,6 @@ from _typeshed import Incomplete +from collections.abc import Callable, Mapping +from typing import Generic from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable @@ -6,16 +8,18 @@ from networkx.utils.backends import _dispatchable __all__ = ["treewidth_min_degree", "treewidth_min_fill_in"] @_dispatchable -def treewidth_min_degree(G: Graph[_Node]): ... +def treewidth_min_degree(G: Graph[_Node]) -> tuple[int, Graph[frozenset[_Node]]]: ... @_dispatchable -def treewidth_min_fill_in(G: Graph[_Node]): ... +def treewidth_min_fill_in(G: Graph[_Node]) -> tuple[int, Graph[frozenset[_Node]]]: ... -class MinDegreeHeuristic: +class MinDegreeHeuristic(Generic[_Node]): count: Incomplete - def __init__(self, graph) -> None: ... - def best_node(self, graph): ... + def __init__(self, graph: Graph[_Node]) -> None: ... + def best_node(self, graph: Mapping[_Node, set[_Node]]) -> _Node | None: ... -def min_fill_in_heuristic(graph_dict) -> Incomplete | None: ... +def min_fill_in_heuristic(graph_dict: Mapping[_Node, set[_Node]]) -> _Node | None: ... @_dispatchable -def treewidth_decomp(G: Graph[_Node], heuristic=...) -> tuple[int, Graph[_Node]]: ... +def treewidth_decomp( + G: Graph[_Node], heuristic: Callable[[dict[_Node, set[_Node]]], _Node | None] = ... +) -> tuple[int, Graph[frozenset[_Node]]]: ... diff --git a/python/helpers/typeshed/stubs/networkx/networkx/algorithms/planarity.pyi b/python/helpers/typeshed/stubs/networkx/networkx/algorithms/planarity.pyi index 45de3dec2bb2..0cfc0a36135f 100644 --- a/python/helpers/typeshed/stubs/networkx/networkx/algorithms/planarity.pyi +++ b/python/helpers/typeshed/stubs/networkx/networkx/algorithms/planarity.pyi @@ -1,8 +1,9 @@ -from _typeshed import Incomplete -from collections.abc import Generator, Mapping, MutableSet, Reversible +from _typeshed import Incomplete, Unused +from collections.abc import Generator, Iterable, Mapping, MutableSet, Reversible +from typing import NoReturn from networkx.classes.digraph import DiGraph -from networkx.classes.graph import Graph, _Node +from networkx.classes.graph import Graph, _EdgePlus, _Node from networkx.utils.backends import _dispatchable __all__ = ["check_planarity", "is_planar", "PlanarEmbedding"] @@ -87,6 +88,9 @@ class LRPlanarity: def sign(self, e): ... def sign_recursive(self, e): ... +# NOTE: Graph subclasses relationships are so complex +# we're only overriding methods that differ in signature from the base classes +# to use inheritance to our advantage and reduce complexity class PlanarEmbedding(DiGraph[_Node]): def get_data(self) -> dict[_Node, list[_Node]]: ... def set_data(self, data: Mapping[_Node, Reversible[_Node]]) -> None: ... @@ -101,4 +105,9 @@ class PlanarEmbedding(DiGraph[_Node]): def traverse_face( self, v: _Node, w: _Node, mark_half_edges: MutableSet[tuple[_Node, _Node]] | None = None ) -> list[_Node]: ... - def to_undirected(self, reciprocal: bool = False, as_view: bool = False) -> Graph[_Node]: ... # type: ignore[override] + # Overriden in __init__ to always raise + 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 + ) -> NoReturn: ... diff --git a/python/helpers/typeshed/stubs/networkx/networkx/classes/digraph.pyi b/python/helpers/typeshed/stubs/networkx/networkx/classes/digraph.pyi index 482c2c208c5f..281ee1415740 100644 --- a/python/helpers/typeshed/stubs/networkx/networkx/classes/digraph.pyi +++ b/python/helpers/typeshed/stubs/networkx/networkx/classes/digraph.pyi @@ -10,6 +10,7 @@ from networkx.classes.reportviews import ( InDegreeView, InEdgeView, InMultiDegreeView, + InMultiEdgeView, OutDegreeView, OutEdgeView, OutMultiDegreeView, @@ -17,6 +18,9 @@ from networkx.classes.reportviews import ( __all__ = ["DiGraph"] +# NOTE: Graph subclasses relationships are so complex +# we're only overriding methods that differ in signature from the base classes +# to use inheritance to our advantage and reduce complexity class DiGraph(Graph[_Node]): @cached_property def succ(self) -> AdjacencyView[_Node, _Node, dict[str, Any]]: ... @@ -30,17 +34,19 @@ class DiGraph(Graph[_Node]): def predecessors(self, n: _Node) -> Iterator[_Node]: ... @cached_property + def edges(self) -> OutEdgeView[_Node]: ... + @cached_property def out_edges(self) -> OutEdgeView[_Node]: ... @cached_property - def in_edges(self) -> InEdgeView[_Node]: ... + # Including subtypes' possible return types for LSP + def in_edges(self) -> InEdgeView[_Node] | InMultiEdgeView[_Node]: ... @cached_property + def degree(self) -> DiDegreeView[_Node]: ... + @cached_property + # Including subtypes' possible return types for LSP def in_degree(self) -> InDegreeView[_Node] | InMultiDegreeView[_Node]: ... @cached_property + # Including subtypes' possible return types for LSP def out_degree(self) -> OutDegreeView[_Node] | OutMultiDegreeView[_Node]: ... - def to_undirected(self, reciprocal: bool = False, as_view: bool = False) -> Graph[_Node]: ... # type: ignore[override] - # reciprocal : If True, only edges that appear in both directions ... will be kept in the undirected graph. + def to_undirected(self, reciprocal: bool = False, as_view: bool = False) -> Graph[_Node]: ... # type: ignore[override] # Has an additional `reciprocal` keyword argument def reverse(self, copy: bool = True) -> Self: ... - @cached_property - def edges(self) -> OutEdgeView[_Node]: ... # type: ignore[override] # An OutEdgeView of the DiGraph as G.edges or G.edges(). - @cached_property - def degree(self) -> int | DiDegreeView[_Node]: ... # type: ignore[override] # Returns DiDegreeView or int diff --git a/python/helpers/typeshed/stubs/networkx/networkx/classes/graph.pyi b/python/helpers/typeshed/stubs/networkx/networkx/classes/graph.pyi index ffdab103eaad..cd618c653ac6 100644 --- a/python/helpers/typeshed/stubs/networkx/networkx/classes/graph.pyi +++ b/python/helpers/typeshed/stubs/networkx/networkx/classes/graph.pyi @@ -6,7 +6,7 @@ from typing_extensions import Self, TypeAlias import numpy from networkx.classes.coreviews import AdjacencyView, AtlasView from networkx.classes.digraph import DiGraph -from networkx.classes.reportviews import DegreeView, EdgeView, NodeView +from networkx.classes.reportviews import DegreeView, DiDegreeView, EdgeView, NodeView, OutEdgeView _Node = TypeVar("_Node", bound=Hashable) _NodeWithData: TypeAlias = tuple[_Node, dict[str, Any]] @@ -49,10 +49,10 @@ class Graph(Collection[_Node]): def name(self) -> str: ... @name.setter def name(self, s: str) -> None: ... - def __getitem__(self, n: _Node) -> AtlasView[_Node, str, Any]: ... def __iter__(self) -> Iterator[_Node]: ... def __contains__(self, n: object) -> bool: ... def __len__(self) -> int: ... + def __getitem__(self, n: _Node) -> AtlasView[_Node, str, Any]: ... def add_node(self, node_for_adding: _Node, **attr: Any) -> None: ... # attr: Set or change node attributes using key=value def add_nodes_from(self, nodes_for_adding: Iterable[_NodePlus[_Node]], **attr: Any) -> None: ... # attr: key=value pairs def remove_node(self, n: _Node) -> None: ... @@ -62,7 +62,8 @@ class Graph(Collection[_Node]): def number_of_nodes(self) -> int: ... def order(self) -> int: ... def has_node(self, n: _Node) -> bool: ... - def add_edge(self, u_of_edge: _Node, v_of_edge: _Node, **attr: Any) -> None: ... + # Including subtypes' possible return types for LSP + def add_edge(self, u_of_edge: _Node, v_of_edge: _Node, **attr: Any) -> Hashable | None: ... # attr: Edge data (or labels or objects) can be assigned using keyword arguments 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 @@ -81,12 +82,14 @@ class Graph(Collection[_Node]): def has_edge(self, u: _Node, v: _Node) -> bool: ... def neighbors(self, n: _Node) -> Iterator[_Node]: ... @cached_property - def edges(self) -> EdgeView[_Node]: ... + # Including subtypes' possible return types for LSP + def edges(self) -> EdgeView[_Node] | OutEdgeView[_Node]: ... def get_edge_data(self, u: _Node, v: _Node, default: Any = None) -> dict[str, Any]: ... # default: any Python object def adjacency(self) -> Iterator[tuple[_Node, dict[_Node, dict[str, Any]]]]: ... @cached_property - def degree(self) -> int | DegreeView[_Node]: ... + # Including subtypes' possible return types for LSP + def degree(self) -> DegreeView[_Node] | DiDegreeView[_Node]: ... def clear(self) -> None: ... def clear_edges(self) -> None: ... def is_multigraph(self) -> bool: ... @@ -94,7 +97,7 @@ class Graph(Collection[_Node]): def copy(self, as_view: bool = False) -> Self: ... def to_directed(self, as_view: bool = False) -> DiGraph[_Node]: ... def to_undirected(self, as_view: bool = False) -> Graph[_Node]: ... - def subgraph(self, nodes: Iterable[_Node]) -> Graph[_Node]: ... + def subgraph(self, nodes: _NBunch[_Node]) -> Graph[_Node]: ... def edge_subgraph(self, edges: Iterable[_Edge[_Node]]) -> Graph[_Node]: ... @overload def size(self, weight: None = None) -> int: ... diff --git a/python/helpers/typeshed/stubs/networkx/networkx/classes/multidigraph.pyi b/python/helpers/typeshed/stubs/networkx/networkx/classes/multidigraph.pyi index 374b793d842b..190d5c645c54 100644 --- a/python/helpers/typeshed/stubs/networkx/networkx/classes/multidigraph.pyi +++ b/python/helpers/typeshed/stubs/networkx/networkx/classes/multidigraph.pyi @@ -3,11 +3,11 @@ from typing import Any from networkx.classes.coreviews import MultiAdjacencyView from networkx.classes.digraph import DiGraph -from networkx.classes.graph import _EdgeWithData, _Node +from networkx.classes.graph import _Node from networkx.classes.multigraph import MultiGraph from networkx.classes.reportviews import ( + DiMultiDegreeView, InMultiDegreeView, - InMultiEdgeDataView, InMultiEdgeView, OutMultiDegreeView, OutMultiEdgeView, @@ -15,23 +15,24 @@ from networkx.classes.reportviews import ( __all__ = ["MultiDiGraph"] +# NOTE: Graph subclasses relationships are so complex +# we're only overriding methods that differ in signature from the base classes +# to use inheritance to our advantage and reduce complexity class MultiDiGraph(MultiGraph[_Node], DiGraph[_Node]): @cached_property def succ(self) -> MultiAdjacencyView[_Node, _Node, dict[str, Any]]: ... @cached_property def pred(self) -> MultiAdjacencyView[_Node, _Node, dict[str, Any]]: ... @cached_property - def edges(self) -> OutMultiEdgeView[_Node]: ... # type: ignore[override] - # Returns: OutMultiEdgeView + def edges(self) -> OutMultiEdgeView[_Node]: ... @cached_property def out_edges(self) -> OutMultiEdgeView[_Node]: ... @cached_property - def in_edges(self) -> InMultiEdgeView[_Node] | InMultiEdgeDataView[_Node, _EdgeWithData[_Node]]: ... # type: ignore[override] - # Returns : InMultiEdgeView or InMultiEdgeDataView + def in_edges(self) -> InMultiEdgeView[_Node]: ... + @cached_property + def degree(self) -> DiMultiDegreeView[_Node]: ... @cached_property def in_degree(self) -> InMultiDegreeView[_Node]: ... @cached_property def out_degree(self) -> OutMultiDegreeView[_Node]: ... - def to_undirected(self, reciprocal: bool = False, as_view: bool = False) -> MultiGraph[_Node]: ... # type: ignore[override] - def reverse(self, copy: bool = True) -> MultiDiGraph[_Node]: ... - def copy(self, as_view: bool = False) -> MultiDiGraph[_Node]: ... + def to_undirected(self, reciprocal: bool = False, as_view: bool = False) -> MultiGraph[_Node]: ... # type: ignore[override] # Has an additional `reciprocal` keyword argument diff --git a/python/helpers/typeshed/stubs/networkx/networkx/classes/multigraph.pyi b/python/helpers/typeshed/stubs/networkx/networkx/classes/multigraph.pyi index d0bb1ef27c82..510d58071aad 100644 --- a/python/helpers/typeshed/stubs/networkx/networkx/classes/multigraph.pyi +++ b/python/helpers/typeshed/stubs/networkx/networkx/classes/multigraph.pyi @@ -6,7 +6,7 @@ from typing_extensions import TypeAlias, TypeVar from networkx.classes.coreviews import MultiAdjacencyView from networkx.classes.graph import Graph, _MapFactory, _Node from networkx.classes.multidigraph import MultiDiGraph -from networkx.classes.reportviews import MultiEdgeView +from networkx.classes.reportviews import DiMultiDegreeView, MultiDegreeView, MultiEdgeView, OutMultiEdgeView _MultiEdge: TypeAlias = tuple[_Node, _Node, int] # noqa: Y047 @@ -15,36 +15,43 @@ _KeyT = TypeVar("_KeyT", bound=Hashable) __all__ = ["MultiGraph"] +# NOTE: Graph subclasses relationships are so complex +# we're only overriding methods that differ in signature from the base classes +# to use inheritance to our advantage and reduce complexity class MultiGraph(Graph[_Node]): edge_key_dict_factory: ClassVar[_MapFactory] + def to_directed_class(self) -> type[MultiDiGraph[_Node]]: ... + def to_undirected_class(self) -> type[MultiGraph[_Node]]: ... def __init__(self, incoming_graph_data=None, multigraph_input: bool | None = None, **attr: Any) -> None: ... @cached_property def adj(self) -> MultiAdjacencyView[_Node, _Node, dict[str, Any]]: ... # data can be any type def new_edge_key(self, u: _Node, v: _Node) -> int: ... - @overload # type: ignore[override] # Has an additional `key` keyword argument + # key : hashable identifier, optional (default=lowest unused integer) + @overload # type: ignore[override] # More complex overload def add_edge(self, u_for_edge: _Node, v_for_edge: _Node, key: int | None = None, **attr: Any) -> int: ... @overload def add_edge(self, u_for_edge: _Node, v_for_edge: _Node, key: _KeyT, **attr: Any) -> _KeyT: ... - # key : hashable identifier, optional (default=lowest unused integer) def remove_edge(self, u: _Node, v: _Node, key: Hashable | None = None) -> None: ... def has_edge(self, u: _Node, v: _Node, key: Hashable | None = None) -> bool: ... + @cached_property + # Including subtypes' possible return types for LSP + def edges(self) -> MultiEdgeView[_Node] | OutMultiEdgeView[_Node]: ... + # key : hashable identifier, optional (default=None). + # default : any Python object (default=None). Value to return if the specific edge (u, v, key) is not found. + # Returns: The edge attribute dictionary. @overload # type: ignore[override] def get_edge_data( self, u: _Node, v: _Node, key: Hashable, default: _DefaultT | None = None ) -> dict[str, Any] | _DefaultT: ... - # key : hashable identifier, optional (default=None). - # default : any Python object (default=None). Value to return if the specific edge (u, v, key) is not found. - # Returns: The edge attribute dictionary. + # default : any Python object (default=None). Value to return if there are no edges between u and v and no key is specified. + # Returns: A dictionary mapping edge keys to attribute dictionaries for each of those edges if no specific key is provided. @overload def get_edge_data( self, u: _Node, v: _Node, key: None = None, default: _DefaultT | None = None ) -> dict[Hashable, dict[str, Any] | _DefaultT]: ... - # default : any Python object (default=None). Value to return if there are no edges between u and v and no key is specified. - # Returns: A dictionary mapping edge keys to attribute dictionaries for each of those edges if no specific key is provided. def copy(self, as_view: bool = False) -> MultiGraph[_Node]: ... + @cached_property + # Including subtypes' possible return types for LSP + def degree(self) -> MultiDegreeView[_Node] | DiMultiDegreeView[_Node]: ... def to_directed(self, as_view: bool = False) -> MultiDiGraph[_Node]: ... def to_undirected(self, as_view: bool = False) -> MultiGraph[_Node]: ... - def number_of_edges(self, u: _Node | None = None, v: _Node | None = None) -> int: ... - @cached_property - def edges(self) -> MultiEdgeView[_Node]: ... # type: ignore[override] - # Returns: MultiEdgeView diff --git a/python/helpers/typeshed/stubs/networkx/networkx/readwrite/json_graph/node_link.pyi b/python/helpers/typeshed/stubs/networkx/networkx/readwrite/json_graph/node_link.pyi index 19cd0e1ca5dc..f9c37db281b3 100644 --- a/python/helpers/typeshed/stubs/networkx/networkx/readwrite/json_graph/node_link.pyi +++ b/python/helpers/typeshed/stubs/networkx/networkx/readwrite/json_graph/node_link.pyi @@ -15,13 +15,13 @@ Use the `edges` keyword instead.""" def node_link_data( G: Graph[_Node], *, + link: str | None, source: str = "source", target: str = "target", name: str = "id", key: str = "key", edges: str | None = None, nodes: str = "nodes", - link: str | None = None, ): ... @overload def node_link_data( diff --git a/python/helpers/typeshed/stubs/parsimonious/@tests/stubtest_allowlist.txt b/python/helpers/typeshed/stubs/parsimonious/@tests/stubtest_allowlist.txt index f870d696046a..abd7877e0cbf 100644 --- a/python/helpers/typeshed/stubs/parsimonious/@tests/stubtest_allowlist.txt +++ b/python/helpers/typeshed/stubs/parsimonious/@tests/stubtest_allowlist.txt @@ -1,8 +1,5 @@ parsimonious.nodes.RuleDecoratorMeta.__new__ -# Magic: -parsimonious.adhoc_expression - # Tests are shipped with the source, we ignore it: parsimonious.tests parsimonious\.tests\..* diff --git a/python/helpers/typeshed/stubs/parsimonious/METADATA.toml b/python/helpers/typeshed/stubs/parsimonious/METADATA.toml index 698a927e833c..8d2d5ca5fe07 100644 --- a/python/helpers/typeshed/stubs/parsimonious/METADATA.toml +++ b/python/helpers/typeshed/stubs/parsimonious/METADATA.toml @@ -1,2 +1,2 @@ -version = "0.10.*" +version = "0.11.*" upstream_repository = "https://github.com/erikrose/parsimonious" diff --git a/python/helpers/typeshed/stubs/parsimonious/parsimonious/exceptions.pyi b/python/helpers/typeshed/stubs/parsimonious/parsimonious/exceptions.pyi index 10f2ca5c7e6f..6b3eb1ac386b 100644 --- a/python/helpers/typeshed/stubs/parsimonious/parsimonious/exceptions.pyi +++ b/python/helpers/typeshed/stubs/parsimonious/parsimonious/exceptions.pyi @@ -3,7 +3,9 @@ from parsimonious.grammar import LazyReference from parsimonious.nodes import Node from parsimonious.utils import StrAndRepr -class ParseError(StrAndRepr, Exception): +class ParsimoniousError(Exception): ... + +class ParseError(StrAndRepr, ParsimoniousError): text: str pos: int expr: Expression | None @@ -14,11 +16,11 @@ class ParseError(StrAndRepr, Exception): class LeftRecursionError(ParseError): ... class IncompleteParseError(ParseError): ... -class VisitationError(Exception): +class VisitationError(ParsimoniousError): original_class: type[BaseException] def __init__(self, exc: BaseException, exc_class: type[BaseException], node: Node) -> None: ... -class BadGrammar(StrAndRepr, Exception): ... +class BadGrammar(StrAndRepr, ParsimoniousError): ... class UndefinedLabel(BadGrammar): label: LazyReference diff --git a/python/helpers/typeshed/stubs/peewee/METADATA.toml b/python/helpers/typeshed/stubs/peewee/METADATA.toml index 4f56e0596b2b..38405dda95f8 100644 --- a/python/helpers/typeshed/stubs/peewee/METADATA.toml +++ b/python/helpers/typeshed/stubs/peewee/METADATA.toml @@ -1,4 +1,4 @@ -version = "3.18.2" +version = "3.18.3" 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 diff --git a/python/helpers/typeshed/stubs/protobuf/google/protobuf/internal/well_known_types.pyi b/python/helpers/typeshed/stubs/protobuf/google/protobuf/internal/well_known_types.pyi index 69649998db4f..6527d3f6978e 100644 --- a/python/helpers/typeshed/stubs/protobuf/google/protobuf/internal/well_known_types.pyi +++ b/python/helpers/typeshed/stubs/protobuf/google/protobuf/internal/well_known_types.pyi @@ -67,7 +67,7 @@ _StructValue: TypeAlias = struct_pb2.Struct | struct_pb2.ListValue | str | float _StructValueArg: TypeAlias = _StructValue | Mapping[str, _StructValueArg] | Sequence[_StructValueArg] class Struct: - __slots__: tuple[()] = () + __slots__: tuple[str, ...] = () def __getitem__(self, key: str) -> _StructValue: ... def __setitem__(self, key: str, value: _StructValueArg) -> None: ... def __delitem__(self, key: str) -> None: ... @@ -81,7 +81,7 @@ class Struct: def update(self, dictionary: SupportsItems[str, _StructValueArg]) -> None: ... class ListValue: - __slots__: tuple[()] = () + __slots__: tuple[str, ...] = () def __len__(self) -> int: ... def append(self, value: _StructValue) -> None: ... def extend(self, elem_seq: Iterable[_StructValue]) -> None: ... diff --git a/python/helpers/typeshed/stubs/protobuf/google/protobuf/message.pyi b/python/helpers/typeshed/stubs/protobuf/google/protobuf/message.pyi index 5145b5330a2c..bd2aff9b7676 100644 --- a/python/helpers/typeshed/stubs/protobuf/google/protobuf/message.pyi +++ b/python/helpers/typeshed/stubs/protobuf/google/protobuf/message.pyi @@ -12,7 +12,7 @@ class DecodeError(Error): ... class EncodeError(Error): ... class Message: - __slots__: tuple[()] = () + __slots__: tuple[str, ...] = () DESCRIPTOR: Descriptor | _upb_Descriptor def __deepcopy__(self, memo: Any = None) -> Self: ... def __eq__(self, other_msg): ... diff --git a/python/helpers/typeshed/stubs/psutil/@tests/stubtest_allowlist_darwin.txt b/python/helpers/typeshed/stubs/psutil/@tests/stubtest_allowlist_darwin.txt index 4cf5ba5d3a88..d90126c03a35 100644 --- a/python/helpers/typeshed/stubs/psutil/@tests/stubtest_allowlist_darwin.txt +++ b/python/helpers/typeshed/stubs/psutil/@tests/stubtest_allowlist_darwin.txt @@ -2,3 +2,7 @@ psutil._pslinux psutil._psutil_linux psutil._psutil_windows psutil._pswindows + +# not always available on ARM64, but we test there +psutil.cpu_freq +psutil._psosx.cpu_freq diff --git a/python/helpers/typeshed/stubs/psutil/@tests/stubtest_allowlist_win32.txt b/python/helpers/typeshed/stubs/psutil/@tests/stubtest_allowlist_win32.txt index 4fa870ef882f..0f1f95fa109b 100644 --- a/python/helpers/typeshed/stubs/psutil/@tests/stubtest_allowlist_win32.txt +++ b/python/helpers/typeshed/stubs/psutil/@tests/stubtest_allowlist_win32.txt @@ -1,6 +1,5 @@ psutil._pslinux psutil._psosx - psutil._psutil_linux psutil._psutil_osx psutil._psutil_posix diff --git a/python/helpers/typeshed/stubs/psutil/METADATA.toml b/python/helpers/typeshed/stubs/psutil/METADATA.toml index 85e2bcc2e4e8..35f15a689034 100644 --- a/python/helpers/typeshed/stubs/psutil/METADATA.toml +++ b/python/helpers/typeshed/stubs/psutil/METADATA.toml @@ -1,4 +1,4 @@ -version = "7.0.*" +version = "7.1.1" upstream_repository = "https://github.com/giampaolo/psutil" [tool.stubtest] diff --git a/python/helpers/typeshed/stubs/psutil/psutil/__init__.pyi b/python/helpers/typeshed/stubs/psutil/psutil/__init__.pyi index 817a93127d29..3e23309aadda 100644 --- a/python/helpers/typeshed/stubs/psutil/psutil/__init__.pyi +++ b/python/helpers/typeshed/stubs/psutil/psutil/__init__.pyi @@ -2,6 +2,7 @@ import sys from _typeshed import Incomplete from collections.abc import Callable, Iterable, Iterator from contextlib import AbstractContextManager +from types import TracebackType from typing import Any, Literal, Protocol, overload, type_check_only from typing_extensions import Self, TypeAlias, deprecated @@ -172,11 +173,11 @@ class Process: @property def pid(self) -> int: ... # Only present if attrs argument is passed to process_iter - info: dict[str, Any] + info: dict[str, Incomplete] def oneshot(self) -> AbstractContextManager[None]: ... def as_dict( self, attrs: list[str] | tuple[str, ...] | set[str] | frozenset[str] | None = None, ad_value=None - ) -> dict[str, Any]: ... + ) -> dict[str, Incomplete]: ... def parent(self) -> Process | None: ... def parents(self) -> list[Process]: ... def is_running(self) -> bool: ... @@ -230,7 +231,9 @@ class Process: class Popen(Process): def __init__(self, *args, **kwargs) -> None: ... def __enter__(self) -> Self: ... - def __exit__(self, *args: object, **kwargs: object) -> None: ... + def __exit__( + self, exc_type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None + ) -> None: ... def __getattribute__(self, name: str) -> Any: ... def __dir__(self) -> list[str]: ... diff --git a/python/helpers/typeshed/stubs/psutil/psutil/_common.pyi b/python/helpers/typeshed/stubs/psutil/psutil/_common.pyi index 2c3813b79c1d..97e8c1e49844 100644 --- a/python/helpers/typeshed/stubs/psutil/psutil/_common.pyi +++ b/python/helpers/typeshed/stubs/psutil/psutil/_common.pyi @@ -1,66 +1,70 @@ import enum -from _typeshed import StrOrBytesPath, SupportsWrite +import io +import threading +from _typeshed import ConvertibleToFloat, FileDescriptorOrPath, Incomplete, StrOrBytesPath, SupportsWrite from collections.abc import Callable from socket import AF_INET6 as AF_INET6, AddressFamily, SocketKind -from typing import Any, Literal, NamedTuple, TypeVar, overload +from typing import BinaryIO, Final, NamedTuple, SupportsIndex, TypeVar, overload +from typing_extensions import ParamSpec -POSIX: bool -WINDOWS: bool -LINUX: bool -MACOS: bool -OSX: bool -FREEBSD: bool -OPENBSD: bool -NETBSD: bool -BSD: bool -SUNOS: bool -AIX: bool +POSIX: Final[bool] +WINDOWS: Final[bool] +LINUX: Final[bool] +MACOS: Final[bool] +OSX: Final[bool] +FREEBSD: Final[bool] +OPENBSD: Final[bool] +NETBSD: Final[bool] +BSD: Final[bool] +SUNOS: Final[bool] +AIX: Final[bool] -STATUS_RUNNING: Literal["running"] -STATUS_SLEEPING: Literal["sleeping"] -STATUS_DISK_SLEEP: Literal["disk-sleep"] -STATUS_STOPPED: Literal["stopped"] -STATUS_TRACING_STOP: Literal["tracing-stop"] -STATUS_ZOMBIE: Literal["zombie"] -STATUS_DEAD: Literal["dead"] -STATUS_WAKE_KILL: Literal["wake-kill"] -STATUS_WAKING: Literal["waking"] -STATUS_IDLE: Literal["idle"] -STATUS_LOCKED: Literal["locked"] -STATUS_WAITING: Literal["waiting"] -STATUS_SUSPENDED: Literal["suspended"] -STATUS_PARKED: Literal["parked"] +STATUS_RUNNING: Final = "running" +STATUS_SLEEPING: Final = "sleeping" +STATUS_DISK_SLEEP: Final = "disk-sleep" +STATUS_STOPPED: Final = "stopped" +STATUS_TRACING_STOP: Final = "tracing-stop" +STATUS_ZOMBIE: Final = "zombie" +STATUS_DEAD: Final = "dead" +STATUS_WAKE_KILL: Final = "wake-kill" +STATUS_WAKING: Final = "waking" +STATUS_IDLE: Final = "idle" +STATUS_LOCKED: Final = "locked" +STATUS_WAITING: Final = "waiting" +STATUS_SUSPENDED: Final = "suspended" +STATUS_PARKED: Final = "parked" -CONN_ESTABLISHED: str -CONN_SYN_SENT: str -CONN_SYN_RECV: str -CONN_FIN_WAIT1: str -CONN_FIN_WAIT2: str -CONN_TIME_WAIT: str -CONN_CLOSE: str -CONN_CLOSE_WAIT: str -CONN_LAST_ACK: str -CONN_LISTEN: str -CONN_CLOSING: str -CONN_NONE: str -NIC_DUPLEX_FULL: int -NIC_DUPLEX_HALF: int -NIC_DUPLEX_UNKNOWN: int +CONN_ESTABLISHED: Final = "ESTABLISHED" +CONN_SYN_SENT: Final = "SYN_SENT" +CONN_SYN_RECV: Final = "SYN_RECV" +CONN_FIN_WAIT1: Final = "FIN_WAIT1" +CONN_FIN_WAIT2: Final = "FIN_WAIT2" +CONN_TIME_WAIT: Final = "TIME_WAIT" +CONN_CLOSE: Final = "CLOSE" +CONN_CLOSE_WAIT: Final = "CLOSE_WAIT" +CONN_LAST_ACK: Final = "LAST_ACK" +CONN_LISTEN: Final = "LISTEN" +CONN_CLOSING: Final = "CLOSING" +CONN_NONE: Final = "NONE" class NicDuplex(enum.IntEnum): NIC_DUPLEX_FULL = 2 NIC_DUPLEX_HALF = 1 NIC_DUPLEX_UNKNOWN = 0 -POWER_TIME_UNKNOWN: int -POWER_TIME_UNLIMITED: int +NIC_DUPLEX_FULL: Final = NicDuplex.NIC_DUPLEX_FULL +NIC_DUPLEX_HALF: Final = NicDuplex.NIC_DUPLEX_HALF +NIC_DUPLEX_UNKNOWN: Final = NicDuplex.NIC_DUPLEX_UNKNOWN class BatteryTime(enum.IntEnum): POWER_TIME_UNKNOWN = -1 POWER_TIME_UNLIMITED = -2 -ENCODING: str -ENCODING_ERRS: str +POWER_TIME_UNKNOWN: Final = BatteryTime.POWER_TIME_UNKNOWN +POWER_TIME_UNLIMITED: Final = BatteryTime.POWER_TIME_UNLIMITED + +ENCODING: Final[str] +ENCODING_ERRS: Final[str] class sswap(NamedTuple): total: int @@ -210,77 +214,76 @@ class addr(NamedTuple): conn_tmap: dict[str, tuple[list[AddressFamily], list[SocketKind]]] class Error(Exception): - __module__: str - msg: Any + msg: str def __init__(self, msg: str = ...) -> None: ... class NoSuchProcess(Error): - __module__: str - pid: Any - name: Any - msg: Any - def __init__(self, pid, name=None, msg=None) -> None: ... + pid: int + name: str | None + msg: str + def __init__(self, pid: int, name: str | None = None, msg: str | None = None) -> None: ... class ZombieProcess(NoSuchProcess): - __module__: str - pid: Any - ppid: Any - name: Any - msg: Any - def __init__(self, pid, name=None, ppid=None, msg=None) -> None: ... + ppid: int | None + def __init__(self, pid: int, name: str | None = None, ppid: int | None = None, msg: str | None = None) -> None: ... class AccessDenied(Error): - __module__: str - pid: Any - name: Any - msg: Any - def __init__(self, pid=None, name=None, msg=None) -> None: ... + pid: int | None + name: str | None + msg: str + def __init__(self, pid: int | None = None, name: str | None = None, msg: str | None = None) -> None: ... class TimeoutExpired(Error): - __module__: str - seconds: Any - pid: Any - name: Any - def __init__(self, seconds, pid=None, name=None) -> None: ... + seconds: float + pid: int | None + name: str | None + msg: str + def __init__(self, seconds: float, pid: int | None = None, name: str | None = None) -> None: ... -_Func = TypeVar("_Func", bound=Callable[..., Any]) +_P = ParamSpec("_P") +_R = TypeVar("_R") -def usage_percent(used, total, round_: int | None = None) -> float: ... -def memoize(fun: _Func) -> _Func: ... -def memoize_when_activated(fun: _Func) -> _Func: ... +def usage_percent(used: ConvertibleToFloat, total: float, round_: SupportsIndex | None = None) -> float: ... + +# returned function has `cache_clear()` attribute: +def memoize(fun: Callable[_P, _R]) -> Callable[_P, _R]: ... + +# returned function has `cache_activate(proc)` and `cache_deactivate(proc)` attributes: +def memoize_when_activated(fun: Callable[_P, _R]) -> Callable[_P, _R]: ... def isfile_strict(path: StrOrBytesPath) -> bool: ... def path_exists_strict(path: StrOrBytesPath) -> bool: ... def supports_ipv6() -> bool: ... -def parse_environ_block(data): ... +def parse_environ_block(data: str) -> dict[str, str]: ... def sockfam_to_enum(num: int) -> AddressFamily: ... def socktype_to_enum(num: int) -> SocketKind: ... @overload def conn_to_ntuple(fd: int, fam: int, type_: int, laddr, raddr, status: str, status_map, pid: int) -> sconn: ... @overload def conn_to_ntuple(fd: int, fam: int, type_: int, laddr, raddr, status: str, status_map, pid: None = None) -> pconn: ... -def deprecated_method(replacement: str) -> Callable[[_Func], _Func]: ... +def deprecated_method(replacement: str) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]: ... class _WrapNumbers: - lock: Any - cache: Any - reminders: Any - reminder_keys: Any + lock: threading.Lock + cache: dict[Incomplete, Incomplete] + reminders: dict[Incomplete, Incomplete] + reminder_keys: dict[Incomplete, Incomplete] def __init__(self) -> None: ... def run(self, input_dict, name): ... def cache_clear(self, name=None) -> None: ... - def cache_info(self): ... + def cache_info(self) -> tuple[dict[Incomplete, Incomplete], dict[Incomplete, Incomplete], dict[Incomplete, Incomplete]]: ... def wrap_numbers(input_dict, name: str): ... -def open_binary(fname): ... -def open_text(fname): ... -def cat(fname, fallback=..., _open=...): ... -def bcat(fname, fallback=...): ... +def open_binary(fname: FileDescriptorOrPath) -> BinaryIO: ... +def open_text(fname: FileDescriptorOrPath) -> io.TextIOWrapper: ... +def cat(fname: FileDescriptorOrPath, fallback=..., _open=...): ... +def bcat(fname: FileDescriptorOrPath, fallback=...): ... def bytes2human(n: int, format: str = "%(value).1f%(symbol)s") -> str: ... def get_procfs_path() -> str: ... +def decode(s: bytes) -> str: ... def term_supports_colors(file: SupportsWrite[str] = ...) -> bool: ... def hilite(s: str, color: str | None = None, bold: bool = False) -> str: ... def print_color(s: str, color: str | None = None, bold: bool = False, file: SupportsWrite[str] = ...) -> None: ... -def debug(msg) -> None: ... +def debug(msg: str | Exception) -> None: ... __all__ = [ # OS constants diff --git a/python/helpers/typeshed/stubs/psutil/psutil/_psbsd.pyi b/python/helpers/typeshed/stubs/psutil/psutil/_psbsd.pyi index 4d17285a079b..74a40361527d 100644 --- a/python/helpers/typeshed/stubs/psutil/psutil/_psbsd.pyi +++ b/python/helpers/typeshed/stubs/psutil/psutil/_psbsd.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete from contextlib import AbstractContextManager -from typing import Any, NamedTuple +from typing import NamedTuple from psutil._common import ( FREEBSD as FREEBSD, @@ -16,16 +16,13 @@ from psutil._common import ( usage_percent as usage_percent, ) -__extra__all__: Any -PROC_STATUSES: Any -TCP_STATUSES: Any -PAGESIZE: Any -AF_LINK: Any -HAS_PER_CPU_TIMES: Any -HAS_PROC_NUM_THREADS: Any -HAS_PROC_OPEN_FILES: Any -HAS_PROC_NUM_FDS: Any -kinfo_proc_map: Any +__extra__all__: Incomplete +PROC_STATUSES: Incomplete +TCP_STATUSES: Incomplete +PAGESIZE: Incomplete +AF_LINK: Incomplete +HAS_PROC_NUM_THREADS: Incomplete +kinfo_proc_map: Incomplete class svmem(NamedTuple): total: int @@ -48,44 +45,44 @@ class scputimes(NamedTuple): irq: float class pmem(NamedTuple): - rss: Any - vms: Any - text: Any - data: Any - stack: Any + rss: Incomplete + vms: Incomplete + text: Incomplete + data: Incomplete + stack: Incomplete pfullmem = pmem class pcputimes(NamedTuple): - user: Any - system: Any - children_user: Any - children_system: Any + user: Incomplete + system: Incomplete + children_user: Incomplete + children_system: Incomplete class pmmap_grouped(NamedTuple): - path: Any - rss: Any - private: Any - ref_count: Any - shadow_count: Any + path: Incomplete + rss: Incomplete + private: Incomplete + ref_count: Incomplete + shadow_count: Incomplete class pmmap_ext(NamedTuple): - addr: Any - perms: Any - path: Any - rss: Any - private: Any - ref_count: Any - shadow_count: Any + addr: Incomplete + perms: Incomplete + path: Incomplete + rss: Incomplete + private: Incomplete + ref_count: Incomplete + shadow_count: Incomplete class sdiskio(NamedTuple): - read_count: Any - write_count: Any - read_bytes: Any - write_bytes: Any - read_time: Any - write_time: Any - busy_time: Any + read_count: Incomplete + write_count: Incomplete + read_bytes: Incomplete + write_bytes: Incomplete + read_time: Incomplete + write_time: Incomplete + busy_time: Incomplete def virtual_memory() -> svmem: ... def swap_memory(): ... @@ -96,10 +93,10 @@ def cpu_count_cores() -> int | None: ... def cpu_stats(): ... def disk_partitions(all: bool = ...): ... -disk_usage: Any -disk_io_counters: Any -net_io_counters: Any -net_if_addrs: Any +disk_usage: Incomplete +disk_io_counters: Incomplete +net_io_counters: Incomplete +net_if_addrs: Incomplete def net_if_stats(): ... def net_connections(kind): ... @@ -108,6 +105,10 @@ def sensors_temperatures(): ... def cpu_freq(): ... def boot_time(): ... def users(): ... + +INIT_BOOT_TIME: float + +def adjust_proc_create_time(ctime: float) -> float: ... def pids(): ... def pid_exists(pid): ... def is_zombie(pid): ... @@ -115,7 +116,7 @@ def wrap_exceptions(fun): ... def wrap_exceptions_procfs(inst) -> AbstractContextManager[None]: ... class Process: - pid: Any + pid: Incomplete def __init__(self, pid) -> None: ... def oneshot(self): ... def oneshot_enter(self) -> None: ... @@ -131,8 +132,8 @@ class Process: def cpu_times(self): ... def cpu_num(self): ... def memory_info(self): ... - memory_full_info: Any - def create_time(self): ... + memory_full_info: Incomplete + def create_time(self, monotonic: bool = False) -> float: ... def num_threads(self): ... def num_ctx_switches(self): ... def threads(self): ... @@ -145,20 +146,20 @@ class Process: def cwd(self): ... class nt_mmap_grouped(NamedTuple): - path: Any - rss: Any - private: Any - ref_count: Any - shadow_count: Any + path: Incomplete + rss: Incomplete + private: Incomplete + ref_count: Incomplete + shadow_count: Incomplete class nt_mmap_ext(NamedTuple): - addr: Any - perms: Any - path: Any - rss: Any - private: Any - ref_count: Any - shadow_count: Any + addr: Incomplete + perms: Incomplete + path: Incomplete + rss: Incomplete + private: Incomplete + ref_count: Incomplete + shadow_count: Incomplete def open_files(self): ... def num_fds(self): ... diff --git a/python/helpers/typeshed/stubs/psutil/psutil/_pslinux.pyi b/python/helpers/typeshed/stubs/psutil/psutil/_pslinux.pyi index 1a947fc2b828..295c6c61744b 100644 --- a/python/helpers/typeshed/stubs/psutil/psutil/_pslinux.pyi +++ b/python/helpers/typeshed/stubs/psutil/psutil/_pslinux.pyi @@ -1,6 +1,6 @@ import enum from _typeshed import Incomplete -from typing import Any, NamedTuple +from typing import NamedTuple from psutil._common import ( NIC_DUPLEX_FULL as NIC_DUPLEX_FULL, @@ -16,19 +16,19 @@ from psutil._common import ( usage_percent as usage_percent, ) -__extra__all__: Any +__extra__all__: Incomplete POWER_SUPPLY_PATH: str HAS_PROC_SMAPS: bool HAS_PROC_SMAPS_ROLLUP: bool -HAS_PROC_IO_PRIORITY: Any -HAS_CPU_AFFINITY: Any -CLOCK_TICKS: Any -PAGESIZE: Any -BOOT_TIME: Any -LITTLE_ENDIAN: Any +HAS_PROC_IO_PRIORITY: Incomplete +HAS_CPU_AFFINITY: Incomplete +CLOCK_TICKS: Incomplete +PAGESIZE: Incomplete +LITTLE_ENDIAN: Incomplete +UNSET: object DISK_SECTOR_SIZE: int -AF_LINK: Any -AddressFamily: Any +AF_LINK: Incomplete +AddressFamily: Incomplete IOPRIO_CLASS_NONE: int IOPRIO_CLASS_RT: int IOPRIO_CLASS_BE: int @@ -40,8 +40,8 @@ class IOPriority(enum.IntEnum): IOPRIO_CLASS_BE = 2 IOPRIO_CLASS_IDLE = 3 -PROC_STATUSES: Any -TCP_STATUSES: Any +PROC_STATUSES: Incomplete +TCP_STATUSES: Incomplete class svmem(NamedTuple): total: int @@ -57,31 +57,31 @@ class svmem(NamedTuple): slab: int class sdiskio(NamedTuple): - read_count: Any - write_count: Any - read_bytes: Any - write_bytes: Any - read_time: Any - write_time: Any - read_merged_count: Any - write_merged_count: Any - busy_time: Any + read_count: Incomplete + write_count: Incomplete + read_bytes: Incomplete + write_bytes: Incomplete + read_time: Incomplete + write_time: Incomplete + read_merged_count: Incomplete + write_merged_count: Incomplete + busy_time: Incomplete class popenfile(NamedTuple): - path: Any - fd: Any - position: Any - mode: Any - flags: Any + path: Incomplete + fd: Incomplete + position: Incomplete + mode: Incomplete + flags: Incomplete class pmem(NamedTuple): - rss: Any - vms: Any - shared: Any - text: Any - lib: Any - data: Any - dirty: Any + rss: Incomplete + vms: Incomplete + shared: Incomplete + text: Incomplete + lib: Incomplete + data: Incomplete + dirty: Incomplete class pfullmem(NamedTuple): rss: Incomplete @@ -96,27 +96,27 @@ class pfullmem(NamedTuple): swap: Incomplete class pmmap_grouped(NamedTuple): - path: Any - rss: Any - size: Any - pss: Any - shared_clean: Any - shared_dirty: Any - private_clean: Any - private_dirty: Any - referenced: Any - anonymous: Any - swap: Any + path: Incomplete + rss: Incomplete + size: Incomplete + pss: Incomplete + shared_clean: Incomplete + shared_dirty: Incomplete + private_clean: Incomplete + private_dirty: Incomplete + referenced: Incomplete + anonymous: Incomplete + swap: Incomplete -pmmap_ext: Any +pmmap_ext: Incomplete class pio(NamedTuple): - read_count: Any - write_count: Any - read_bytes: Any - write_bytes: Any - read_chars: Any - write_chars: Any + read_count: Incomplete + write_count: Incomplete + read_bytes: Incomplete + write_bytes: Incomplete + read_chars: Incomplete + write_chars: Incomplete class pcputimes(NamedTuple): user: float @@ -154,12 +154,12 @@ def cpu_count_cores() -> int | None: ... def cpu_stats(): ... def cpu_freq(): ... -net_if_addrs: Any +net_if_addrs: Incomplete class _Ipv6UnsupportedError(Exception): ... class NetConnections: - tmap: Any + tmap: Incomplete def __init__(self) -> None: ... def get_proc_inodes(self, pid): ... def get_all_inodes(self): ... @@ -175,7 +175,7 @@ def net_connections(kind: str = ...): ... def net_io_counters(): ... def net_if_stats(): ... -disk_usage: Any +disk_usage: Incomplete def disk_io_counters(perdisk: bool = ...): ... @@ -200,7 +200,7 @@ def ppid_map(): ... def wrap_exceptions(fun): ... class Process: - pid: Any + pid: Incomplete def __init__(self, pid) -> None: ... def oneshot_enter(self) -> None: ... def oneshot_exit(self) -> None: ... @@ -213,7 +213,7 @@ class Process: def cpu_times(self): ... def cpu_num(self): ... def wait(self, timeout: Incomplete | None = ...): ... - def create_time(self): ... + def create_time(self, monotonic: bool = False) -> float: ... def memory_info(self): ... def memory_full_info(self): ... def memory_maps(self): ... diff --git a/python/helpers/typeshed/stubs/psutil/psutil/_psosx.pyi b/python/helpers/typeshed/stubs/psutil/psutil/_psosx.pyi index dee1fd6ed291..1c74d57bb570 100644 --- a/python/helpers/typeshed/stubs/psutil/psutil/_psosx.pyi +++ b/python/helpers/typeshed/stubs/psutil/psutil/_psosx.pyi @@ -1,109 +1,118 @@ -from _typeshed import Incomplete -from typing import Any, NamedTuple +import sys -from psutil._common import ( - AccessDenied as AccessDenied, - NoSuchProcess as NoSuchProcess, - ZombieProcess as ZombieProcess, - conn_tmap as conn_tmap, - conn_to_ntuple as conn_to_ntuple, - isfile_strict as isfile_strict, - parse_environ_block as parse_environ_block, - usage_percent as usage_percent, -) +if sys.platform == "darwin": + from collections.abc import Callable + from typing import Final, NamedTuple, TypeVar + from typing_extensions import ParamSpec -__extra__all__: Any -PAGESIZE: Any -AF_LINK: Any -TCP_STATUSES: Any -PROC_STATUSES: Any -kinfo_proc_map: Any -pidtaskinfo_map: Any + from psutil._common import ( + AccessDenied as AccessDenied, + NoSuchProcess as NoSuchProcess, + ZombieProcess as ZombieProcess, + conn_tmap as conn_tmap, + conn_to_ntuple as conn_to_ntuple, + debug as debug, + isfile_strict as isfile_strict, + memoize_when_activated as memoize_when_activated, + parse_environ_block as parse_environ_block, + usage_percent as usage_percent, + ) -class scputimes(NamedTuple): - user: float - nice: float - system: float - idle: float + from . import _common, _psposix, _psutil_osx, _psutil_posix -class svmem(NamedTuple): - total: int - available: int - percent: float - used: int - free: int - active: int - inactive: int - wired: int + _P = ParamSpec("_P") + _R = TypeVar("_R") -class pmem(NamedTuple): - rss: Any - vms: Any - pfaults: Any - pageins: Any + __extra__all__: Final[list[str]] + PAGESIZE: Final[int] + AF_LINK: Final[int] + TCP_STATUSES: Final[dict[int, str]] + PROC_STATUSES: Final[dict[int, str]] + kinfo_proc_map: Final[dict[str, int]] + pidtaskinfo_map: Final[dict[str, int]] -class pfullmem(NamedTuple): - rss: Incomplete - vms: Incomplete - pfaults: Incomplete - pageins: Incomplete - uss: Incomplete + class scputimes(NamedTuple): + user: float + nice: float + system: float + idle: float -def virtual_memory() -> svmem: ... -def swap_memory(): ... -def cpu_times(): ... -def per_cpu_times(): ... -def cpu_count_logical(): ... -def cpu_count_cores() -> int | None: ... -def cpu_stats(): ... -def cpu_freq(): ... + class svmem(NamedTuple): + total: int + available: int + percent: float + used: int + free: int + active: int + inactive: int + wired: int -disk_usage: Any -disk_io_counters: Any + class pmem(NamedTuple): + rss: int + vms: int + pfaults: int + pageins: int -def disk_partitions(all: bool = False): ... -def sensors_battery(): ... + class pfullmem(NamedTuple): + rss: int + vms: int + pfaults: int + pageins: int + uss: int -net_io_counters: Any -net_if_addrs: Any + def virtual_memory() -> svmem: ... + def swap_memory() -> _common.sswap: ... + def cpu_times() -> scputimes: ... + def per_cpu_times() -> list[scputimes]: ... + def cpu_count_logical() -> int | None: ... + def cpu_count_cores() -> int | None: ... + def cpu_stats() -> _common.scpustats: ... + def cpu_freq() -> list[_common.scpufreq]: ... -def net_connections(kind: str = "inet"): ... -def net_if_stats(): ... -def boot_time(): ... -def users(): ... -def pids(): ... + disk_usage = _psposix.disk_usage + disk_io_counters = _psutil_osx.disk_io_counters + def disk_partitions(all: bool = False) -> list[_common.sdiskpart]: ... + def sensors_battery() -> _common.sbattery | None: ... -pid_exists: Any + net_io_counters = _psutil_osx.net_io_counters + net_if_addrs = _psutil_posix.net_if_addrs + def net_connections(kind: str = "inet") -> list[_common.sconn]: ... + def net_if_stats() -> dict[str, _common.snicstats]: ... + def boot_time() -> float: ... + INIT_BOOT_TIME: float + def adjust_proc_create_time(ctime: float) -> float: ... + def users() -> list[_common.suser]: ... + def pids() -> list[int]: ... + pid_exists = _psposix.pid_exists + def wrap_exceptions(fun: Callable[_P, _R]) -> Callable[_P, _R]: ... + def is_zombie(pid: int) -> bool: ... -def is_zombie(pid): ... -def wrap_exceptions(fun): ... - -class Process: - __slots__ = ["_cache", "_name", "_ppid", "pid"] - pid: Any - def __init__(self, pid) -> None: ... - def oneshot_enter(self) -> None: ... - def oneshot_exit(self) -> None: ... - def name(self): ... - def exe(self): ... - def cmdline(self): ... - def environ(self): ... - def ppid(self): ... - def cwd(self): ... - def uids(self): ... - def gids(self): ... - def terminal(self): ... - def memory_info(self): ... - def memory_full_info(self): ... - def cpu_times(self): ... - def create_time(self): ... - def num_ctx_switches(self): ... - def num_threads(self): ... - def open_files(self): ... - def net_connections(self, kind: str = "inet"): ... - def num_fds(self): ... - def wait(self, timeout=None): ... - def nice_get(self): ... - def nice_set(self, value): ... - def status(self): ... - def threads(self): ... + class Process: + __slots__ = ["_cache", "_name", "_ppid", "pid"] + pid: int + def __init__(self, pid: int) -> None: ... + def oneshot_enter(self) -> None: ... + def oneshot_exit(self) -> None: ... + def name(self) -> str: ... + def exe(self) -> str: ... + def cmdline(self) -> list[str]: ... + def environ(self) -> dict[str, str]: ... + def ppid(self) -> int: ... + def cwd(self) -> str: ... + def uids(self) -> _common.puids: ... + def gids(self) -> _common.puids: ... + def terminal(self) -> str | None: ... + def memory_info(self) -> pmem: ... + def memory_full_info(self) -> pfullmem: ... + def cpu_times(self) -> _common.pcputimes: ... + def create_time(self, monotonic: bool = False) -> float: ... + def num_ctx_switches(self) -> _common.pctxsw: ... + def num_threads(self) -> int: ... + def open_files(self) -> list[_common.popenfile]: ... + def net_connections(self, kind: str = "inet"): ... + def num_fds(self) -> int: ... + def wait(self, timeout: float | None = None): ... + def nice_get(self): ... + def nice_set(self, value): ... + def status(self) -> str: ... + def threads(self) -> list[_common.pthread]: ... diff --git a/python/helpers/typeshed/stubs/psutil/psutil/_psposix.pyi b/python/helpers/typeshed/stubs/psutil/psutil/_psposix.pyi index 46c218915a04..57b6ff163616 100644 --- a/python/helpers/typeshed/stubs/psutil/psutil/_psposix.pyi +++ b/python/helpers/typeshed/stubs/psutil/psutil/_psposix.pyi @@ -1,6 +1,26 @@ -def pid_exists(pid): ... -def wait_pid(pid, timeout=None, proc_name=None, _waitpid=..., _timer=..., _min=..., _sleep=..., _pid_exists=...): ... -def disk_usage(path): ... -def get_terminal_map(): ... +import sys +from _typeshed import FileDescriptorOrPath, StrOrBytesPath + +from ._common import sdiskusage + +def pid_exists(pid: int) -> bool: ... +def wait_pid( + pid: int, + timeout: float | None = None, + proc_name: str | None = None, + _waitpid=..., + _timer=..., + _min=..., + _sleep=..., + _pid_exists=..., +): ... + +if sys.platform == "darwin": + def disk_usage(path: StrOrBytesPath) -> sdiskusage: ... + +else: + def disk_usage(path: FileDescriptorOrPath) -> sdiskusage: ... + +def get_terminal_map() -> dict[int, str]: ... __all__ = ["pid_exists", "wait_pid", "disk_usage", "get_terminal_map"] diff --git a/python/helpers/typeshed/stubs/psutil/psutil/_psutil_linux.pyi b/python/helpers/typeshed/stubs/psutil/psutil/_psutil_linux.pyi index 877715d040fb..41f661385762 100644 --- a/python/helpers/typeshed/stubs/psutil/psutil/_psutil_linux.pyi +++ b/python/helpers/typeshed/stubs/psutil/psutil/_psutil_linux.pyi @@ -1,17 +1,14 @@ -from typing import Any - DUPLEX_FULL: int DUPLEX_HALF: int DUPLEX_UNKNOWN: int version: int def check_pid_range(pid: int, /) -> None: ... -def disk_partitions(*args, **kwargs) -> Any: ... -def linux_sysinfo(*args, **kwargs) -> Any: ... -def net_if_duplex_speed(*args, **kwargs) -> Any: ... -def proc_cpu_affinity_get(*args, **kwargs) -> Any: ... -def proc_cpu_affinity_set(*args, **kwargs) -> Any: ... -def proc_ioprio_get(*args, **kwargs) -> Any: ... -def proc_ioprio_set(*args, **kwargs) -> Any: ... -def set_debug(*args, **kwargs) -> Any: ... -def users(*args, **kwargs) -> Any: ... +def disk_partitions(*args, **kwargs): ... +def linux_sysinfo(*args, **kwargs): ... +def net_if_duplex_speed(*args, **kwargs): ... +def proc_cpu_affinity_get(*args, **kwargs): ... +def proc_cpu_affinity_set(*args, **kwargs): ... +def proc_ioprio_get(*args, **kwargs): ... +def proc_ioprio_set(*args, **kwargs): ... +def set_debug(*args, **kwargs): ... diff --git a/python/helpers/typeshed/stubs/psutil/psutil/_psutil_osx.pyi b/python/helpers/typeshed/stubs/psutil/psutil/_psutil_osx.pyi index 3a6ea7372d40..2b27ee37863d 100644 --- a/python/helpers/typeshed/stubs/psutil/psutil/_psutil_osx.pyi +++ b/python/helpers/typeshed/stubs/psutil/psutil/_psutil_osx.pyi @@ -1,51 +1,64 @@ -from typing import Any +import sys -PSUTIL_CONN_NONE: int -SIDL: int -SRUN: int -SSLEEP: int -SSTOP: int -SZOMB: int -TCPS_CLOSED: int -TCPS_CLOSE_WAIT: int -TCPS_CLOSING: int -TCPS_ESTABLISHED: int -TCPS_FIN_WAIT_1: int -TCPS_FIN_WAIT_2: int -TCPS_LAST_ACK: int -TCPS_LISTEN: int -TCPS_SYN_RECEIVED: int -TCPS_SYN_SENT: int -TCPS_TIME_WAIT: int -version: int +if sys.platform == "darwin": + from _typeshed import StrOrBytesPath + from collections.abc import Sequence + from socket import AddressFamily, SocketKind + from typing import Final, TypeVar -def boot_time(*args, **kwargs) -> Any: ... -def check_pid_range(pid: int, /) -> None: ... -def cpu_count_cores(*args, **kwargs) -> Any: ... -def cpu_count_logical(*args, **kwargs) -> Any: ... -def cpu_freq(*args, **kwargs) -> Any: ... -def cpu_stats(*args, **kwargs) -> Any: ... -def cpu_times(*args, **kwargs) -> Any: ... -def disk_io_counters(*args, **kwargs) -> Any: ... -def disk_partitions(*args, **kwargs) -> Any: ... -def disk_usage_used(*args, **kwargs) -> Any: ... -def net_io_counters(*args, **kwargs) -> Any: ... -def per_cpu_times(*args, **kwargs) -> Any: ... -def pids(*args, **kwargs) -> Any: ... -def proc_cmdline(*args, **kwargs) -> Any: ... -def proc_net_connections(*args, **kwargs) -> Any: ... -def proc_cwd(*args, **kwargs) -> Any: ... -def proc_environ(*args, **kwargs) -> Any: ... -def proc_exe(*args, **kwargs) -> Any: ... -def proc_kinfo_oneshot(*args, **kwargs) -> Any: ... -def proc_memory_uss(*args, **kwargs) -> Any: ... -def proc_name(*args, **kwargs) -> Any: ... -def proc_num_fds(*args, **kwargs) -> Any: ... -def proc_open_files(*args, **kwargs) -> Any: ... -def proc_pidtaskinfo_oneshot(*args, **kwargs) -> Any: ... -def proc_threads(*args, **kwargs) -> Any: ... -def sensors_battery(*args, **kwargs) -> Any: ... -def set_debug(*args, **kwargs) -> Any: ... -def swap_mem(*args, **kwargs) -> Any: ... -def users(*args, **kwargs) -> Any: ... -def virtual_mem(*args, **kwargs) -> Any: ... + _T = TypeVar("_T") + + version: Final[int] + SIDL: Final = 1 + SRUN: Final = 2 + SSLEEP: Final = 3 + SSTOP: Final = 4 + SZOMB: Final = 5 + TCPS_CLOSED: Final = 0 + TCPS_CLOSING: Final = 7 + TCPS_CLOSE_WAIT: Final = 5 + TCPS_LISTEN: Final = 1 + TCPS_ESTABLISHED: Final = 4 + TCPS_SYN_SENT: Final = 2 + TCPS_SYN_RECEIVED: Final = 3 + TCPS_FIN_WAIT_1: Final = 6 + TCPS_FIN_WAIT_2: Final = 9 + TCPS_LAST_ACK: Final = 8 + TCPS_TIME_WAIT: Final = 10 + PSUTIL_CONN_NONE: Final = 128 + + def proc_cmdline(pid: int, /) -> list[str]: ... + def proc_cwd(pid: int, /) -> str: ... + def proc_environ(pid: int, /) -> str: ... + def proc_exe(pid: int, /) -> str: ... + def proc_kinfo_oneshot(pid: int, /) -> tuple[int, int, int, int, int, int, int, float, int, str]: ... + def proc_memory_uss(pid: int, /) -> int: ... + def proc_name(pid: int, /) -> str: ... + def proc_net_connections( + pid: int, af_filter: Sequence[AddressFamily | int | None], type_filter: Sequence[SocketKind | int | None], / + ) -> list[ + tuple[int, int, int, tuple[str | None, int], tuple[str | None, int] | tuple[()], int] + | tuple[int, int, int, str, str, int] + ]: ... + def proc_num_fds(pid: int, /) -> int: ... + def proc_open_files(pid: int, /) -> list[tuple[str, int]]: ... + def proc_pidtaskinfo_oneshot(pid: int, /) -> tuple[float, float, int, int, int, int, int, int]: ... + def proc_threads(pid: int, /) -> list[tuple[int, float, float]]: ... + def boot_time() -> float: ... + def cpu_count_cores() -> int | None: ... + def cpu_count_logical() -> int | None: ... + def cpu_freq() -> tuple[int, int, int]: ... + def cpu_stats() -> tuple[int, int, int, int, int]: ... + def cpu_times() -> tuple[float, float, float, float]: ... + def disk_io_counters() -> dict[str, tuple[int, int, int, int, int, int]]: ... + def disk_partitions() -> list[tuple[str, str, str, str]]: ... + def disk_usage_used(mount_point: StrOrBytesPath, default: _T, /) -> int | _T: ... + def has_cpu_freq() -> bool: ... + def net_io_counters() -> dict[str, tuple[int, int, int, int, int, int, int, int]]: ... + def per_cpu_times() -> list[tuple[float, float, float, float]]: ... + def pids() -> list[int]: ... + def sensors_battery() -> tuple[int, int, int]: ... + def swap_mem() -> tuple[int, int, int, int, int]: ... + def virtual_mem() -> tuple[int, int, int, int, int, int]: ... + def check_pid_range(pid: int, /) -> None: ... + def set_debug(value: bool, /) -> None: ... diff --git a/python/helpers/typeshed/stubs/psutil/psutil/_psutil_posix.pyi b/python/helpers/typeshed/stubs/psutil/psutil/_psutil_posix.pyi index 2a58ee9a43de..42ab74cb09e0 100644 --- a/python/helpers/typeshed/stubs/psutil/psutil/_psutil_posix.pyi +++ b/python/helpers/typeshed/stubs/psutil/psutil/_psutil_posix.pyi @@ -1,34 +1,36 @@ import sys -from typing import Any +from _typeshed import Incomplete +from typing import Final if sys.platform == "linux": - RLIMIT_AS: int - RLIMIT_CORE: int - RLIMIT_CPU: int - RLIMIT_DATA: int - RLIMIT_FSIZE: int - RLIMIT_LOCKS: int - RLIMIT_MEMLOCK: int - RLIMIT_MSGQUEUE: int - RLIMIT_NICE: int - RLIMIT_NOFILE: int - RLIMIT_NPROC: int - RLIMIT_RSS: int - RLIMIT_RTPRIO: int - RLIMIT_RTTIME: int - RLIMIT_SIGPENDING: int - RLIMIT_STACK: int - RLIM_INFINITY: int + RLIMIT_AS: Final[int] + RLIMIT_CORE: Final[int] + RLIMIT_CPU: Final[int] + RLIMIT_DATA: Final[int] + RLIMIT_FSIZE: Final[int] + RLIMIT_LOCKS: Final[int] + RLIMIT_MEMLOCK: Final[int] + RLIMIT_MSGQUEUE: Final[int] + RLIMIT_NICE: Final[int] + RLIMIT_NOFILE: Final[int] + RLIMIT_NPROC: Final[int] + RLIMIT_RSS: Final[int] + RLIMIT_RTPRIO: Final[int] + RLIMIT_RTTIME: Final[int] + RLIMIT_SIGPENDING: Final[int] + RLIMIT_STACK: Final[int] + RLIM_INFINITY: Final[int] -def getpagesize(*args, **kwargs) -> Any: ... -def getpriority(*args, **kwargs) -> Any: ... -def net_if_addrs(*args, **kwargs) -> Any: ... -def net_if_flags(*args, **kwargs) -> Any: ... -def net_if_is_running(*args, **kwargs) -> Any: ... -def net_if_mtu(*args, **kwargs) -> Any: ... +def getpagesize() -> int: ... +def getpriority(pid: int, /) -> int: ... +def net_if_addrs() -> list[tuple[str, int, str | None, str | None, str | None, str | None]]: ... +def net_if_flags(nic_name: str, /) -> list[str]: ... +def net_if_is_running(nic_name: str, /) -> bool: ... +def net_if_mtu(nic_name: str, /) -> int: ... if sys.platform == "darwin": - AF_LINK: int - def net_if_duplex_speed(*args, **kwargs): ... + AF_LINK: Final[int] + def net_if_duplex_speed(nic_name: str, /) -> list[int]: ... -def setpriority(*args, **kwargs) -> Any: ... +def users() -> list[tuple[Incomplete, ...]]: ... +def setpriority(pid: int, priority: int, /) -> None: ... diff --git a/python/helpers/typeshed/stubs/psutil/psutil/_psutil_windows.pyi b/python/helpers/typeshed/stubs/psutil/psutil/_psutil_windows.pyi index a65eb03ed53f..74c6b1b5845f 100644 --- a/python/helpers/typeshed/stubs/psutil/psutil/_psutil_windows.pyi +++ b/python/helpers/typeshed/stubs/psutil/psutil/_psutil_windows.pyi @@ -1,94 +1,103 @@ -from typing import Final +import sys -ABOVE_NORMAL_PRIORITY_CLASS: Final = 32768 -BELOW_NORMAL_PRIORITY_CLASS: Final = 16384 -ERROR_ACCESS_DENIED: int -ERROR_INVALID_NAME: int -ERROR_PRIVILEGE_NOT_HELD: int -ERROR_SERVICE_DOES_NOT_EXIST: int -HIGH_PRIORITY_CLASS: Final = 128 -IDLE_PRIORITY_CLASS: Final = 64 -INFINITE: int -MIB_TCP_STATE_CLOSED: int -MIB_TCP_STATE_CLOSE_WAIT: int -MIB_TCP_STATE_CLOSING: int -MIB_TCP_STATE_DELETE_TCB: int -MIB_TCP_STATE_ESTAB: int -MIB_TCP_STATE_FIN_WAIT1: int -MIB_TCP_STATE_FIN_WAIT2: int -MIB_TCP_STATE_LAST_ACK: int -MIB_TCP_STATE_LISTEN: int -MIB_TCP_STATE_SYN_RCVD: int -MIB_TCP_STATE_SYN_SENT: int -MIB_TCP_STATE_TIME_WAIT: int -NORMAL_PRIORITY_CLASS: Final = 32 -PSUTIL_CONN_NONE: int -REALTIME_PRIORITY_CLASS: Final = 256 -WINDOWS_10: int -WINDOWS_7: int -WINDOWS_8: int -WINDOWS_8_1: int -WINDOWS_VISTA: int -WINVER: int -version: int +if sys.platform == "win32": + from collections.abc import Sequence + from socket import AddressFamily, SocketKind + from typing import Final -class TimeoutAbandoned(Exception): ... -class TimeoutExpired(Exception): ... + version: Final[int] + ABOVE_NORMAL_PRIORITY_CLASS: Final = 32768 + BELOW_NORMAL_PRIORITY_CLASS: Final = 16384 + HIGH_PRIORITY_CLASS: Final = 128 + IDLE_PRIORITY_CLASS: Final = 64 + NORMAL_PRIORITY_CLASS: Final = 32 + REALTIME_PRIORITY_CLASS: Final = 256 + MIB_TCP_STATE_CLOSED: Final = 1 + MIB_TCP_STATE_CLOSING: Final = 9 + MIB_TCP_STATE_CLOSE_WAIT: Final = 8 + MIB_TCP_STATE_LISTEN: Final = 2 + MIB_TCP_STATE_ESTAB: Final = 5 + MIB_TCP_STATE_SYN_SENT: Final = 3 + MIB_TCP_STATE_SYN_RCVD: Final = 4 + MIB_TCP_STATE_FIN_WAIT1: Final = 6 + MIB_TCP_STATE_FIN_WAIT2: Final = 7 + MIB_TCP_STATE_LAST_ACK: Final = 10 + MIB_TCP_STATE_TIME_WAIT: Final = 11 + MIB_TCP_STATE_DELETE_TCB: Final = 12 + PSUTIL_CONN_NONE: Final = 128 + INFINITE: Final[int] + ERROR_ACCESS_DENIED: Final = 5 + ERROR_INVALID_NAME: Final = 123 + ERROR_SERVICE_DOES_NOT_EXIST: Final = 1060 + ERROR_PRIVILEGE_NOT_HELD: Final = 1314 + WINVER: Final[int] + WINDOWS_VISTA: Final = 60 + WINDOWS_7: Final = 61 + WINDOWS_8: Final = 62 + WINDOWS_8_1: Final = 63 + WINDOWS_10: Final = 100 -def QueryDosDevice(*args, **kwargs): ... # incomplete -def boot_time(*args, **kwargs): ... # incomplete -def check_pid_range(pid: int, /) -> None: ... -def cpu_count_cores(*args, **kwargs): ... # incomplete -def cpu_count_logical(*args, **kwargs): ... # incomplete -def cpu_freq(*args, **kwargs): ... # incomplete -def cpu_stats(*args, **kwargs): ... # incomplete -def cpu_times(*args, **kwargs): ... # incomplete -def disk_io_counters(*args, **kwargs): ... # incomplete -def disk_partitions(*args, **kwargs): ... # incomplete -def disk_usage(*args, **kwargs): ... # incomplete -def getloadavg(*args, **kwargs): ... # incomplete -def getpagesize(*args, **kwargs): ... # incomplete -def init_loadavg_counter(*args, **kwargs): ... # incomplete -def net_connections(*args, **kwargs): ... # incomplete -def net_if_addrs(*args, **kwargs): ... # incomplete -def net_if_stats(*args, **kwargs): ... # incomplete -def net_io_counters(*args, **kwargs): ... # incomplete -def per_cpu_times(*args, **kwargs): ... # incomplete -def pid_exists(*args, **kwargs): ... # incomplete -def pids(*args, **kwargs): ... # incomplete -def ppid_map(*args, **kwargs): ... # incomplete -def proc_cmdline(*args, **kwargs): ... # incomplete -def proc_cpu_affinity_get(*args, **kwargs): ... # incomplete -def proc_cpu_affinity_set(*args, **kwargs): ... # incomplete -def proc_cwd(*args, **kwargs): ... # incomplete -def proc_environ(*args, **kwargs): ... # incomplete -def proc_exe(*args, **kwargs): ... # incomplete -def proc_info(*args, **kwargs): ... # incomplete -def proc_io_counters(*args, **kwargs): ... # incomplete -def proc_io_priority_get(*args, **kwargs): ... # incomplete -def proc_io_priority_set(*args, **kwargs): ... # incomplete -def proc_is_suspended(*args, **kwargs): ... # incomplete -def proc_kill(*args, **kwargs): ... # incomplete -def proc_memory_info(*args, **kwargs): ... # incomplete -def proc_memory_maps(*args, **kwargs): ... # incomplete -def proc_memory_uss(*args, **kwargs): ... # incomplete -def proc_num_handles(*args, **kwargs): ... # incomplete -def proc_open_files(*args, **kwargs): ... # incomplete -def proc_priority_get(*args, **kwargs): ... # incomplete -def proc_priority_set(*args, **kwargs): ... # incomplete -def proc_suspend_or_resume(*args, **kwargs): ... # incomplete -def proc_threads(*args, **kwargs): ... # incomplete -def proc_times(*args, **kwargs): ... # incomplete -def proc_username(*args, **kwargs): ... # incomplete -def proc_wait(*args, **kwargs): ... # incomplete -def sensors_battery(*args, **kwargs): ... # incomplete -def set_debug(*args, **kwargs): ... # incomplete -def swap_percent(*args, **kwargs): ... # incomplete -def users(*args, **kwargs): ... # incomplete -def virtual_mem(*args, **kwargs): ... # incomplete -def winservice_enumerate(*args, **kwargs): ... # incomplete -def winservice_query_config(*args, **kwargs): ... # incomplete -def winservice_query_descr(*args, **kwargs): ... # incomplete -def winservice_query_status(*args, **kwargs): ... # incomplete -def winservice_start(*args, **kwargs): ... # incomplete -def winservice_stop(*args, **kwargs): ... # incomplete + class TimeoutAbandoned(Exception): ... + class TimeoutExpired(Exception): ... + + def proc_cmdline(pid: int, use_peb: bool = True) -> list[str]: ... + def proc_cpu_affinity_get(pid: int, /) -> int: ... + def proc_cpu_affinity_set(pid: int, mask: int, /) -> None: ... + def proc_cwd(pid: int, /) -> str: ... + def proc_environ(pid: int, /) -> str: ... + def proc_exe(pid: int, /) -> str: ... + def proc_io_counters(pid: int, /) -> tuple[int, int, int, int, int, int]: ... + def proc_io_priority_get(pid: int, /) -> int: ... + def proc_io_priority_set(pid: int, priority: int, /) -> None: ... + def proc_is_suspended(pid: int, /) -> bool: ... + def proc_kill(pid: int, /) -> None: ... + def proc_memory_info(pid: int, /) -> tuple[int, int, int, int, int, int, int, int, int, int]: ... + def proc_memory_maps(pid: int, /) -> list[tuple[int, str, str, int]]: ... + def proc_memory_uss(pid: int, /) -> int: ... + def proc_num_handles(pid: int, /) -> int: ... + def proc_open_files(pid: int, /) -> list[str]: ... + def proc_priority_get(pid: int, /) -> int: ... + def proc_priority_set(pid: int, priority: int, /) -> None: ... + def proc_suspend_or_resume(pid: int, suspend: bool | None, /) -> None: ... + def proc_threads(pid: int, /) -> list[tuple[int, float, float]]: ... + def proc_times(pid: int, /) -> tuple[float, float, float]: ... + def proc_username(pid: int, /) -> tuple[str, str]: ... + def proc_wait(pid: int, timeout: int, /) -> int | None: ... + def proc_info( + pid: int, / + ) -> tuple[int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int]: ... + def uptime() -> float: ... + def cpu_count_cores() -> int | None: ... + def cpu_count_logical() -> int | None: ... + def cpu_freq() -> tuple[int, int]: ... + def cpu_stats() -> tuple[int, int, int, int]: ... + def cpu_times() -> tuple[float, float, float]: ... + def disk_io_counters() -> dict[str, tuple[int, int, int, int, int, int]]: ... + def disk_partitions(all: bool, /) -> list[tuple[str, str, str, str]]: ... + def disk_usage(path: str, /) -> tuple[int, int, int]: ... + def getloadavg() -> tuple[float, float, float]: ... + def getpagesize() -> int: ... + def swap_percent() -> float: ... + def init_loadavg_counter() -> None: ... + def net_connections( + pid: int, af_filter: Sequence[AddressFamily | int | None], type_filter: Sequence[SocketKind | int | None], / + ) -> list[tuple[int, int, int, tuple[str | None, int], tuple[str | None, int], int, int]]: ... + def net_if_addrs() -> list[tuple[str, int, str, str | None, None, None]]: ... + def net_if_stats() -> dict[str, tuple[bool, int, int, int]]: ... + def net_io_counters() -> dict[str, tuple[int, int, int, int, int, int, int, int]]: ... + def per_cpu_times() -> list[tuple[float, float, float, float, float]]: ... + def pid_exists(pid: int, /) -> bool: ... + def pids() -> list[int]: ... + def ppid_map() -> dict[int, int]: ... + def sensors_battery() -> tuple[int, int, int, int]: ... + def users() -> list[tuple[str, str | None, float]]: ... + def virtual_mem() -> tuple[int, int, int, int]: ... + def winservice_enumerate() -> list[tuple[str, str]]: ... + def winservice_query_config(service_name: str, /) -> tuple[str, str, str, str]: ... + def winservice_query_descr(service_name: str, /) -> str: ... + def winservice_query_status(service_name: str, /) -> tuple[str, int] | str: ... + def winservice_start(service_name: str, /) -> None: ... + def winservice_stop(service_name: str, /) -> None: ... + def QueryDosDevice(device_path: str, /) -> str: ... + def check_pid_range(pid: int, /) -> None: ... + def set_debug(value: bool, /) -> None: ... diff --git a/python/helpers/typeshed/stubs/psutil/psutil/_pswindows.pyi b/python/helpers/typeshed/stubs/psutil/psutil/_pswindows.pyi index afd5f49b1a94..fd23474b773c 100644 --- a/python/helpers/typeshed/stubs/psutil/psutil/_pswindows.pyi +++ b/python/helpers/typeshed/stubs/psutil/psutil/_pswindows.pyi @@ -1,200 +1,231 @@ -import enum -from _typeshed import Incomplete -from collections.abc import Iterable -from typing import Any, NamedTuple +import sys -from psutil import _psutil_windows -from psutil._common import ( - ENCODING as ENCODING, - AccessDenied as AccessDenied, - NoSuchProcess as NoSuchProcess, - TimeoutExpired as TimeoutExpired, - conn_tmap as conn_tmap, - conn_to_ntuple as conn_to_ntuple, - debug as debug, - isfile_strict as isfile_strict, - memoize as memoize, - parse_environ_block as parse_environ_block, - usage_percent as usage_percent, -) -from psutil._psutil_windows import ( - ABOVE_NORMAL_PRIORITY_CLASS as ABOVE_NORMAL_PRIORITY_CLASS, - BELOW_NORMAL_PRIORITY_CLASS as BELOW_NORMAL_PRIORITY_CLASS, - HIGH_PRIORITY_CLASS as HIGH_PRIORITY_CLASS, - IDLE_PRIORITY_CLASS as IDLE_PRIORITY_CLASS, - NORMAL_PRIORITY_CLASS as NORMAL_PRIORITY_CLASS, - REALTIME_PRIORITY_CLASS as REALTIME_PRIORITY_CLASS, -) +if sys.platform == "win32": + import enum + from _typeshed import Incomplete + from collections.abc import Iterable, Iterator + from signal import Signals + from typing import Final, Literal, NamedTuple, TypedDict, overload, type_check_only -__extra__all__: Any -CONN_DELETE_TCB: str -ERROR_PARTIAL_COPY: int -PYPY: Any -AF_LINK: int -AddressFamily: Any -TCP_STATUSES: Any + from psutil import _psutil_windows + from psutil._common import ( + ENCODING as ENCODING, + AccessDenied as AccessDenied, + NoSuchProcess as NoSuchProcess, + TimeoutExpired as TimeoutExpired, + conn_tmap as conn_tmap, + conn_to_ntuple as conn_to_ntuple, + debug as debug, + isfile_strict as isfile_strict, + memoize as memoize, + memoize_when_activated as memoize_when_activated, + parse_environ_block as parse_environ_block, + usage_percent as usage_percent, + ) + from psutil._psutil_windows import ( + ABOVE_NORMAL_PRIORITY_CLASS as ABOVE_NORMAL_PRIORITY_CLASS, + BELOW_NORMAL_PRIORITY_CLASS as BELOW_NORMAL_PRIORITY_CLASS, + HIGH_PRIORITY_CLASS as HIGH_PRIORITY_CLASS, + IDLE_PRIORITY_CLASS as IDLE_PRIORITY_CLASS, + NORMAL_PRIORITY_CLASS as NORMAL_PRIORITY_CLASS, + REALTIME_PRIORITY_CLASS as REALTIME_PRIORITY_CLASS, + ) -# 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 + from . import _common -IOPRIO_VERYLOW: int -IOPRIO_LOW: int -IOPRIO_NORMAL: int -IOPRIO_HIGH: int + __extra__all__: Final[list[str]] + CONN_DELETE_TCB: Final = "DELETE_TCB" + ERROR_PARTIAL_COPY: Final = 299 + PYPY: Final[bool] -class IOPriority(enum.IntEnum): - IOPRIO_VERYLOW = 0 - IOPRIO_LOW = 1 - IOPRIO_NORMAL = 2 - IOPRIO_HIGH = 3 + class AddressFamily(enum.IntEnum): + AF_LINK = -1 -pinfo_map: Any + AF_LINK: Final = AddressFamily.AF_LINK + TCP_STATUSES: Final[dict[int, str]] -class scputimes(NamedTuple): - user: float - system: float - idle: float - interrupt: float - dpc: float + # 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 -class svmem(NamedTuple): - total: int - available: int - percent: float - used: int - free: int + class IOPriority(enum.IntEnum): + IOPRIO_VERYLOW = 0 + IOPRIO_LOW = 1 + IOPRIO_NORMAL = 2 + IOPRIO_HIGH = 3 -class pmem(NamedTuple): - rss: Any - vms: Any - num_page_faults: Any - peak_wset: Any - wset: Any - peak_paged_pool: Any - paged_pool: Any - peak_nonpaged_pool: Any - nonpaged_pool: Any - pagefile: Any - peak_pagefile: Any - private: Any + IOPRIO_VERYLOW: Final = IOPriority.IOPRIO_VERYLOW + IOPRIO_LOW: Final = IOPriority.IOPRIO_LOW + IOPRIO_NORMAL: Final = IOPriority.IOPRIO_NORMAL + IOPRIO_HIGH: Final = IOPriority.IOPRIO_HIGH -class pfullmem(NamedTuple): - rss: Incomplete - vms: Incomplete - num_page_faults: Incomplete - peak_wset: Incomplete - wset: Incomplete - peak_paged_pool: Incomplete - paged_pool: Incomplete - peak_nonpaged_pool: Incomplete - nonpaged_pool: Incomplete - pagefile: Incomplete - peak_pagefile: Incomplete - private: Incomplete - uss: Incomplete + pinfo_map: Final[dict[str, int]] -class pmmap_grouped(NamedTuple): - path: Any - rss: Any + class scputimes(NamedTuple): + user: float + system: float + idle: float + interrupt: float + dpc: float -pmmap_ext: Any + class svmem(NamedTuple): + total: int + available: int + percent: float + used: int + free: int -class pio(NamedTuple): - read_count: Any - write_count: Any - read_bytes: Any - write_bytes: Any - other_count: Any - other_bytes: Any + class pmem(NamedTuple): + rss: int + vms: int + num_page_faults: int + peak_wset: int + wset: int + peak_paged_pool: int + paged_pool: int + peak_nonpaged_pool: int + nonpaged_pool: int + pagefile: int + peak_pagefile: int + private: int -def convert_dos_path(s): ... -def getpagesize(): ... -def virtual_memory() -> svmem: ... -def swap_memory(): ... + class pfullmem(NamedTuple): + rss: int + vms: int + num_page_faults: int + peak_wset: int + wset: int + peak_paged_pool: int + paged_pool: int + peak_nonpaged_pool: int + nonpaged_pool: int + pagefile: int + peak_pagefile: int + private: int + uss: int -disk_io_counters: Any + class pmmap_grouped(NamedTuple): + path: Incomplete + rss: Incomplete -def disk_usage(path): ... -def disk_partitions(all): ... -def cpu_times(): ... -def per_cpu_times(): ... -def cpu_count_logical(): ... -def cpu_count_cores() -> int | None: ... -def cpu_stats(): ... -def cpu_freq(): ... -def getloadavg(): ... -def net_connections(kind, _pid: int = -1): ... -def net_if_stats(): ... -def net_io_counters(): ... -def net_if_addrs(): ... -def sensors_battery(): ... -def boot_time(): ... -def users(): ... -def win_service_iter() -> Iterable[WindowsService]: ... -def win_service_get(name): ... + class pmmap_ext(NamedTuple): + addr: Incomplete + perms: Incomplete + path: Incomplete + rss: Incomplete -class WindowsService: - def __init__(self, name, display_name) -> None: ... - def __eq__(self, other): ... - def __ne__(self, other): ... - def name(self): ... - def display_name(self): ... - def binpath(self): ... - def username(self): ... - def start_type(self): ... - def pid(self): ... - def status(self): ... - def description(self): ... - def as_dict(self): ... + class pio(NamedTuple): + read_count: int + write_count: int + read_bytes: int + write_bytes: int + other_count: int + other_bytes: int -pids: Any -pid_exists: Any -ppid_map: Any + def convert_dos_path(s: str) -> str: ... + def getpagesize() -> int: ... + def virtual_memory() -> svmem: ... + def swap_memory() -> _common.sswap: ... -def is_permission_err(exc): ... -def convert_oserror(exc, pid=None, name=None): ... -def wrap_exceptions(fun): ... -def retry_error_partial_copy(fun): ... + disk_io_counters = _psutil_windows.disk_io_counters -class Process: - pid: Any - def __init__(self, pid) -> None: ... - def oneshot_enter(self) -> None: ... - def oneshot_exit(self) -> None: ... - def name(self): ... - def exe(self): ... - def cmdline(self): ... - def environ(self): ... - def ppid(self): ... - def memory_info(self): ... - def memory_full_info(self): ... - def memory_maps(self) -> None: ... - def kill(self): ... - def send_signal(self, sig) -> None: ... - def wait(self, timeout=None): ... - def username(self): ... - def create_time(self, fast_only: bool = False): ... - def num_threads(self): ... - def threads(self): ... - def cpu_times(self): ... - def suspend(self) -> None: ... - def resume(self) -> None: ... - def cwd(self): ... - def open_files(self): ... - def net_connections(self, kind: str = "inet"): ... - def nice_get(self): ... - def nice_set(self, value): ... - def ionice_get(self): ... - def ionice_set(self, ioclass, value) -> None: ... - def io_counters(self) -> pio: ... - def status(self): ... - def cpu_affinity_get(self): ... - def cpu_affinity_set(self, value): ... - def num_handles(self): ... - def num_ctx_switches(self): ... + def disk_usage(path: str) -> _common.sdiskusage: ... + def disk_partitions(all: bool) -> list[_common.sdiskpart]: ... + def cpu_times() -> scputimes: ... + def per_cpu_times() -> list[scputimes]: ... + def cpu_count_logical() -> int | None: ... + def cpu_count_cores() -> int | None: ... + def cpu_stats() -> _common.scpustats: ... + def cpu_freq() -> list[_common.scpufreq]: ... + def getloadavg() -> tuple[float, float, float]: ... + @overload + def net_connections(kind: str, _pid: Literal[-1] = -1) -> list[_common.sconn]: ... + @overload + def net_connections(kind: str, _pid: int = -1) -> list[_common.pconn]: ... + def net_if_stats() -> dict[str, _common.snicstats]: ... + def net_io_counters() -> dict[str, tuple[int, int, int, int, int, int, int, int]]: ... + def net_if_addrs() -> list[tuple[str, int, str, str | None, None, None]]: ... + def sensors_battery() -> _common.sbattery | None: ... + def boot_time() -> float: ... + def users() -> list[_common.suser]: ... + def win_service_iter() -> Iterator[WindowsService]: ... + def win_service_get(name: str) -> WindowsService: ... + @type_check_only + class _WindowsServiceAttrs(TypedDict): + name: str + display_name: str | None + description: str + binpath: str + username: str + start_type: str + status: str + pid: int | None + + class WindowsService: + def __init__(self, name: str, display_name: str | None) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def name(self) -> str: ... + def display_name(self) -> str | None: ... + def binpath(self) -> str: ... + def username(self) -> str: ... + def start_type(self) -> str: ... + def pid(self) -> int: ... + def status(self) -> str: ... + def description(self) -> str: ... + def as_dict(self) -> _WindowsServiceAttrs: ... + + pids = _psutil_windows.pids + pid_exists = _psutil_windows.pid_exists + ppid_map = _psutil_windows.ppid_map + + def is_permission_err(exc: OSError) -> bool: ... + @overload + def convert_oserror(exc: PermissionError, pid=None, name=None) -> AccessDenied: ... + @overload + def convert_oserror(exc: OSError, pid=None, name=None) -> AccessDenied | NoSuchProcess: ... + def wrap_exceptions(fun): ... + def retry_error_partial_copy(fun): ... + + class Process: + __slots__ = ["_cache", "_name", "_ppid", "pid"] + pid: int + def __init__(self, pid: int) -> None: ... + def oneshot_enter(self) -> None: ... + def oneshot_exit(self) -> None: ... + def name(self) -> str: ... + def exe(self) -> str: ... + def cmdline(self) -> list[str]: ... + def environ(self) -> dict[str, str]: ... + def ppid(self) -> int: ... + def memory_info(self) -> pmem: ... + def memory_full_info(self) -> pfullmem: ... + def memory_maps(self) -> Iterator[tuple[str, str, str, int]]: ... + def kill(self) -> None: ... + def send_signal(self, sig: Literal[Signals.SIGTERM, Signals.CTRL_C_EVENT, Signals.CTRL_BREAK_EVENT]) -> None: ... + def wait(self, timeout: float | None = None) -> int | None: ... + def username(self) -> str: ... + def create_time(self, fast_only: bool = False) -> float: ... + def num_threads(self) -> int: ... + def threads(self) -> list[_common.pthread]: ... + def cpu_times(self) -> _common.pcputimes: ... + def suspend(self) -> None: ... + def resume(self) -> None: ... + def cwd(self) -> str: ... + def open_files(self) -> list[_common.popenfile]: ... + def net_connections(self, kind: str = "inet") -> list[_common.pconn]: ... + def nice_get(self) -> Priority: ... + def nice_set(self, value) -> None: ... + def ionice_get(self) -> IOPriority: ... + def ionice_set(self, ioclass: int, value: None) -> None: ... + def io_counters(self) -> pio: ... + def status(self) -> Literal["stopped", "running"]: ... + def cpu_affinity_get(self) -> list[int]: ... + def cpu_affinity_set(self, value: Iterable[int]) -> None: ... + def num_handles(self) -> int: ... + def num_ctx_switches(self) -> _common.pctxsw: ... diff --git a/python/helpers/typeshed/stubs/pycurl/pycurl.pyi b/python/helpers/typeshed/stubs/pycurl/pycurl.pyi index 36a44e6ecbe2..f5920dd8564a 100644 --- a/python/helpers/typeshed/stubs/pycurl/pycurl.pyi +++ b/python/helpers/typeshed/stubs/pycurl/pycurl.pyi @@ -1,6 +1,6 @@ import sys from _typeshed import Incomplete -from typing import Final, final +from typing import Any, Final, final from typing_extensions import Self version: str @@ -22,8 +22,10 @@ class Curl: def perform(self) -> None: ... def perform_rb(self) -> bytes: ... def perform_rs(self) -> str: ... - def getinfo(self, info): ... - def getinfo_raw(self, info): ... + # For getinfo and getinfo_raw, the exact return type depends on the passed value: + # http://pycurl.io/docs/latest/curlobject.html#pycurl.Curl.getinfo + def getinfo(self, info: int) -> Any: ... + def getinfo_raw(self, info: int) -> Any: ... def reset(self) -> None: ... def unsetopt(self, option: int): ... def pause(self, bitmask): ... diff --git a/python/helpers/typeshed/stubs/python-crontab/crontab.pyi b/python/helpers/typeshed/stubs/python-crontab/crontab.pyi index c228171d38d0..a33bb1193eb8 100644 --- a/python/helpers/typeshed/stubs/python-crontab/crontab.pyi +++ b/python/helpers/typeshed/stubs/python-crontab/crontab.pyi @@ -1,6 +1,6 @@ import re import subprocess -from _typeshed import Incomplete, StrPath +from _typeshed import StrPath from builtins import range as _range from collections import OrderedDict from collections.abc import Callable, Generator, Iterable, Iterator @@ -66,7 +66,7 @@ class CronTab: crons: list[CronItem] | None filen: str | None cron_command: str - env: OrderedVariableList[Incomplete, Incomplete] | None + env: OrderedVariableList[str, str] | None root: bool intab: str | None tabfile: str | None @@ -132,7 +132,7 @@ class CronItem: comment: str command: str | None last_run: datetime | None - env: OrderedVariableList[Incomplete, Incomplete] + env: OrderedVariableList[str, str] pre_comment: bool marker: str | None stdin: str | None @@ -141,7 +141,7 @@ class CronItem: def __hash__(self) -> int: ... def __eq__(self, other: object) -> bool: ... @classmethod - def from_line(cls, line: str, user: str | None = ..., cron: Incomplete | None = ...) -> Self: ... + def from_line(cls, line: str, user: str | None = ..., cron: CronTab | None = ...) -> Self: ... def delete(self) -> None: ... def set_command(self, cmd: str, parse_stdin: bool = ...) -> None: ... def set_comment(self, cmt: str, pre_comment: bool = ...) -> None: ... diff --git a/python/helpers/typeshed/stubs/python-dateutil/dateutil/parser/_parser.pyi b/python/helpers/typeshed/stubs/python-dateutil/dateutil/parser/_parser.pyi index e4784c89c109..9119ec25d7b7 100644 --- a/python/helpers/typeshed/stubs/python-dateutil/dateutil/parser/_parser.pyi +++ b/python/helpers/typeshed/stubs/python-dateutil/dateutil/parser/_parser.pyi @@ -1,5 +1,5 @@ import re -from _typeshed import Incomplete, SupportsRead +from _typeshed import SupportsRead from collections.abc import Callable, Mapping from datetime import _TzInfo, datetime from io import StringIO @@ -58,22 +58,21 @@ class parserinfo: def convertyear(self, year: int, century_specified: bool = False) -> int: ... def validate(self, res: datetime) -> bool: ... -class _ymd(list[Incomplete]): +class _ymd(list[int]): century_specified: bool dstridx: int | None mstridx: int | None ystridx: int | None - def __init__(self, *args, **kwargs) -> None: ... @property def has_year(self) -> bool: ... @property def has_month(self) -> bool: ... @property def has_day(self) -> bool: ... - def could_be_day(self, value): ... - def append(self, val, label=None): ... - def _resolve_from_stridxs(self, strids): ... - def resolve_ymd(self, yearfirst: bool | None, dayfirst: bool | None): ... + def could_be_day(self, value: int) -> bool: ... + def append(self, val: str | int, label: str | None = None) -> None: ... + def _resolve_from_stridxs(self, strids: dict[str, int]) -> tuple[int, int, int]: ... + def resolve_ymd(self, yearfirst: bool | None, dayfirst: bool | None) -> tuple[int, int, int]: ... class parser: info: parserinfo diff --git a/python/helpers/typeshed/stubs/python-dateutil/dateutil/rrule.pyi b/python/helpers/typeshed/stubs/python-dateutil/dateutil/rrule.pyi index 53bdbe4ba440..dd712283fd3a 100644 --- a/python/helpers/typeshed/stubs/python-dateutil/dateutil/rrule.pyi +++ b/python/helpers/typeshed/stubs/python-dateutil/dateutil/rrule.pyi @@ -1,9 +1,10 @@ import datetime -from _typeshed import Incomplete -from collections.abc import Generator, Iterable, Iterator, Sequence +from collections.abc import Callable, Generator, Iterable, Iterator, Mapping, Sequence from typing import Final, Literal, overload from typing_extensions import Self, TypeAlias +from dateutil.parser._parser import _TzInfos + from ._common import weekday as weekdaybase __all__ = [ @@ -58,13 +59,15 @@ SU: weekday class rrulebase: def __init__(self, cache: bool | None = False) -> None: ... def __iter__(self) -> Iterator[datetime.datetime]: ... - def __getitem__(self, item): ... - def __contains__(self, item) -> bool: ... + def __getitem__(self, item: int | slice) -> datetime.datetime: ... + def __contains__(self, item: datetime.datetime) -> bool: ... def count(self) -> int | None: ... - def before(self, dt, inc: bool = False): ... - def after(self, dt, inc: bool = False): ... - def xafter(self, dt, count=None, inc: bool = False) -> Generator[Incomplete]: ... - def between(self, after, before, inc: bool = False, count: int = 1) -> list[Incomplete]: ... + def before(self, dt: datetime.datetime, inc: bool = False): ... + def after(self, dt: datetime.datetime, inc: bool = False): ... + 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 + ) -> list[datetime.datetime]: ... class rrule(rrulebase): def __init__( @@ -156,22 +159,22 @@ class _iterinfo: class rruleset(rrulebase): class _genitem: - dt: Incomplete - genlist: list[Incomplete] - gen: Incomplete - def __init__(self, genlist, gen) -> None: ... + dt: datetime.datetime + genlist: list[Self] + gen: Iterator[datetime.datetime] + def __init__(self, genlist: list[Self], gen: Iterator[datetime.datetime]) -> None: ... def __next__(self) -> None: ... next = __next__ - def __lt__(self, other) -> bool: ... - def __gt__(self, other) -> bool: ... - def __eq__(self, other) -> bool: ... - def __ne__(self, other) -> bool: ... + def __lt__(self, other: Self) -> bool: ... + def __gt__(self, other: Self) -> bool: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... def __init__(self, cache: bool | None = False) -> None: ... def rrule(self, rrule: _RRule) -> None: ... - def rdate(self, rdate) -> None: ... - def exrule(self, exrule) -> None: ... - def exdate(self, exdate) -> None: ... + def rdate(self, rdate: datetime.datetime) -> None: ... + def exrule(self, exrule: _RRule) -> None: ... + def exdate(self, exdate: datetime.datetime) -> None: ... class _rrulestr: @overload @@ -185,8 +188,8 @@ class _rrulestr: unfold: bool = False, compatible: bool = False, ignoretz: bool = False, - tzids=None, - tzinfos=None, + tzids: Callable[[str], datetime.tzinfo] | Mapping[str, datetime.tzinfo] | None = None, + tzinfos: _TzInfos | None = None, ) -> rruleset: ... @overload def __call__( @@ -199,8 +202,8 @@ class _rrulestr: unfold: bool = False, forceset: bool = False, ignoretz: bool = False, - tzids=None, - tzinfos=None, + tzids: Callable[[str], datetime.tzinfo] | Mapping[str, datetime.tzinfo] | None = None, + tzinfos: _TzInfos | None = None, ) -> rruleset: ... @overload def __call__( @@ -213,8 +216,8 @@ class _rrulestr: forceset: bool = False, compatible: bool = False, ignoretz: bool = False, - tzids=None, - tzinfos=None, + tzids: Callable[[str], datetime.tzinfo] | Mapping[str, datetime.tzinfo] | None = None, + tzinfos: _TzInfos | None = None, ) -> rrule | rruleset: ... rrulestr: _rrulestr diff --git a/python/helpers/typeshed/stubs/python-dateutil/dateutil/tz/_common.pyi b/python/helpers/typeshed/stubs/python-dateutil/dateutil/tz/_common.pyi index 7e9b8957c34b..23bce452e8bb 100644 --- a/python/helpers/typeshed/stubs/python-dateutil/dateutil/tz/_common.pyi +++ b/python/helpers/typeshed/stubs/python-dateutil/dateutil/tz/_common.pyi @@ -1,12 +1,17 @@ import abc +from collections.abc import Callable from datetime import datetime, timedelta, tzinfo -from typing import ClassVar +from typing import ClassVar, TypeVar +from typing_extensions import ParamSpec ZERO: timedelta __all__ = ["tzname_in_python2", "enfold"] -def tzname_in_python2(namefunc): ... +_P = ParamSpec("_P") +_R = TypeVar("_R") + +def tzname_in_python2(namefunc: Callable[_P, _R]) -> Callable[_P, _R]: ... def enfold(dt: datetime, fold: int = 1): ... # Doesn't actually have ABCMeta as the metaclass at runtime, @@ -24,5 +29,5 @@ class tzrangebase(_tzinfo): def fromutc(self, dt: datetime) -> datetime: ... def is_ambiguous(self, dt: datetime) -> bool: ... __hash__: ClassVar[None] # type: ignore[assignment] - def __ne__(self, other): ... + def __ne__(self, other: object) -> bool: ... __reduce__ = object.__reduce__ diff --git a/python/helpers/typeshed/stubs/python-dateutil/dateutil/tz/tz.pyi b/python/helpers/typeshed/stubs/python-dateutil/dateutil/tz/tz.pyi index 475ace6a4bd7..0fad227656a0 100644 --- a/python/helpers/typeshed/stubs/python-dateutil/dateutil/tz/tz.pyi +++ b/python/helpers/typeshed/stubs/python-dateutil/dateutil/tz/tz.pyi @@ -1,6 +1,8 @@ import sys +from _typeshed import Unused from datetime import datetime, timedelta, tzinfo -from typing import ClassVar, Literal, Protocol, TypeVar, type_check_only +from typing import Any, ClassVar, Literal, Protocol, TypeVar, type_check_only +from typing_extensions import Self from ..relativedelta import relativedelta from ._common import _tzinfo, enfold as enfold, tzrangebase @@ -23,26 +25,26 @@ class tzutc(tzinfo): def tzname(self, dt: datetime | None) -> str: ... def is_ambiguous(self, dt: datetime | None) -> bool: ... def fromutc(self, dt: _DT) -> _DT: ... - def __eq__(self, other): ... + def __eq__(self, other: object) -> bool: ... __hash__: ClassVar[None] # type: ignore[assignment] - def __ne__(self, other): ... + def __ne__(self, other: object) -> bool: ... __reduce__ = object.__reduce__ UTC: tzutc class tzoffset(tzinfo): - def __init__(self, name, offset) -> None: ... + def __init__(self, name: str | None, offset: float | timedelta) -> None: ... def utcoffset(self, dt: datetime | None) -> timedelta | None: ... 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 __eq__(self, other): ... + def __eq__(self, other: object) -> bool: ... __hash__: ClassVar[None] # type: ignore[assignment] - def __ne__(self, other): ... + def __ne__(self, other: object) -> bool: ... __reduce__ = object.__reduce__ @classmethod - def instance(cls, name, offset) -> tzoffset: ... + def instance(cls, name: str | None, offset: float | timedelta) -> tzoffset: ... class tzlocal(_tzinfo): def __init__(self) -> None: ... @@ -50,9 +52,9 @@ class tzlocal(_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 __eq__(self, other): ... + def __eq__(self, other: object) -> bool: ... __hash__: ClassVar[None] # type: ignore[assignment] - def __ne__(self, other): ... + def __ne__(self, other: object) -> bool: ... __reduce__ = object.__reduce__ class _ttinfo: @@ -65,9 +67,9 @@ class _ttinfo: isgmt: bool dstoffset: timedelta def __init__(self) -> None: ... - def __eq__(self, other): ... + def __eq__(self, other: object) -> bool: ... __hash__: ClassVar[None] # type: ignore[assignment] - def __ne__(self, other): ... + def __ne__(self, other: object) -> bool: ... @type_check_only class _TZFileReader(Protocol): @@ -82,11 +84,11 @@ class tzfile(_tzinfo): def utcoffset(self, dt: datetime | None) -> timedelta | None: ... def dst(self, dt: datetime | None) -> timedelta | None: ... def tzname(self, dt: datetime | None) -> str: ... - def __eq__(self, other): ... + def __eq__(self, other: object) -> bool: ... __hash__: ClassVar[None] # type: ignore[assignment] - def __ne__(self, other): ... - def __reduce__(self): ... - def __reduce_ex__(self, protocol): ... + def __ne__(self, other: object) -> bool: ... + def __reduce__(self) -> tuple[type[Self], tuple[None, str], dict[str, Any]]: ... + def __reduce_ex__(self, protocol: Unused) -> tuple[type[Self], tuple[None, str], dict[str, Any]]: ... class tzrange(tzrangebase): hasdst: bool @@ -100,13 +102,13 @@ class tzrange(tzrangebase): end: relativedelta | None = None, ) -> None: ... def transitions(self, year: int) -> tuple[datetime, datetime]: ... - def __eq__(self, other): ... + def __eq__(self, other: object) -> bool: ... class tzstr(tzrange): hasdst: bool def __init__(self, s: str, posix_offset: bool = False) -> None: ... @classmethod - def instance(cls, name, offset) -> tzoffset: ... + def instance(cls, name: str | None, offset: float | timedelta) -> tzoffset: ... @type_check_only class _ICalReader(Protocol): @@ -116,8 +118,8 @@ class _ICalReader(Protocol): class tzical: def __init__(self, fileobj: str | _ICalReader) -> None: ... - def keys(self): ... - def get(self, tzid=None): ... + def keys(self) -> list[str]: ... + def get(self, tzid: str | None = None) -> tzinfo | None: ... TZFILES: list[str] TZPATHS: list[str] diff --git a/python/helpers/typeshed/stubs/python-dateutil/dateutil/tz/win.pyi b/python/helpers/typeshed/stubs/python-dateutil/dateutil/tz/win.pyi index bae9c4e9956a..8d02d23acb01 100644 --- a/python/helpers/typeshed/stubs/python-dateutil/dateutil/tz/win.pyi +++ b/python/helpers/typeshed/stubs/python-dateutil/dateutil/tz/win.pyi @@ -1,5 +1,5 @@ import sys -from ctypes import _Pointer, c_wchar +from ctypes import _NameTypes, _Pointer, c_wchar from datetime import datetime, timedelta from typing import Any, ClassVar, Final @@ -18,9 +18,10 @@ if sys.platform == "win32": class tzres: p_wchar: ClassVar[type[_Pointer[c_wchar]]] - def __init__(self, tzres_loc="tzres.dll"): ... - def load_name(self, offset): ... - def name_from_string(self, tzname_str: str): ... + tzres_loc: _NameTypes + def __init__(self, tzres_loc: _NameTypes = "tzres.dll") -> None: ... + def load_name(self, offset: int) -> str: ... + def name_from_string(self, tzname_str: str) -> str: ... def picknthweekday(year: int, month: int, dayofweek: int, hour: int, minute: int, whichweek: int) -> datetime: ... def valuestodict(key: _KeyType) -> dict[str, Any]: ... # keys and values in dict are results of winreg.EnumValue() function diff --git a/python/helpers/typeshed/stubs/python-dateutil/dateutil/zoneinfo/__init__.pyi b/python/helpers/typeshed/stubs/python-dateutil/dateutil/zoneinfo/__init__.pyi index 3be08148bf08..65627ecdd773 100644 --- a/python/helpers/typeshed/stubs/python-dateutil/dateutil/zoneinfo/__init__.pyi +++ b/python/helpers/typeshed/stubs/python-dateutil/dateutil/zoneinfo/__init__.pyi @@ -16,7 +16,8 @@ ZONEFILENAME: Final[str] METADATA_FN: Final[str] class tzfile(_tzfile): - def __reduce__(self) -> tuple[Callable[[str], Self], tuple[str, ...]]: ... + # source code does this override, changing the type + def __reduce__(self) -> tuple[Callable[[str], Self], tuple[str]]: ... # type: ignore[override] def getzoneinfofile_stream() -> BytesIO | None: ... diff --git a/python/helpers/typeshed/stubs/python-dateutil/dateutil/zoneinfo/rebuild.pyi b/python/helpers/typeshed/stubs/python-dateutil/dateutil/zoneinfo/rebuild.pyi index 9aae2bdcba44..a8a8655b214d 100644 --- a/python/helpers/typeshed/stubs/python-dateutil/dateutil/zoneinfo/rebuild.pyi +++ b/python/helpers/typeshed/stubs/python-dateutil/dateutil/zoneinfo/rebuild.pyi @@ -1,4 +1,8 @@ from _typeshed import StrOrBytesPath from collections.abc import Iterable -def rebuild(filename: StrOrBytesPath, tag=None, format: str = "gz", zonegroups: Iterable[str] = [], metadata=None) -> None: ... +from ..zoneinfo import _MetadataType + +def rebuild( + filename: StrOrBytesPath, tag=None, format: str = "gz", zonegroups: Iterable[str] = [], metadata: _MetadataType | None = None +) -> None: ... diff --git a/python/helpers/typeshed/stubs/python-jenkins/jenkins/__init__.pyi b/python/helpers/typeshed/stubs/python-jenkins/jenkins/__init__.pyi index 4dd80855bd7f..a605ab5c0ee0 100644 --- a/python/helpers/typeshed/stubs/python-jenkins/jenkins/__init__.pyi +++ b/python/helpers/typeshed/stubs/python-jenkins/jenkins/__init__.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete from collections.abc import Mapping, MutableMapping, Sequence from re import Pattern -from typing import Any, Final, Literal, overload -from typing_extensions import TypeAlias, deprecated +from typing import Any, Final, Literal, TypedDict, overload, type_check_only +from typing_extensions import Required, TypeAlias, deprecated import requests from requests.models import Request, Response @@ -92,6 +92,15 @@ class WrappedSession(requests.Session): _JSONValue: TypeAlias = Any # too many possibilities to express _JSON: TypeAlias = dict[str, _JSONValue] +@type_check_only +class _Job(TypedDict, total=False): + _class: Required[str] + url: Required[str] + color: str + name: Required[str] + fullname: Required[str] + jobs: list[_Job] + class Jenkins: server: str auth: _Auth | None @@ -128,10 +137,8 @@ class Jenkins: def get_plugins_info(self, depth: int = 2) -> _JSON: ... def get_plugin_info(self, name: str, depth: int = 2) -> _JSON: ... def get_plugins(self, depth: int = 2) -> _JSON: ... - def get_jobs( - self, folder_depth: int = 0, folder_depth_per_request: int = 10, view_name: str | None = None - ) -> list[dict[str, str]]: ... - def get_all_jobs(self, folder_depth: int | None = None, folder_depth_per_request: int = 10) -> list[dict[str, str]]: ... + def get_jobs(self, folder_depth: int = 0, folder_depth_per_request: int = 10, view_name: str | None = None) -> list[_Job]: ... + def get_all_jobs(self, folder_depth: int | None = None, folder_depth_per_request: int = 10) -> list[_Job]: ... def copy_job(self, from_name: str, to_name: str) -> None: ... def rename_job(self, from_name: str, to_name: str) -> None: ... def delete_job(self, name: str) -> None: ... diff --git a/python/helpers/typeshed/stubs/pytz/pytz/lazy.pyi b/python/helpers/typeshed/stubs/pytz/pytz/lazy.pyi index 00e43d79cd98..b0b5ca565aa2 100644 --- a/python/helpers/typeshed/stubs/pytz/pytz/lazy.pyi +++ b/python/helpers/typeshed/stubs/pytz/pytz/lazy.pyi @@ -13,8 +13,8 @@ class LazyDict(DictMixin[str, _VT]): class LazyList(list[_T]): # does not return `Self` type: - def __new__(cls, fill_iter=None) -> LazyList[_T]: ... + def __new__(cls, fill_iter: _T | None = None) -> LazyList[_T]: ... class LazySet(set[_T]): # does not return `Self` type: - def __new__(cls, fill_iter=None) -> LazySet[_T]: ... + def __new__(cls, fill_iter: _T | None = None) -> LazySet[_T]: ... diff --git a/python/helpers/typeshed/stubs/pyxdg/xdg/RecentFiles.pyi b/python/helpers/typeshed/stubs/pyxdg/xdg/RecentFiles.pyi index aab686b6fc56..742c9bdf6800 100644 --- a/python/helpers/typeshed/stubs/pyxdg/xdg/RecentFiles.pyi +++ b/python/helpers/typeshed/stubs/pyxdg/xdg/RecentFiles.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete, StrOrBytesPath, StrPath +from _typeshed import StrOrBytesPath, StrPath from collections.abc import Iterable class RecentFiles: @@ -8,11 +8,9 @@ class RecentFiles: def parse(self, filename: StrPath | None = None) -> None: ... def write(self, filename: StrOrBytesPath | None = None) -> None: ... def getFiles( - self, mimetypes: Iterable[str] | None = None, groups: Iterable[Incomplete] | None = None, limit: int = 0 - ) -> list[StrPath]: ... - def addFile( - self, item: StrPath, mimetype: str, groups: Iterable[Incomplete] | None = None, private: bool = False - ) -> None: ... + self, mimetypes: Iterable[str] | None = None, groups: Iterable[str] | None = None, limit: int = 0 + ) -> list[RecentFile]: ... + def addFile(self, item: StrPath, mimetype: str, groups: Iterable[str] | None = None, private: bool = False) -> None: ... def deleteFile(self, item: RecentFile | StrPath) -> None: ... def sort(self) -> None: ... @@ -21,7 +19,7 @@ class RecentFile: MimeType: str Timestamp: str Private: bool - Groups: list[Incomplete] + Groups: list[str] def __init__(self) -> None: ... def __cmp__(self, other: RecentFile) -> int: ... def __lt__(self, other: RecentFile) -> bool: ... diff --git a/python/helpers/typeshed/stubs/qrbill/METADATA.toml b/python/helpers/typeshed/stubs/qrbill/METADATA.toml index b46abf95c7db..033646f39631 100644 --- a/python/helpers/typeshed/stubs/qrbill/METADATA.toml +++ b/python/helpers/typeshed/stubs/qrbill/METADATA.toml @@ -1,3 +1,3 @@ -version = "1.1.*" +version = "1.2.*" upstream_repository = "https://github.com/claudep/swiss-qr-bill" requires = ["types-qrcode"] diff --git a/python/helpers/typeshed/stubs/qrbill/qrbill/bill.pyi b/python/helpers/typeshed/stubs/qrbill/qrbill/bill.pyi index 651963333d23..001175230974 100644 --- a/python/helpers/typeshed/stubs/qrbill/qrbill/bill.pyi +++ b/python/helpers/typeshed/stubs/qrbill/qrbill/bill.pyi @@ -94,7 +94,14 @@ class QRBill: creditor: CombinedAddress | StructuredAddress final_creditor: CombinedAddress | StructuredAddress | None debtor: CombinedAddress | StructuredAddress | None + ref_type: str reference_number: str | None + account: str + account_is_qriban: bool + amount: str | None + currency: Literal["CHF", "EUR"] + additional_information: str + billing_information: str @overload def __init__( self, @@ -108,6 +115,7 @@ class QRBill: reference_number: str | None = None, extra_infos: Literal[""] = "", additional_information: str = "", + billing_information: str = "", alt_procs: list[str] | tuple[()] | tuple[str] | tuple[str, str] = (), language: Literal["en", "de", "fr", "it"] = "en", top_line: bool = True, @@ -129,6 +137,7 @@ class QRBill: reference_number: None = None, extra_infos: str = "", additional_information: str = "", + billing_information: str = "", alt_procs: list[str] | tuple[()] | tuple[str] | tuple[str, str] = (), language: Literal["en", "de", "fr", "it"] = "en", top_line: bool = True, @@ -150,6 +159,7 @@ class QRBill: *, extra_infos: str, additional_information: str = "", + billing_information: str = "", alt_procs: list[str] | tuple[()] | tuple[str] | tuple[str, str] = (), language: Literal["en", "de", "fr", "it"] = "en", top_line: bool = True, diff --git a/python/helpers/typeshed/stubs/regex/METADATA.toml b/python/helpers/typeshed/stubs/regex/METADATA.toml index eac4fb944388..d21d2b7423ef 100644 --- a/python/helpers/typeshed/stubs/regex/METADATA.toml +++ b/python/helpers/typeshed/stubs/regex/METADATA.toml @@ -1,2 +1,2 @@ -version = "2025.10.23" +version = "2025.11.3" upstream_repository = "https://github.com/mrabarnett/mrab-regex" diff --git a/python/helpers/typeshed/stubs/reportlab/METADATA.toml b/python/helpers/typeshed/stubs/reportlab/METADATA.toml index e4f6253d99e5..2b4ec1515c40 100644 --- a/python/helpers/typeshed/stubs/reportlab/METADATA.toml +++ b/python/helpers/typeshed/stubs/reportlab/METADATA.toml @@ -1,4 +1,4 @@ -version = "4.4.4" +version = "4.4.5" # GitHub mirror of https://hg.reportlab.com/hg-public/reportlab/file upstream_repository = "https://github.com/MrBitBucket/reportlab-mirror" diff --git a/python/helpers/typeshed/stubs/reportlab/reportlab/lib/testutils.pyi b/python/helpers/typeshed/stubs/reportlab/reportlab/lib/testutils.pyi index 0dd2fa224150..7a55147e3739 100644 --- a/python/helpers/typeshed/stubs/reportlab/reportlab/lib/testutils.pyi +++ b/python/helpers/typeshed/stubs/reportlab/reportlab/lib/testutils.pyi @@ -1,40 +1,42 @@ +import re import unittest -from _typeshed import Incomplete -from configparser import ConfigParser +from _typeshed import Incomplete, StrPath, Unused +from configparser import ConfigParser, _SectionName +from types import ModuleType from typing import Final, Literal __version__: Final[str] -def haveRenderPM(): ... -def isWritable(D): ... +def invariantSeed(n: float | str | bytes | bytearray | None) -> None: ... +def haveRenderPM() -> ModuleType | Literal[False]: ... -RL_HOME: Incomplete -testsFolder: Incomplete - -DEJAVUSANS: tuple[ - Literal["DejaVuSans"], Literal["DejaVuSans-Bold"], Literal["DejaVuSans-Oblique"], Literal["DejaVuSans-BoldOblique"] -] = ... +DEJAVUSANS: Final = ("DejaVuSans", "DejaVuSans-Bold", "DejaVuSans-Oblique", "DejaVuSans-BoldOblique") def haveDejaVu() -> bool: ... -def setOutDir(name): ... -def mockUrlRead(name): ... -def outputfile(fn): ... +def isWritable(D: Unused) -> Literal[0, 1]: ... + +RL_HOME: str | None +testsFolder: str | None + +def setOutDir(name: str) -> str: ... +def mockUrlRead(name: str): ... +def outputfile(fn: StrPath | None) -> str: ... def printLocation(depth: int = 1) -> None: ... -def makeSuiteForClasses(*classes, testMethodPrefix=None): ... -def getCVSEntries(folder, files: int = 1, folders: int = 0): ... +def makeSuiteForClasses(*classes: type[unittest.TestCase], testMethodPrefix: str | None = None) -> unittest.TestSuite: ... +def getCVSEntries(folder: StrPath, files: bool | Literal[1, 0] = 1, folders: bool | Literal[1, 0] = 0) -> list[str]: ... class ExtConfigParser(ConfigParser): - pat: Incomplete - def getstringlist(self, section, option): ... + pat: re.Pattern[str] + def getstringlist(self, section: _SectionName, option: str): ... class GlobDirectoryWalker: index: int - pattern: Incomplete - stack: Incomplete - files: Incomplete - directory: Incomplete - def __init__(self, directory, pattern: str = "*") -> None: ... - def __getitem__(self, index): ... + pattern: str + stack: list[str] + files: list[str] + directory: str + def __init__(self, directory: str, pattern: str = "*") -> None: ... + def __getitem__(self, index) -> str | None: ... def filterFiles(self, folder, files): ... class RestrictedGlobDirectoryWalker(GlobDirectoryWalker): @@ -64,9 +66,9 @@ class ScriptThatMakesFileTest(unittest.TestCase): def tearDown(self) -> None: ... def runTest(self) -> None: ... -def equalStrings(a, b, enc: str = "utf8"): ... +def equalStrings(a: str | bytes, b: str | bytes, enc: str = "utf8") -> bool: ... def eqCheck(r, x) -> None: ... -def rlextraNeeded(): ... +def rlextraNeeded() -> bool: ... def rlSkipIf(cond, reason, __module__=None): ... def rlSkipUnless(cond, reason, __module__=None): ... def rlSkip(reason, __module__=None): ... diff --git a/python/helpers/typeshed/stubs/reportlab/reportlab/platypus/flowables.pyi b/python/helpers/typeshed/stubs/reportlab/reportlab/platypus/flowables.pyi index 76dc086703ff..da28237e3850 100644 --- a/python/helpers/typeshed/stubs/reportlab/reportlab/platypus/flowables.pyi +++ b/python/helpers/typeshed/stubs/reportlab/reportlab/platypus/flowables.pyi @@ -411,7 +411,7 @@ class ListItem: # TODO: Use Unpack for kwds with the ListStyle properties + value/spaceBefore/spaceAfter def __init__(self, flowables: _FlowableSublist, style: PropertySet | None = None, **kwds) -> None: ... -class ListFlowable(_Container, Flowable): +class ListFlowable(_Container, Flowable, _FindSplitterMixin): style: ListStyle # NOTE: style has to be a ListStyle, but this will be annoying with sheet["ul"] # TODO: Use Unpack for kwds with the ListStyle properties + spaceBefore/spaceAfter diff --git a/python/helpers/typeshed/stubs/simple-websocket/METADATA.toml b/python/helpers/typeshed/stubs/simple-websocket/METADATA.toml new file mode 100644 index 000000000000..9b307e6bda7c --- /dev/null +++ b/python/helpers/typeshed/stubs/simple-websocket/METADATA.toml @@ -0,0 +1,3 @@ +version = "1.1.*" +upstream_repository = "https://github.com/miguelgrinberg/simple-websocket" +requires = ["wsproto"] diff --git a/python/helpers/typeshed/stubs/simple-websocket/simple_websocket/__init__.pyi b/python/helpers/typeshed/stubs/simple-websocket/simple_websocket/__init__.pyi new file mode 100644 index 000000000000..d3da863383ca --- /dev/null +++ b/python/helpers/typeshed/stubs/simple-websocket/simple_websocket/__init__.pyi @@ -0,0 +1,3 @@ +from .aiows import AioClient as AioClient, AioServer as AioServer +from .errors import ConnectionClosed as ConnectionClosed, ConnectionError as ConnectionError +from .ws import Client as Client, Server as Server diff --git a/python/helpers/typeshed/stubs/simple-websocket/simple_websocket/aiows.pyi b/python/helpers/typeshed/stubs/simple-websocket/simple_websocket/aiows.pyi new file mode 100644 index 000000000000..066a243cb78e --- /dev/null +++ b/python/helpers/typeshed/stubs/simple-websocket/simple_websocket/aiows.pyi @@ -0,0 +1,130 @@ +import asyncio +import socket +from _typeshed import Incomplete, Unused +from _typeshed.wsgi import WSGIEnvironment +from collections.abc import Awaitable, Callable +from ssl import SSLContext +from typing import Any, Literal, TypedDict, type_check_only + +from wsproto import ConnectionType, WSConnection +from wsproto.events import Request +from wsproto.frame_protocol import CloseReason + +from .asgi import WebSocketASGI, _SocketDataBase, _SocketDataBytes, _SocketDataProtocol, _SocketDataStr + +class AioBase: + subprotocol: str | None + connection_type: ConnectionType + receive_bytes: int + ping_interval: float | None + max_message_size: int | None + pong_received: bool + input_buffer: list[bytes | str] + incoming_message: bytes | str | None + incoming_message_len: int + connected: bool + is_server: bool + close_reason: CloseReason + close_message: str + rsock: asyncio.StreamReader + wsock: asyncio.StreamWriter + event: asyncio.Event + ws: WSConnection | None + task: asyncio.Task[None] + def __init__( + self, + connection_type: ConnectionType | None = None, + receive_bytes: int = 4096, + ping_interval: float | None = None, + max_message_size: int | None = None, + ) -> None: ... + async def connect(self) -> None: ... + async def handshake(self) -> None: ... + # data can be antyhing. a special case is made for `bytes`, anything else is converted to `str`. + async def send(self, data: bytes | Any) -> None: ... + async def receive(self, timeout: float | None = None) -> bytes | str | None: ... + async def close(self, reason: CloseReason | None = None, message: str | None = None) -> None: ... + def choose_subprotocol(self, request: Request) -> str | None: ... + +@type_check_only +class _AioServerRequest(TypedDict): + # this is `aiohttp.web.Request` + aiohttp: Incomplete + sock: None + headers: None + +class AioServer(AioBase): + request: _AioServerRequest + headers: dict[str, Any] + subprotocols: list[str] + is_server: Literal[True] + mode: str + connected: bool + def __init__( + self, + request: _AioServerRequest, + subprotocols: list[str] | None = None, + receive_bytes: int = 4096, + ping_interval: float | None = None, + max_message_size: int | None = None, + ) -> None: ... + @classmethod + async def accept( + cls, + # this is `aiohttp.web.Request` + aiohttp=None, + asgi: ( + tuple[ + WSGIEnvironment, + Callable[[], Awaitable[_SocketDataBytes | _SocketDataStr]], + Callable[[_SocketDataBase | _SocketDataProtocol | _SocketDataBytes | _SocketDataStr], Awaitable[None]], + ] + | None + ) = None, + sock: socket.socket | None = None, + headers: dict[str, Any] | None = None, + subprotocols: list[str] | None = None, + receive_bytes: int = 4096, + ping_interval: float | None = None, + max_message_size: int | None = None, + ) -> WebSocketASGI | AioServer: ... + async def handshake(self) -> None: ... + def choose_subprotocol(self, request: Request) -> str | None: ... + +class AioClient(AioBase): + url: str + ssl_context: SSLContext | None + is_secure: bool + host: str + port: int + path: str + subprotocols: list[str] + extra_headeers: list[tuple[bytes, bytes]] + subprotocol: str | None + connected: bool + def __init__( + self, + url: str, + subprotocols: list[str] | None = None, + headers: dict[str, Any] | None = None, + receive_bytes: int = 4096, + ping_interval: float | None = None, + max_message_size: int | None = None, + ssl_context: SSLContext | None = None, + ) -> None: ... + # the source code itself has this override + @classmethod + async def connect( # type: ignore[override] + cls, + url: str, + subprotocols: list[str] | None = None, + headers: dict[str, Any] | None = None, + receive_bytes: int = 4096, + ping_interval: float | None = None, + max_message_size: int | None = None, + ssl_context: SSLContext | None = None, + thread_class: Unused = None, + event_class: Unused = None, + ) -> AioClient: ... + async def handshake(self) -> None: ... + async def close(self, reason: CloseReason | None = None, message: str | None = None) -> None: ... diff --git a/python/helpers/typeshed/stubs/simple-websocket/simple_websocket/asgi.pyi b/python/helpers/typeshed/stubs/simple-websocket/simple_websocket/asgi.pyi new file mode 100644 index 000000000000..92e802188c5e --- /dev/null +++ b/python/helpers/typeshed/stubs/simple-websocket/simple_websocket/asgi.pyi @@ -0,0 +1,44 @@ +from _typeshed.wsgi import WSGIEnvironment +from collections.abc import Awaitable, Callable +from typing import TypedDict, type_check_only + +@type_check_only +class _SocketDataBase(TypedDict): + type: str + +@type_check_only +class _SocketDataProtocol(_SocketDataBase): + subprotocol: str | None + +@type_check_only +class _SocketDataStr(_SocketDataBase): + text: str + +@type_check_only +class _SocketDataBytes(_SocketDataBase): + bytes: bytes + +class WebSocketASGI: + subprotocols: list[str] + subprotocol: str + connected: bool + # this is set in `close` to `False` + conncted: bool + def __init__( + self, + scope: WSGIEnvironment, + receive: Callable[[], Awaitable[_SocketDataBytes | _SocketDataStr]], + send: Callable[[_SocketDataBase | _SocketDataProtocol | _SocketDataBytes | _SocketDataStr], Awaitable[None]], + subprotocols: list[str] | None = None, + ) -> None: ... + @classmethod + async def accept( + cls, + scope: WSGIEnvironment, + receive: Callable[[], Awaitable[_SocketDataBytes | _SocketDataStr]], + send: Callable[[_SocketDataBase | _SocketDataProtocol | _SocketDataBytes | _SocketDataStr], Awaitable[None]], + subprotocols: list[str] | None = None, + ) -> WebSocketASGI: ... + async def receive(self) -> bytes | str: ... + async def send(self, data: bytes | str) -> None: ... + async def close(self) -> None: ... diff --git a/python/helpers/typeshed/stubs/simple-websocket/simple_websocket/errors.pyi b/python/helpers/typeshed/stubs/simple-websocket/simple_websocket/errors.pyi new file mode 100644 index 000000000000..88e25065121e --- /dev/null +++ b/python/helpers/typeshed/stubs/simple-websocket/simple_websocket/errors.pyi @@ -0,0 +1,12 @@ +from wsproto.frame_protocol import CloseReason + +class SimpleWebsocketError(RuntimeError): ... + +class ConnectionError(SimpleWebsocketError): + status_code: int | None + def __init__(self, status_code: int | None = None) -> None: ... + +class ConnectionClosed(SimpleWebsocketError): + reason: CloseReason + message: str | None + def __init__(self, reason: CloseReason = ..., message: str | None = None) -> None: ... diff --git a/python/helpers/typeshed/stubs/simple-websocket/simple_websocket/ws.pyi b/python/helpers/typeshed/stubs/simple-websocket/simple_websocket/ws.pyi new file mode 100644 index 000000000000..d469cd38d672 --- /dev/null +++ b/python/helpers/typeshed/stubs/simple-websocket/simple_websocket/ws.pyi @@ -0,0 +1,136 @@ +import socket +import threading +from _typeshed import FileDescriptorLike +from _typeshed.wsgi import WSGIEnvironment +from collections.abc import Callable +from selectors import SelectorKey, _EventMask +from ssl import SSLContext +from typing import Any, Protocol, type_check_only + +from wsproto import ConnectionType, WSConnection +from wsproto.events import Request +from wsproto.frame_protocol import CloseReason + +@type_check_only +class _ThreadClassProtocol(Protocol): + name: str + # this accepts any callable as the target, like `threading.Thread` + def __init__(self, target: Callable[..., Any]) -> None: ... + def start(self) -> None: ... + +@type_check_only +class _EventClassProtocol(Protocol): + def clear(self) -> None: ... + def set(self) -> None: ... + def wait(self, timeout: float | None = None) -> bool: ... + +@type_check_only +class _SelectorClassProtocol(Protocol): + # the signature of `register` here is the same as `selectors._BaseSelectorImpl` from the stdlib + def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = None) -> SelectorKey: ... + # the signature of `select` here is the same as `selectors.DefaultSelector` from the stdlib + def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, _EventMask]]: ... + def close(self) -> None: ... + +class Base: + subprotocol: str | None + sock: socket.socket | None + receive_bytes: int + ping_interval: float | None + max_message_size: int | None + pong_received: bool + input_buffer: list[bytes | str] + incoming_message: bytes | str | None + incoming_message_len: int + connected: bool + is_server: bool + close_reason: CloseReason + close_message: str | None + selector_class: type[_SelectorClassProtocol] + event: _EventClassProtocol | threading.Event + ws: WSConnection + thread: _ThreadClassProtocol | threading.Thread + def __init__( + self, + sock: socket.socket | None = None, + connection_type: ConnectionType | None = None, + receive_bytes: int = 4096, + ping_interval: float | None = None, + max_message_size: int | None = None, + thread_class: type[_ThreadClassProtocol] | None = None, + event_class: type[_EventClassProtocol] | None = None, + selector_class: type[_SelectorClassProtocol] | None = None, + ) -> None: ... + def handshake(self) -> None: ... + # data can be antyhing. a special case is made for `bytes`, anything else is converted to `str`. + def send(self, data: bytes | Any) -> None: ... + def receive(self, timeout: float | None = None) -> bytes | str | None: ... + def close(self, reason: CloseReason | None = None, message: str | None = None) -> None: ... + def choose_subprotocol(self, request: Request) -> str | None: ... + +class Server(Base): + environ: WSGIEnvironment + subprotocols: list[str] + mode: str + connected: bool + def __init__( + self, + environ: WSGIEnvironment, + subprotocols: list[str] | None = None, + receive_bytes: int = 4096, + ping_interval: float | None = None, + max_message_size: int | None = None, + thread_class: type[_ThreadClassProtocol] | None = None, + event_class: type[_EventClassProtocol] | None = None, + selector_class: type[_SelectorClassProtocol] | None = None, + ) -> None: ... + @classmethod + def accept( + cls, + environ: WSGIEnvironment, + subprotocols: list[str] | None = None, + receive_bytes: int = 4096, + ping_interval: float | None = None, + max_message_size: int | None = None, + thread_class: type[_ThreadClassProtocol] | None = None, + event_class: type[_EventClassProtocol] | None = None, + selector_class: type[_SelectorClassProtocol] | None = None, + ) -> Server: ... + def handshake(self) -> None: ... + def choose_subprotocol(self, request: Request) -> str | None: ... + +class Client(Base): + host: str + port: int + path: str + subprotocols: list[str] + extra_headeers: list[tuple[bytes, bytes]] + subprotocol: str | None + connected: bool + def __init__( + self, + url: str, + subprotocols: list[str] | None = None, + headers: dict[bytes, bytes] | list[tuple[bytes, bytes]] | None = None, + receive_bytes: int = 4096, + ping_interval: float | None = None, + max_message_size: int | None = None, + ssl_context: SSLContext | None = None, + thread_class: type[_ThreadClassProtocol] | None = None, + event_class: type[_EventClassProtocol] | None = None, + ) -> None: ... + @classmethod + def connect( + cls, + url: str, + subprotocols: list[str] | None = None, + headers: dict[bytes, bytes] | list[tuple[bytes, bytes]] | None = None, + receive_bytes: int = 4096, + ping_interval: float | None = None, + max_message_size: int | None = None, + ssl_context: SSLContext | None = None, + thread_class: type[_ThreadClassProtocol] | None = None, + event_class: type[_EventClassProtocol] | None = None, + ) -> Client: ... + def handshake(self) -> None: ... + def close(self, reason: CloseReason | None = None, message: str | None = None) -> None: ... diff --git a/python/helpers/typeshed/stubs/ttkthemes/@tests/stubtest_allowlist.txt b/python/helpers/typeshed/stubs/ttkthemes/@tests/stubtest_allowlist.txt new file mode 100644 index 000000000000..a949ae94ce36 --- /dev/null +++ b/python/helpers/typeshed/stubs/ttkthemes/@tests/stubtest_allowlist.txt @@ -0,0 +1,5 @@ +# Inconsistency because some params being between *args and **kwargs: +ttkthemes.ThemedStyle.__init__ +ttkthemes.ThemedTk.__init__ +ttkthemes.themed_style.ThemedStyle.__init__ +ttkthemes.themed_tk.ThemedTk.__init__ diff --git a/python/helpers/typeshed/stubs/ttkthemes/METADATA.toml b/python/helpers/typeshed/stubs/ttkthemes/METADATA.toml index edbe27fbbedb..7204a09bf9c6 100644 --- a/python/helpers/typeshed/stubs/ttkthemes/METADATA.toml +++ b/python/helpers/typeshed/stubs/ttkthemes/METADATA.toml @@ -1,2 +1,2 @@ -version = "3.2.*" +version = "3.3.*" upstream_repository = "https://github.com/RedFantom/ttkthemes" diff --git a/python/helpers/typeshed/stubs/ttkthemes/ttkthemes/themed_style.pyi b/python/helpers/typeshed/stubs/ttkthemes/ttkthemes/themed_style.pyi index 5821b620b155..546ce5fd31cf 100644 --- a/python/helpers/typeshed/stubs/ttkthemes/ttkthemes/themed_style.pyi +++ b/python/helpers/typeshed/stubs/ttkthemes/ttkthemes/themed_style.pyi @@ -5,7 +5,7 @@ from ._widget import ThemedWidget class ThemedStyle(ttk.Style, ThemedWidget): def __init__( - self, master: tkinter.Misc | None = ..., *, theme: str | None = None, gif_override: bool | None = False + self, master: tkinter.Misc | None = None, theme: str | None = None, gif_override: bool | None = False ) -> None: ... # theme_use() can't return None (differs from ttk.Style) def theme_use(self, theme_name: str | None = None) -> str: ... # type: ignore[override] diff --git a/python/helpers/typeshed/stubs/ttkthemes/ttkthemes/themed_tk.pyi b/python/helpers/typeshed/stubs/ttkthemes/ttkthemes/themed_tk.pyi index 3d749ebbee37..77f34b04ad00 100644 --- a/python/helpers/typeshed/stubs/ttkthemes/ttkthemes/themed_tk.pyi +++ b/python/helpers/typeshed/stubs/ttkthemes/ttkthemes/themed_tk.pyi @@ -8,19 +8,18 @@ class ThemedTk(tkinter.Tk, ThemedWidget): def __init__( self, # non-keyword-only args copied from tkinter.Tk - screenName: str | None = ..., - baseName: str | None = ..., - className: str = ..., - useTk: bool = ..., - sync: bool = ..., - use: str | None = ..., - *, - theme: str | None = ..., + screenName: str | None = None, + baseName: str | None = None, + className: str = "Tk", + useTk: bool = True, + sync: bool = False, + use: str | None = None, + theme: str | None = None, # fonts argument does nothing - toplevel: bool | None = ..., - themebg: bool | None = ..., - background: bool | None = ..., # old alias for themebg - gif_override: bool = ..., + toplevel: bool | None = None, + themebg: bool | None = None, + background: bool | None = None, # old alias for themebg + gif_override: bool = False, ) -> None: ... def set_theme(self, theme_name: str, toplevel: bool | None = None, themebg: bool | None = None) -> None: ... # Keep this in sync with tkinter.Tk diff --git a/python/helpers/typeshed/stubs/tzdata/@tests/stubtest_allowlist.txt b/python/helpers/typeshed/stubs/tzdata/@tests/stubtest_allowlist.txt new file mode 100644 index 000000000000..951a35b5d0c6 --- /dev/null +++ b/python/helpers/typeshed/stubs/tzdata/@tests/stubtest_allowlist.txt @@ -0,0 +1,2 @@ +# These are data-only timezone info files. +tzdata\.zoneinfo.* diff --git a/python/helpers/typeshed/stubs/tzdata/METADATA.toml b/python/helpers/typeshed/stubs/tzdata/METADATA.toml new file mode 100644 index 000000000000..5ae141af9f30 --- /dev/null +++ b/python/helpers/typeshed/stubs/tzdata/METADATA.toml @@ -0,0 +1,2 @@ +version = "2025.*" +upstream_repository = "https://github.com/python/tzdata" diff --git a/python/helpers/typeshed/stubs/tzdata/tzdata/__init__.pyi b/python/helpers/typeshed/stubs/tzdata/tzdata/__init__.pyi new file mode 100644 index 000000000000..ec4ebbadfe0d --- /dev/null +++ b/python/helpers/typeshed/stubs/tzdata/tzdata/__init__.pyi @@ -0,0 +1,4 @@ +from typing import Final + +__version__: Final[str] +IANA_VERSION: Final[str] diff --git a/python/helpers/typeshed/stubs/webencodings/@tests/stubtest_allowlist.txt b/python/helpers/typeshed/stubs/webencodings/@tests/stubtest_allowlist.txt new file mode 100644 index 000000000000..a7af9d8760da --- /dev/null +++ b/python/helpers/typeshed/stubs/webencodings/@tests/stubtest_allowlist.txt @@ -0,0 +1,2 @@ +# Tests should not be part of the stubs +webencodings.tests diff --git a/python/helpers/typeshed/stubs/webencodings/METADATA.toml b/python/helpers/typeshed/stubs/webencodings/METADATA.toml new file mode 100644 index 000000000000..faf76668a57c --- /dev/null +++ b/python/helpers/typeshed/stubs/webencodings/METADATA.toml @@ -0,0 +1,2 @@ +version = "0.5.*" +upstream_repository = "https://github.com/gsnedders/python-webencodings" diff --git a/python/helpers/typeshed/stubs/webencodings/webencodings/__init__.pyi b/python/helpers/typeshed/stubs/webencodings/webencodings/__init__.pyi new file mode 100644 index 000000000000..c9f078493786 --- /dev/null +++ b/python/helpers/typeshed/stubs/webencodings/webencodings/__init__.pyi @@ -0,0 +1,33 @@ +import codecs +from collections.abc import Iterable, Iterator +from typing import Final + +VERSION: Final[str] +PYTHON_NAMES: Final[dict[str, str]] +CACHE: dict[str, Encoding] + +def ascii_lower(string: str) -> str: ... +def lookup(label: str) -> Encoding | None: ... + +class Encoding: + name: str + codec_info: codecs.CodecInfo + def __init__(self, name: str, codec_info: codecs.CodecInfo) -> None: ... + +UTF8: Final[Encoding] + +def decode(input: bytes | bytearray, fallback_encoding: str | Encoding, errors: str = "replace") -> tuple[str, Encoding]: ... +def encode(input: str, encoding: str | Encoding = ..., errors: str = "strict") -> bytes: ... +def iter_decode( + input: Iterable[bytes | bytearray], fallback_encoding: str | Encoding, errors: str = "replace" +) -> tuple[Iterator[Encoding | str], Encoding]: ... +def iter_encode(input: Iterable[str], encoding: str | Encoding = ..., errors: str = "strict") -> Iterator[bytes]: ... + +class IncrementalDecoder: + encoding: Encoding | None + def __init__(self, fallback_encoding: str | Encoding, errors: str = "replace") -> None: ... + def decode(self, input: bytes | bytearray, final: bool = False) -> str: ... + +class IncrementalEncoder: + encode: bytes + def __init__(self, encoding: str | Encoding = ..., errors: str = "strict") -> None: ... diff --git a/python/helpers/typeshed/stubs/webencodings/webencodings/labels.pyi b/python/helpers/typeshed/stubs/webencodings/webencodings/labels.pyi new file mode 100644 index 000000000000..01deda966843 --- /dev/null +++ b/python/helpers/typeshed/stubs/webencodings/webencodings/labels.pyi @@ -0,0 +1,3 @@ +from typing import Final + +LABELS: Final[dict[str, str]] diff --git a/python/helpers/typeshed/stubs/webencodings/webencodings/mklabels.pyi b/python/helpers/typeshed/stubs/webencodings/webencodings/mklabels.pyi new file mode 100644 index 000000000000..839692415fbd --- /dev/null +++ b/python/helpers/typeshed/stubs/webencodings/webencodings/mklabels.pyi @@ -0,0 +1,5 @@ +from typing import AnyStr +from urllib.request import Request + +def assert_lower(string: AnyStr) -> AnyStr: ... +def generate(url: str | Request) -> str: ... diff --git a/python/helpers/typeshed/stubs/webencodings/webencodings/x_user_defined.pyi b/python/helpers/typeshed/stubs/webencodings/webencodings/x_user_defined.pyi new file mode 100644 index 000000000000..bb67491c8606 --- /dev/null +++ b/python/helpers/typeshed/stubs/webencodings/webencodings/x_user_defined.pyi @@ -0,0 +1,21 @@ +import codecs +from _codecs import _CharMap +from _typeshed import ReadableBuffer +from typing import Final + +class Codec(codecs.Codec): + def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... + def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... + +class IncrementalEncoder(codecs.IncrementalEncoder): + def encode(self, input: str, final: bool = False) -> bytes: ... + +class IncrementalDecoder(codecs.IncrementalDecoder): + def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... + +class StreamWriter(Codec, codecs.StreamWriter): ... +class StreamReader(Codec, codecs.StreamReader): ... + +codec_info: Final[codecs.CodecInfo] +decoding_table: Final[str] +encoding_table: Final[_CharMap] diff --git a/python/helpers/typeshed/stubs/yt-dlp/@tests/stubtest_allowlist.txt b/python/helpers/typeshed/stubs/yt-dlp/@tests/stubtest_allowlist.txt index 293acf692899..bc3da9768778 100644 --- a/python/helpers/typeshed/stubs/yt-dlp/@tests/stubtest_allowlist.txt +++ b/python/helpers/typeshed/stubs/yt-dlp/@tests/stubtest_allowlist.txt @@ -26,3 +26,5 @@ yt_dlp.utils.(_utils.)?prepend_extension yt_dlp.utils.(_utils.)?replace_extension # Unsure why this is here. yt_dlp.utils.jslib.devalue.TYPE_CHECKING +# internal API: +yt_dlp.utils._jsruntime.runtime_version_tuple diff --git a/python/helpers/typeshed/stubs/yt-dlp/METADATA.toml b/python/helpers/typeshed/stubs/yt-dlp/METADATA.toml index e2b16ea6bb0f..b96eae00d1ee 100644 --- a/python/helpers/typeshed/stubs/yt-dlp/METADATA.toml +++ b/python/helpers/typeshed/stubs/yt-dlp/METADATA.toml @@ -1,3 +1,3 @@ -version = "2025.9.26" +version = "2025.11.12" upstream_repository = "https://github.com/yt-dlp/yt-dlp" requires = ["websockets"] diff --git a/python/helpers/typeshed/stubs/yt-dlp/yt_dlp/__init__.pyi b/python/helpers/typeshed/stubs/yt-dlp/yt_dlp/__init__.pyi index e5dd1a12a4fc..f9bd170afd91 100644 --- a/python/helpers/typeshed/stubs/yt-dlp/yt_dlp/__init__.pyi +++ b/python/helpers/typeshed/stubs/yt-dlp/yt_dlp/__init__.pyi @@ -189,6 +189,8 @@ class _Params(TypedDict, total=False): default_search: str | None dynamic_mpd: bool | None extractor_args: Mapping[str, Mapping[str, Any]] | None + js_runtimes: dict[str, dict[str, str] | None] + remote_components: set[Literal["ejs:npm", "ejs:github"]] encoding: str | None extract_flat: bool | Literal["in_playlist", "discard", "discard_in_playlist"] | None live_from_start: bool | None diff --git a/python/helpers/typeshed/stubs/yt-dlp/yt_dlp/globals.pyi b/python/helpers/typeshed/stubs/yt-dlp/yt_dlp/globals.pyi index cb97371d901f..817c8a5f5e8b 100644 --- a/python/helpers/typeshed/stubs/yt-dlp/yt_dlp/globals.pyi +++ b/python/helpers/typeshed/stubs/yt-dlp/yt_dlp/globals.pyi @@ -1,5 +1,14 @@ from collections import defaultdict -from typing import Any, Generic, Literal, TypeVar +from typing import Any, Generic, Literal, TypedDict, TypeVar, type_check_only + +from yt_dlp.utils._jsruntime import BunJsRuntime, DenoJsRuntime, NodeJsRuntime, QuickJsRuntime + +@type_check_only +class _SupportedJSRuntimes(TypedDict): + deno: type[DenoJsRuntime] + node: type[NodeJsRuntime] + bun: type[BunJsRuntime] + quickjs: type[QuickJsRuntime] _T = TypeVar("_T") @@ -18,3 +27,5 @@ plugin_ies_overrides: Indirect[defaultdict[str, Any]] IN_CLI: Indirect[bool] LAZY_EXTRACTORS: Indirect[bool | None] WINDOWS_VT_MODE: Indirect[Literal[False] | None] # Code takes into account that only False here +supported_js_runtimes: Indirect[_SupportedJSRuntimes] +supported_remote_components: Indirect[list[Literal["ejs:github", "ejs:npm"]]] diff --git a/python/helpers/typeshed/stubs/yt-dlp/yt_dlp/utils/_jsruntime.pyi b/python/helpers/typeshed/stubs/yt-dlp/yt_dlp/utils/_jsruntime.pyi new file mode 100644 index 000000000000..3b66663a6e0b --- /dev/null +++ b/python/helpers/typeshed/stubs/yt-dlp/yt_dlp/utils/_jsruntime.pyi @@ -0,0 +1,38 @@ +import abc +from dataclasses import dataclass +from functools import cached_property +from typing import Final + +@dataclass(frozen=True) +class JsRuntimeInfo: + name: str + path: str + version: str + version_tuple: tuple[int, ...] + supported: bool = True + +class JsRuntime(abc.ABC): + def __init__(self, path: str | None = None) -> None: ... + @cached_property + @abc.abstractmethod + def info(self) -> JsRuntimeInfo | None: ... + +class DenoJsRuntime(JsRuntime): + MIN_SUPPORTED_VERSION: Final[tuple[int, int, int]] + @cached_property + def info(self) -> JsRuntimeInfo | None: ... + +class BunJsRuntime(JsRuntime): + MIN_SUPPORTED_VERSION: Final[tuple[int, int, int]] + @cached_property + def info(self) -> JsRuntimeInfo | None: ... + +class NodeJsRuntime(JsRuntime): + MIN_SUPPORTED_VERSION: Final[tuple[int, int, int]] + @cached_property + def info(self) -> JsRuntimeInfo | None: ... + +class QuickJsRuntime(JsRuntime): + MIN_SUPPORTED_VERSION: Final[tuple[int, int, int]] + @cached_property + def info(self) -> JsRuntimeInfo | None: ... diff --git a/python/helpers/typeshed/stubs/yt-dlp/yt_dlp/utils/_legacy.pyi b/python/helpers/typeshed/stubs/yt-dlp/yt_dlp/utils/_legacy.pyi index 838771c834a9..8f1891cc02e3 100644 --- a/python/helpers/typeshed/stubs/yt-dlp/yt_dlp/utils/_legacy.pyi +++ b/python/helpers/typeshed/stubs/yt-dlp/yt_dlp/utils/_legacy.pyi @@ -1,82 +1,16 @@ -import ssl -import types import urllib.request from _socket import _Address from _typeshed import ReadableBuffer, SupportsRead, Unused -from asyncio.events import AbstractEventLoop -from collections.abc import AsyncIterable, Awaitable, Callable, Collection, Iterable, Mapping, MutableMapping, Sequence +from collections.abc import Callable, Collection, Iterable, Mapping, MutableMapping from http.client import HTTPResponse from http.cookiejar import CookieJar -from socket import socket from subprocess import Popen -from typing import Any, AnyStr, Generic, Literal, TypeVar, overload -from typing_extensions import Self - -from websockets import ClientConnection, HeadersLike, LoggerLike, Origin, Subprotocol -from websockets.asyncio.client import connect -from websockets.extensions import ClientExtensionFactory +from typing import Any, AnyStr, TypeVar has_certifi: bool has_websockets: bool _T = TypeVar("_T") -class WebSocketsWrapper(Generic[_T]): - pool: _T | None - loop: AbstractEventLoop - conn: connect - def __init__( - self, - url: str, - headers: Mapping[str, str] | None = None, - connect: bool = True, - *, - # Passed to websockets.connect() - origin: Origin | None = None, - extensions: Sequence[ClientExtensionFactory] | None = None, - subprotocols: Sequence[Subprotocol] | None = None, - compression: str | None = "deflate", - additional_headers: HeadersLike | None = None, - user_agent_header: str | None = ..., - proxy: str | Literal[True] | None = True, - process_exception: Callable[[Exception], Exception | None] = ..., - open_timeout: float | None = 10, - ping_interval: float | None = 20, - ping_timeout: float | None = 20, - close_timeout: float | None = 10, - max_size: int | None = 1048576, - max_queue: int | None | tuple[int | None, int | None] = 16, - write_limit: int | tuple[int, int | None] = 32768, - logger: LoggerLike | None = None, - create_connection: type[ClientConnection] | None = None, - # Passed to AbstractEventLoop.connect() by websockets - ssl: bool | None | ssl.SSLContext = None, - family: int = 0, - proto: int = 0, - flags: int = 0, - sock: socket | None = None, - local_addr: None = None, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - happy_eyeballs_delay: float | None = None, - interleave: int | None = None, - ) -> None: ... - def __enter__(self) -> Self: ... - def send( - self, message: str | bytes | Iterable[str | bytes] | AsyncIterable[str | bytes], text: bool | None = None - ) -> None: ... - @overload - def recv(self, decode: Literal[True]) -> str: ... - @overload - def recv(self, decode: Literal[False]) -> bytes: ... - @overload - def recv(self, decode: bool | None = None) -> str | bytes: ... - def __exit__( - self, type: type[BaseException] | None, value: BaseException | None, traceback: types.TracebackType | None - ) -> None: ... - @staticmethod - def run_with_loop(main: Awaitable[_T], loop: AbstractEventLoop) -> _T: ... - def load_plugins(name: str, suffix: str, namespace: dict[str, Any]) -> dict[str, type[Any]]: ... def traverse_dict(dictn: Mapping[str, Any], keys: Collection[str], casesense: bool = True) -> Any: ... def decode_base(value: str, digits: str) -> int: ... diff --git a/python/helpers/typeshed/tests/mypy_test.py b/python/helpers/typeshed/tests/mypy_test.py index fd26e05ca85e..5e263a9cbb15 100644 --- a/python/helpers/typeshed/tests/mypy_test.py +++ b/python/helpers/typeshed/tests/mypy_test.py @@ -78,7 +78,7 @@ def remove_dev_suffix(version: str) -> str: """ if version.endswith("-dev"): return version[: -len("-dev")] - return version + return ".".join(version.split(".")[:2]) parser = argparse.ArgumentParser(